Changeset 18876
- Timestamp:
- 05/17/07 11:26:14 (1 year ago)
- Files:
-
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/pom.xml (modified) (3 diffs)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/theme/negotiation (added)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/theme/negotiation/LocalTheme.java (moved) (moved from org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/theme/LocalTheme.java) (3 diffs)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/theme/negotiation/LocalThemeConfig.java (added)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/theme/negotiation/LocalThemeHelper.java (added)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/resources/META-INF/MANIFEST.MF (modified) (2 diffs)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/resources/OSGI-INF/deployment-fragment.xml (modified) (3 diffs)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/resources/OSGI-INF/nxplacefulservice-configs-contrib.xml (added)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/resources/OSGI-INF/theme-contrib.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/pom.xml
r18652 r18876 56 56 </dependency> 57 57 <dependency> 58 <groupId>org.nuxeo.ecm.platform</groupId> 59 <artifactId>nuxeo-platform-placeful-facade</artifactId> 60 <type>ejb</type> 61 </dependency> 62 <dependency> 58 63 <groupId>org.nuxeo.theme</groupId> 59 64 <artifactId>nuxeo-theme-core</artifactId> … … 111 116 </dependency> 112 117 </dependencies> 113 <!-- 118 <!-- 114 119 <build> 115 120 <resources> … … 121 126 </build> 122 127 --> 123 <!-- this is used (the above build section also) 128 <!-- this is used (the above build section also) 124 129 to replace jboss.ws:di endpoint impl location in web.xml --> 125 130 <properties> org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/theme/negotiation/LocalTheme.java
r13246 r18876 1 1 /* 2 * (C) Copyright 2006 Nuxeo SAS <http://nuxeo.com> and others2 * (C) Copyright 2006-2007 Nuxeo SAS <http://nuxeo.com> and others 3 3 * 4 4 * All rights reserved. This program and the accompanying materials … … 13 13 */ 14 14 15 package org.nuxeo.ecm.webapp.theme;16 15 16 package org.nuxeo.ecm.webapp.theme.negotiation; 17 18 import org.apache.commons.logging.Log; 19 import org.apache.commons.logging.LogFactory; 20 import org.jboss.seam.contexts.Contexts; 17 21 import org.nuxeo.ecm.core.api.DocumentModel; 18 22 import org.nuxeo.theme.Manager; 19 23 import org.nuxeo.theme.elements.PageElement; 20 24 import org.nuxeo.theme.negotiation.Scheme; 21 import org.nuxeo.ecm.platform.ui.web.util.SeamContextHelper;22 25 23 26 /** 24 27 * Custom negotiation scheme for obtaining the local theme from the current 25 * document item.28 * document. 26 29 * 27 * @author Jean-Marc Orliaguet 28 * 30 * @author Jean-Marc Orliaguet <jmo@chalmers.se> 29 31 */ 30 32 public class LocalTheme implements Scheme { 33 34 private static Log log = LogFactory.getLog(LocalTheme.class); 31 35 32 36 /** … … 37 41 */ 38 42 public String getOutcome(Object context) { 39 SeamContextHelper seamCtxHelper = new SeamContextHelper(); 40 DocumentModel currentDocument = (DocumentModel) seamCtxHelper.get("currentDocument"); 41 43 DocumentModel currentDocument = ((DocumentModel) Contexts.lookupInStatefulContexts("currentDocument")); 42 44 if (currentDocument == null) { 43 45 return null; 44 46 } 45 47 46 // FIXME: get the theme/page token from the document model 47 String path = null; 48 String docId = currentDocument.getId(); 49 if (docId == null) { 50 return null; 51 } 48 52 53 // Get the placeful local theme configuration for the current document. 54 LocalThemeConfig localThemeConfig = LocalThemeHelper.getLocalThemeConfig(docId); 55 if (localThemeConfig == null) { 56 return null; 57 } 58 59 // Extract the page path 60 String path = localThemeConfig.getPagePath(); 49 61 if (path == null) { 50 62 return null; 51 63 } 64 log.debug(path); 65 66 // Look up the page 52 67 PageElement page = Manager.getThemeManager().getPageByPath(path); 53 68 if (page != null) { 54 69 return path; 55 70 } 71 log.debug(page); 56 72 return null; 73 57 74 } 58 75 org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/resources/META-INF/MANIFEST.MF
r18480 r18876 19 19 OSGI-INF/ecm-schemas-contrib.xml, 20 20 OSGI-INF/nxdirectories-contrib.xml, 21 OSGI-INF/nxplacefulservice-configs-contrib.xml, 21 22 OSGI-INF/nxsearchui-framework.xml, 22 23 OSGI-INF/nxsearchui-contrib.xml, 23 24 OSGI-INF/documentslists-framework.xml, 24 25 OSGI-INF/documentslists-contrib.xml, 25 OSGI-INF/services-binding-contrib.xml 26 OSGI-INF/services-binding-contrib.xml, 26 27 Require-Bundle: org.nuxeo.ecm.platform.usermanager, 27 28 org.nuxeo.ecm.platform.filemanager.core, … … 36 37 org.nuxeo.ecm.platform.workflow.api, 37 38 org.nuxeo.ecm.platform.workflow.document.api 39 Nuxeo-RequiredBy: org.nuxeo.ecm.platform.placeful.facade org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/resources/OSGI-INF/deployment-fragment.xml
r18799 r18876 16 16 </web> 17 17 </module> 18 </extension> 19 20 <extension target="persistence#CLASS"> 21 <class>org.nuxeo.ecm.webapp.theme.negotiation.LocalThemeConfig</class> 18 22 </extension> 19 23 … … 189 193 190 194 <extension target="components#PAGEFLOW"> 191 <value>config/addWorkspace.jpdl.xml</value>195 <value>config/addWorkspace.jpdl.xml</value> 192 196 </extension> 193 197 … … 336 340 </navigation-case> 337 341 338 <navigation-case>342 <navigation-case> 339 343 <from-outcome>edit_user_password</from-outcome> 340 344 <to-view-id>/edit_user_password.xhtml</to-view-id> org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/resources/OSGI-INF/theme-contrib.xml
r18872 r18876 219 219 <scheme>org.nuxeo.theme.jsf.negotiation.theme.ViewId</scheme> 220 220 <!-- local theme (specific to nuxeo5) --> 221 <scheme>org.nuxeo.ecm.webapp.theme. LocalTheme</scheme>221 <scheme>org.nuxeo.ecm.webapp.theme.negotiation.LocalTheme</scheme> 222 222 <scheme>org.nuxeo.theme.jsf.negotiation.theme.DefaultTheme</scheme> 223 223 </negotiation>
