KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > applications > publishingtool > actions > ViewPublicationsAction


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package org.infoglue.cms.applications.publishingtool.actions;
25
26 import java.util.List JavaDoc;
27
28 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction;
29 import org.infoglue.cms.controllers.kernel.impl.simple.PublicationController;
30 import org.infoglue.cms.controllers.kernel.impl.simple.RepositoryController;
31 import org.infoglue.cms.entities.content.ContentVO;
32 import org.infoglue.cms.entities.management.RepositoryVO;
33 import org.infoglue.cms.entities.publishing.EditionBrowser;
34 import org.infoglue.cms.entities.structure.SiteNodeVO;
35 import org.infoglue.cms.exception.SystemException;
36
37 /**
38  * This returns a list of all events to be published or denied,
39  * and a page of previously published editions.
40  *
41  * @author Stefan Sik, ss@frovi.com
42  * @author Frank Febbraro, frank@phase2technology.com
43  */

44 public class ViewPublicationsAction extends InfoGlueAbstractAction
45 {
46     private static final long serialVersionUID = 1L;
47
48     private int startIndex = 0;
49     private Integer JavaDoc repositoryId;
50     private Integer JavaDoc publicationId;
51     private RepositoryVO repositoryVO;
52     private List JavaDoc publicationEvents;
53     private List JavaDoc publicationDetailVOList;
54     private EditionBrowser editionBrowser;
55
56     public int getStartIndex() { return startIndex; }
57     public void setStartIndex(int i) { startIndex = i; }
58
59     public Integer JavaDoc getRepositoryId() { return repositoryId; }
60     public void setRepositoryId(Integer JavaDoc i) { repositoryId = i; }
61
62     public RepositoryVO getRepositoryVO() { return repositoryVO; }
63     public List JavaDoc getPublicationEvents() { return publicationEvents; }
64
65     public EditionBrowser getEditionBrowser() { return editionBrowser; }
66     public void setEditionBrowser(EditionBrowser b) { editionBrowser = b; }
67
68
69     public String JavaDoc doExecute() throws Exception JavaDoc
70     {
71         repositoryVO = RepositoryController.getController().getRepositoryVOWithId(repositoryId);
72         publicationEvents = PublicationController.getPublicationEvents(repositoryId);
73         editionBrowser = PublicationController.getEditionPage(repositoryId, startIndex);
74         return SUCCESS;
75     }
76     
77     public String JavaDoc doShowPublicationDetails() throws Exception JavaDoc
78     {
79         publicationDetailVOList = PublicationController.getPublicationDetailVOList(publicationId);
80         return "showPublicationDetails";
81     }
82
83     public static List JavaDoc getPublicationDetails(Integer JavaDoc publicationId) throws SystemException
84     {
85         return PublicationController.getPublicationDetailVOList(publicationId);
86     }
87
88     public ContentVO getOwningContent(Integer JavaDoc id) throws SystemException
89     {
90         return PublicationController.getOwningContentVO(id);
91     }
92
93     public SiteNodeVO getOwningSiteNode(Integer JavaDoc id) throws SystemException
94     {
95         return PublicationController.getOwningSiteNodeVO(id);
96     }
97
98     /**
99      * Escapes the string
100      */

101     public String JavaDoc escape(String JavaDoc string)
102     {
103         return string.replace('\'', '´');
104     }
105     
106     public void setPublicationId(Integer JavaDoc publicationId)
107     {
108         this.publicationId = publicationId;
109     }
110     
111     public List JavaDoc getPublicationDetailVOList()
112     {
113         return publicationDetailVOList;
114     }
115 }
116
Popular Tags