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.deployment.plugins;
18  
19  import org.exoplatform.container.xml.InitParams;
20  import org.exoplatform.services.cms.link.LinkManager;
21  import org.exoplatform.services.cms.taxonomy.TaxonomyService;
22  import org.exoplatform.services.deployment.DeploymentPlugin;
23  import org.exoplatform.services.jcr.RepositoryService;
24  import org.exoplatform.services.jcr.ext.common.SessionProvider;
25  import org.exoplatform.services.wcm.utils.WCMCoreUtils;
26  
27  /**
28   * Created by The eXo Platform SAS
29   * Author : Hoa Pham
30   * hoa.pham@exoplatform.com
31   * Sep 6, 2008
32   */
33  public class LinkDeploymentPlugin extends DeploymentPlugin {
34  
35    /** The repository service. */
36    private RepositoryService repositoryService;
37  
38    /** The link manager service. */
39    private LinkManager linkManager;
40  
41    /**
42     * Instantiates a new xML deployment plugin.
43     *
44     * @param initParams the init params
45     * @param repositoryService the repository service
46     * @param linkManager
47     * @param taxonomyService
48     */
49    public LinkDeploymentPlugin(InitParams initParams,
50                                RepositoryService repositoryService,
51                                LinkManager linkManager,
52                                TaxonomyService taxonomyService) {
53      super(initParams);
54      this.repositoryService = repositoryService;
55      this.linkManager = linkManager;
56    }
57  
58    /* (non-Javadoc)
59     * @see org.exoplatform.services.deployment.DeploymentPlugin#deploy(org.exoplatform.services.jcr.ext.common.SessionProvider)
60     */
61    public void deploy(SessionProvider sessionProvider) throws Exception {
62      WCMCoreUtils.deployLinkToPortal(initParams, repositoryService, linkManager, sessionProvider, null);
63    }
64  }