View Javadoc
1   /*
2    * Copyright (C) 2003-2008 eXo Platform SAS.
3    *
4    * This program is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU Affero General Public License
6    * as published by the Free Software Foundation; either version 3
7    * of the License, or (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program; if not, see<http://www.gnu.org/licenses/>.
16   */
17  package org.exoplatform.services.wcm.extensions.deployment;
18  
19  import org.exoplatform.container.configuration.ConfigurationManager;
20  import org.exoplatform.container.xml.InitParams;
21  import org.exoplatform.services.ecm.publication.PublicationService;
22  import org.exoplatform.services.jcr.RepositoryService;
23  import org.exoplatform.services.jcr.ext.common.SessionProvider;
24  import org.exoplatform.services.wcm.extensions.utils.PublicationUtils;
25  import org.exoplatform.services.wcm.portal.artifacts.CreatePortalPlugin;
26  import org.exoplatform.services.wcm.publication.WCMPublicationService;
27  
28  /**
29   * Created by The eXo Platform SAS
30   * Author : Hoa Pham
31   * hoa.pham@exoplatform.com
32   * Sep 6, 2008
33   */
34  public class CreatePortalPublicationPlugin extends CreatePortalPlugin {
35  
36    /** The init params. */
37    private InitParams initParams;
38  
39    /** The repository service. */
40    private RepositoryService repositoryService;
41  
42    /** The publication service */
43    private WCMPublicationService wcmPublicationService;
44  
45    /** The publication service */
46    private PublicationService publicationService;
47  
48    public static final String UPDATE_EVENT = "WCMPublicationService.event.updateState";
49  
50    /**
51     * Instantiates a new xML deployment plugin.
52     *
53     * @param initParams the init params
54     * @param repositoryService the repository service
55     * @param publicationService the publication service
56     */
57    public CreatePortalPublicationPlugin(InitParams initParams,
58                                       ConfigurationManager configurationManager,
59                                       RepositoryService repositoryService,
60                                       PublicationService publicationService,
61                                       WCMPublicationService wcmPublicationService) {
62      super(initParams, configurationManager, repositoryService);
63      this.initParams = initParams;
64      this.repositoryService = repositoryService;
65      this.publicationService = publicationService;
66      this.wcmPublicationService = wcmPublicationService;
67    }
68  
69    /* (non-Javadoc)
70     * @see org.exoplatform.services.deployment.DeploymentPlugin#deploy(org.exoplatform.services.jcr.ext.common.SessionProvider)
71     */
72    public void deployToPortal(SessionProvider sessionProvider, String portalName) throws Exception {
73      PublicationUtils.deployPublicationToPortal(initParams, repositoryService, wcmPublicationService, sessionProvider, portalName);
74    }
75  }