Changeset 5310 for trunk/pustefix-core/src/main/java/de/schlund/pfixcore/util/TransformerCallback.java
- Timestamp:
- 08/13/10 14:03:21 (22 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/pustefix-core/src/main/java/de/schlund/pfixcore/util/TransformerCallback.java
- Property svn:mergeinfo set to
r5218 r5310 172 172 } 173 173 } 174 174 175 175 public static Node getIWrapperInfo(RequestContextImpl requestContext, Node docNode, String pageName, String prefix) { 176 176 try { 177 PageRequest pageRequest; 177 178 ContextImpl context = requestContext.getParentContext(); 178 179 XsltVersion xsltVersion = Xml.getXsltVersion(docNode); 179 180 if (pageName == null || pageName.equals("")) { 180 PageRequest pg = requestContext.getCurrentPageRequest(); 181 if (pg != null) 182 pageName = pg.getName(); 183 else 184 throw new IllegalArgumentException("Missing page name"); 185 } 186 State state; 187 if (pageName != null) { 188 state = getState(context, pageName); 181 pageRequest = requestContext.getCurrentPageRequest(); 189 182 } else { 190 state = getState(context, context.getCurrentPageRequest().getName()); 191 } 192 if (state == null) { 193 return null; 194 } 195 if (state instanceof IWrapperState) { 183 pageRequest = context.createPageRequest(pageName); 184 } 185 PageRequestConfig pageConfig = context.getContextConfig().getPageRequestConfig(pageRequest.getName()); 186 State state = pageConfig.getState(); 187 if (state != null && state instanceof IWrapperState) { 196 188 IWrapperState iwState = (IWrapperState) state; 197 189 Map<String, ? extends IWrapperConfig> iwrappers = iwState.getIWrapperConfigMap(); … … 210 202 } 211 203 } 212 204 213 205 public static Node getIWrappers(RequestContextImpl requestContext, Node docNode, String pageName) throws Exception { 214 206 try { … … 219 211 Element root = doc.createElement("iwrappers"); 220 212 doc.appendChild(root); 213 PageRequest pageRequest; 221 214 if (pageName == null || pageName.equals("")) { 222 PageRequest pg = requestContext.getCurrentPageRequest(); 223 if (pg != null) 224 pageName = pg.getName(); 225 else 226 throw new IllegalArgumentException("Missing page name"); 227 } 228 State state = getState(context, pageName); 229 if (state instanceof IWrapperState) { 215 pageRequest = requestContext.getCurrentPageRequest(); 216 } else { 217 pageRequest = context.createPageRequest(pageName); 218 } 219 PageRequestConfig pageConfig = context.getContextConfig().getPageRequestConfig(pageRequest.getName()); 220 State state = pageConfig.getState(); 221 if (state != null && state instanceof IWrapperState) { 230 222 IWrapperState iwState = (IWrapperState) state; 231 223 Map<String, ? extends IWrapperConfig> iwrappers = iwState.getIWrapperConfigMap(); … … 238 230 } 239 231 } 240 PageRequestConfig pageConfig = context.getContextConfig().getPageRequestConfig(pageName);241 232 if(pageConfig != null) { 242 233 Map<String, ? extends ProcessActionPageRequestConfig> actions = pageConfig.getProcessActions();
