Source Code Cross Referenced for CmsProjectFilesDialog.java in  » Content-Management-System » opencms » org » opencms » workplace » tools » projects » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » opencms » org.opencms.workplace.tools.projects 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * File   : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/tools/projects/CmsProjectFilesDialog.java,v $
003:         * Date   : $Date: 2008-02-27 12:05:51 $
004:         * Version: $Revision: 1.20 $
005:         *
006:         * This library is part of OpenCms -
007:         * the Open Source Content Management System
008:         *
009:         * Copyright (c) 2002 - 2008 Alkacon Software GmbH (http://www.alkacon.com)
010:         *
011:         * This library is free software; you can redistribute it and/or
012:         * modify it under the terms of the GNU Lesser General Public
013:         * License as published by the Free Software Foundation; either
014:         * version 2.1 of the License, or (at your option) any later version.
015:         *
016:         * This library is distributed in the hope that it will be useful,
017:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
018:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019:         * Lesser General Public License for more details.
020:         *
021:         * For further information about Alkacon Software GmbH, please see the
022:         * company website: http://www.alkacon.com
023:         *
024:         * For further information about OpenCms, please see the
025:         * project website: http://www.opencms.org
026:         * 
027:         * You should have received a copy of the GNU Lesser General Public
028:         * License along with this library; if not, write to the Free Software
029:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
030:         */
031:
032:        package org.opencms.workplace.tools.projects;
033:
034:        import org.opencms.db.CmsResourceState;
035:        import org.opencms.file.CmsProject;
036:        import org.opencms.file.CmsResource;
037:        import org.opencms.jsp.CmsJspActionElement;
038:        import org.opencms.main.CmsException;
039:        import org.opencms.util.CmsStringUtil;
040:        import org.opencms.util.CmsUUID;
041:        import org.opencms.widgets.A_CmsWidget;
042:        import org.opencms.workplace.list.A_CmsListExplorerDialog;
043:        import org.opencms.workplace.list.CmsHtmlList;
044:        import org.opencms.workplace.list.CmsListDropdownAction;
045:        import org.opencms.workplace.list.CmsListMetadata;
046:        import org.opencms.workplace.list.I_CmsListResourceCollector;
047:
048:        import java.util.Iterator;
049:
050:        import javax.servlet.http.HttpServletRequest;
051:        import javax.servlet.http.HttpServletResponse;
052:        import javax.servlet.jsp.PageContext;
053:
054:        /**
055:         * Explorer dialog for the project files view.<p>
056:         * 
057:         * @author Michael Moossen 
058:         * 
059:         * @version $Revision: 1.20 $ 
060:         * 
061:         * @since 6.0.0 
062:         */
063:        public class CmsProjectFilesDialog extends A_CmsListExplorerDialog {
064:
065:            /** list independent action constant. */
066:            public static final String LIST_IACTION_FILTER = "iaf";
067:
068:            /** list id constant. */
069:            public static final String LIST_ID = "lpr";
070:
071:            /** The internal collector instance. */
072:            private I_CmsListResourceCollector m_collector;
073:
074:            /** Stores the value of the request parameter for the resource filter. */
075:            private String m_filter;
076:
077:            /** Stores the value of the request parameter for the project id. */
078:            private String m_paramProjectid;
079:
080:            /**
081:             * Public constructor with JSP action element.<p>
082:             * 
083:             * @param jsp an initialized JSP action element
084:             */
085:            public CmsProjectFilesDialog(CmsJspActionElement jsp) {
086:
087:                super (jsp, LIST_ID, Messages.get().container(
088:                        Messages.GUI_PROJECT_FILES_LIST_NAME_0));
089:            }
090:
091:            /**
092:             * Public constructor with JSP variables.<p>
093:             * 
094:             * @param context the JSP page context
095:             * @param req the JSP request
096:             * @param res the JSP response
097:             */
098:            public CmsProjectFilesDialog(PageContext context,
099:                    HttpServletRequest req, HttpServletResponse res) {
100:
101:                this (new CmsJspActionElement(context, req, res));
102:            }
103:
104:            /**
105:             * @see org.opencms.workplace.list.A_CmsListDialog#executeListIndepActions()
106:             */
107:            public void executeListIndepActions() {
108:
109:                if (getParamListAction().equals(LIST_IACTION_FILTER)) {
110:                    // forward to the editor
111:                    getList().setCurrentPage(1);
112:                    m_collector = null;
113:                    refreshList();
114:                } else {
115:                    super .executeListIndepActions();
116:                }
117:            }
118:
119:            /**
120:             * @see org.opencms.workplace.list.A_CmsListDialog#executeListMultiActions()
121:             */
122:            public void executeListMultiActions() {
123:
124:                throwListUnsupportedActionException();
125:            }
126:
127:            /**
128:             * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions()
129:             */
130:            public void executeListSingleActions() {
131:
132:                throwListUnsupportedActionException();
133:            }
134:
135:            /**
136:             * @see org.opencms.workplace.list.A_CmsListExplorerDialog#getCollector()
137:             */
138:            public I_CmsListResourceCollector getCollector() {
139:
140:                if (m_collector == null) {
141:                    CmsUUID projectId = getProject().getUuid();
142:                    CmsResourceState state = CmsResource.STATE_KEEP;
143:                    CmsHtmlList list = getList();
144:                    if (list != null) {
145:                        if (getSettings().getCollector() != null) {
146:                            getSettings().setCollector(null);
147:                        }
148:                    }
149:                    if (m_filter.equals("new")) {
150:                        state = CmsResource.STATE_NEW;
151:                    } else if (m_filter.equals("changed")) {
152:                        state = CmsResource.STATE_CHANGED;
153:                    } else if (m_filter.equals("deleted")) {
154:                        state = CmsResource.STATE_DELETED;
155:                    }
156:                    m_collector = new CmsProjectFilesCollector(this , projectId,
157:                            state);
158:                }
159:                return m_collector;
160:            }
161:
162:            /**
163:             * @see org.opencms.workplace.list.A_CmsListDialog#getList()
164:             */
165:            public CmsHtmlList getList() {
166:
167:                CmsHtmlList list = super .getList();
168:                // get parameter
169:                m_filter = getJsp().getRequest().getParameter(
170:                        LIST_IACTION_FILTER
171:                                + CmsListDropdownAction.SUFFIX_PARAM);
172:                CmsListDropdownAction listAction = null;
173:                if (list != null) {
174:                    listAction = ((CmsListDropdownAction) list.getMetadata()
175:                            .getIndependentAction(LIST_IACTION_FILTER));
176:                    if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_filter)) {
177:                        // if no param, get old value
178:                        m_filter = listAction.getSelection();
179:                    }
180:                }
181:                if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_filter)) {
182:                    m_filter = CmsProjectResourcesDisplayMode.ALL_CHANGES
183:                            .getMode();
184:                }
185:                if (listAction != null) {
186:                    listAction.setSelection(m_filter);
187:                }
188:                return list;
189:            }
190:
191:            /**
192:             * Returns the project id parameter value.<p>
193:             * 
194:             * @return the project id parameter value
195:             */
196:            public String getParamProjectid() {
197:
198:                return m_paramProjectid;
199:            }
200:
201:            /**
202:             * @see org.opencms.workplace.list.A_CmsListDialog#refreshList()
203:             */
204:            public synchronized void refreshList() {
205:
206:                if (LIST_IACTION_FILTER.equals(getParamListAction())) {
207:                    if (m_collector != null) {
208:                        // refresh only if really necessary
209:                        return;
210:                    }
211:                }
212:                super .refreshList();
213:            }
214:
215:            /**
216:             * Sets the project id parameter value.<p>
217:             * 
218:             * @param projectId the project id parameter value
219:             */
220:            public void setParamProjectid(String projectId) {
221:
222:                m_paramProjectid = projectId;
223:            }
224:
225:            /**
226:             * @see org.opencms.workplace.list.A_CmsListDialog#fillDetails(java.lang.String)
227:             */
228:            protected void fillDetails(String detailId) {
229:
230:                // no-details
231:            }
232:
233:            /**
234:             * @see org.opencms.workplace.list.A_CmsListExplorerDialog#getProject()
235:             */
236:            protected CmsProject getProject() {
237:
238:                CmsUUID projectId = new CmsUUID(getParamProjectid());
239:                try {
240:                    return getCms().readProject(projectId);
241:                } catch (CmsException e) {
242:                    return super .getProject();
243:                }
244:            }
245:
246:            /**
247:             * @see org.opencms.workplace.CmsWorkplace#initMessages()
248:             */
249:            protected void initMessages() {
250:
251:                // add specific dialog resource bundle
252:                addMessages(Messages.get().getBundleName());
253:                // add default resource bundles
254:                super .initMessages();
255:            }
256:
257:            /**
258:             * @see org.opencms.workplace.list.A_CmsListDialog#setIndependentActions(org.opencms.workplace.list.CmsListMetadata)
259:             */
260:            protected void setIndependentActions(CmsListMetadata metadata) {
261:
262:                CmsListDropdownAction filterAction = new CmsListDropdownAction(
263:                        LIST_IACTION_FILTER);
264:                filterAction.setName(Messages.get().container(
265:                        Messages.GUI_PROJECT_FILES_FILTER_ACTION_NAME_0));
266:                filterAction.setHelpText(Messages.get().container(
267:                        Messages.GUI_PROJECT_FILES_FILTER_ACTION_HELP_0));
268:                Iterator it = CmsProjectResourcesDisplayMode.VALUES.iterator();
269:                while (it.hasNext()) {
270:                    CmsProjectResourcesDisplayMode mode = (CmsProjectResourcesDisplayMode) it
271:                            .next();
272:                    filterAction.addItem(mode.getMode(), Messages.get()
273:                            .container(
274:                                    A_CmsWidget.LABEL_PREFIX + mode.getMode()));
275:                }
276:                metadata.addIndependentAction(filterAction);
277:                super .setIndependentActions(metadata);
278:            }
279:
280:            /**
281:             * @see org.opencms.workplace.list.A_CmsListDialog#setMultiActions(org.opencms.workplace.list.CmsListMetadata)
282:             */
283:            protected void setMultiActions(CmsListMetadata metadata) {
284:
285:                // no LMAs
286:            }
287:
288:            /**
289:             * @see org.opencms.workplace.list.A_CmsListDialog#validateParamaters()
290:             */
291:            protected void validateParamaters() throws Exception {
292:
293:                try {
294:                    getCms().readProject(new CmsUUID(getParamProjectid()));
295:                } catch (Exception e) {
296:                    if (!getCms().getRequestContext().currentProject()
297:                            .isOnlineProject()) {
298:                        m_paramProjectid = getCms().getRequestContext()
299:                                .currentProject().getUuid().toString();
300:                    } else {
301:                        throw e;
302:                    }
303:                }
304:
305:            }
306:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.