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.link;
18  
19  import org.exoplatform.container.configuration.ConfigurationManager;
20  import org.exoplatform.container.xml.InitParams;
21  import org.exoplatform.services.cms.link.LinkManager;
22  import org.exoplatform.services.cms.taxonomy.TaxonomyService;
23  import org.exoplatform.services.jcr.RepositoryService;
24  import org.exoplatform.services.jcr.ext.common.SessionProvider;
25  import org.exoplatform.services.wcm.portal.artifacts.CreatePortalPlugin;
26  import org.exoplatform.services.wcm.utils.WCMCoreUtils;
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 CreatePortalLinkPlugin extends CreatePortalPlugin {
35  
36    /** The init params. */
37    private InitParams initParams;
38  
39    /** The repository service. */
40    private RepositoryService repositoryService;
41  
42    /** The link manager service. */
43    private LinkManager linkManager;
44  
45    /**
46     * Instantiates a new xML deployment plugin.
47     *
48     * @param initParams the init params
49     * @param configurationManager the configuration manager
50     * @param repositoryService the repository service
51     * @param linkManager the linkManager service
52     * @param taxonomyService the taxonomy service
53     */
54    public CreatePortalLinkPlugin(InitParams initParams,
55                                ConfigurationManager configurationManager,
56                                RepositoryService repositoryService,
57                                LinkManager linkManager,
58                                TaxonomyService taxonomyService) {
59      super(initParams, configurationManager, repositoryService);
60      this.initParams = initParams;
61      this.repositoryService = repositoryService;
62      this.linkManager = linkManager;
63    }
64  
65    /* (non-Javadoc)
66     * @see org.exoplatform.services.deployment.DeploymentPlugin#deploy(org.exoplatform.services.jcr.ext.common.SessionProvider)
67     */
68    public void deployToPortal(SessionProvider sessionProvider, String portalName) throws Exception {
69      WCMCoreUtils.deployLinkToPortal(initParams, repositoryService, linkManager, sessionProvider, portalName);
70    }
71  }