Changeset 5307
- Timestamp:
- 08/13/10 12:55:15 (18 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/release-0.15.x/pustefix-core/src/main/java/de/schlund/pfixcore/util/TransformerCallback.java
r4634 r5307 58 58 import de.schlund.pfixxml.resources.FileResource; 59 59 import de.schlund.pfixxml.resources.ResourceUtil; 60 import de.schlund.pfixxml.targets.PageTargetTree;61 60 import de.schlund.pfixxml.targets.TargetGenerator; 62 61 import de.schlund.pfixxml.targets.TargetGeneratorFactory; … … 180 179 } 181 180 } 182 181 183 182 public static Node getIWrapperInfo(RequestContextImpl requestContext, Node docNode, String pageName, String prefix) { 184 183 try { 184 PageRequest pageRequest; 185 185 ContextImpl context = requestContext.getParentContext(); 186 186 XsltVersion xsltVersion = Xml.getXsltVersion(docNode); 187 187 if (pageName == null || pageName.equals("")) { 188 PageRequest pg = requestContext.getCurrentPageRequest(); 189 if (pg != null) 190 pageName = pg.getName(); 191 else 192 throw new IllegalArgumentException("Missing page name"); 193 } 194 State state; 195 if (pageName != null) { 196 state = context.getPageMap().getState(pageName); 188 pageRequest = requestContext.getCurrentPageRequest(); 197 189 } else { 198 state = context.getPageMap().getState(context.getCurrentPageRequest()); 199 } 200 if (state == null) { 201 return null; 202 } 203 if (state instanceof IWrapperState) { 190 pageRequest = context.createPageRequest(pageName); 191 } 192 State state = context.getPageMap().getState(pageRequest); 193 if (state != null && state instanceof IWrapperState) { 204 194 IWrapperState iwState = (IWrapperState) state; 205 195 Map<String, ? extends IWrapperConfig> iwrappers = iwState.getIWrapperConfigMap(); … … 218 208 } 219 209 } 220 210 221 211 public static Node getIWrappers(RequestContextImpl requestContext, Node docNode, String pageName) throws Exception { 222 212 try { … … 227 217 Element root = doc.createElement("iwrappers"); 228 218 doc.appendChild(root); 219 PageRequest pageRequest; 229 220 if (pageName == null || pageName.equals("")) { 230 PageRequest pg = requestContext.getCurrentPageRequest(); 231 if (pg != null) 232 pageName = pg.getName(); 233 else 234 throw new IllegalArgumentException("Missing page name"); 235 } 236 State state = context.getPageMap().getState(pageName); 237 if (state instanceof IWrapperState) { 221 pageRequest = requestContext.getCurrentPageRequest(); 222 } else { 223 pageRequest = context.createPageRequest(pageName); 224 } 225 PageRequestConfig pageConfig = context.getContextConfig().getPageRequestConfig(pageRequest.getName()); 226 State state = context.getPageMap().getState(pageRequest); 227 if (state != null && state instanceof IWrapperState) { 238 228 IWrapperState iwState = (IWrapperState) state; 239 229 Map<String, ? extends IWrapperConfig> iwrappers = iwState.getIWrapperConfigMap(); … … 246 236 } 247 237 } 248 PageRequestConfig pageConfig = context.getContextConfig().getPageRequestConfig(pageName);249 238 if(pageConfig != null) { 250 239 Map<String, ? extends ProcessActionPageRequestConfig> actions = pageConfig.getProcessActions();
