- Timestamp:
- 01/20/12 18:18:07 (4 months ago)
- Location:
- trunk/pustefix-core/src/main
- Files:
-
- 10 modified
-
java/de/schlund/pfixxml/IncludeDocumentExtension.java (modified) (5 diffs)
-
java/de/schlund/pfixxml/IncludeDocumentExtensionSaxon1.java (modified) (2 diffs)
-
java/de/schlund/pfixxml/IncludeDocumentExtensionSaxon2.java (modified) (2 diffs)
-
java/de/schlund/pfixxml/IncludePartInfo.java (modified) (3 diffs)
-
java/de/schlund/pfixxml/IncludePartsInfo.java (modified) (3 diffs)
-
java/de/schlund/pfixxml/IncludePartsInfoFactory.java (modified) (3 diffs)
-
java/de/schlund/pfixxml/IncludePartsInfoParser.java (modified) (3 diffs)
-
java/de/schlund/pfixxml/resources/DynamicResourceProvider.java (modified) (1 diff)
-
java/de/schlund/pfixxml/targets/TargetGenerator.java (modified) (2 diffs)
-
resources/PUSTEFIX-INF/xsl/include.xsl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pustefix-core/src/main/java/de/schlund/pfixxml/IncludeDocumentExtension.java
r5965 r6114 38 38 import de.schlund.pfixxml.resources.DynamicResourceProvider; 39 39 import de.schlund.pfixxml.resources.Resource; 40 import de.schlund.pfixxml.resources.ResourceProviderRegistry; 40 41 import de.schlund.pfixxml.resources.ResourceUtil; 41 42 import de.schlund.pfixxml.targets.TargetGenerator; … … 70 71 private static Pattern dynamicUriPattern = Pattern.compile("dynamic://[^?#]*(\\?([^#]*))?(#.*)?"); 71 72 72 private static DynamicResourceProvider dynamicResourceProvider = new DynamicResourceProvider();73 private static DynamicResourceProvider dynamicResourceProvider = (DynamicResourceProvider)ResourceProviderRegistry.getResourceProvider("dynamic"); 73 74 74 75 //~ Methods … … 121 122 } 122 123 123 String uriStr = path_str; 124 125 if(!uriStr.matches("^\\w+:.*")) { 126 boolean dynamic = false; 127 if(search!=null && !search.trim().equals("")) { 128 if(search.equals("dynamic")) dynamic = true; 129 else throw new XMLException("Unsupported include search argument: " + search); 130 } 131 if(dynamic) { 132 String filter = FilterHelper.getFilter(tenant, language); 133 uriStr = "dynamic:/" + path_str + "?part=" + part + "&parent=" + parent_uri_str; 134 if(!"WEBAPP".equalsIgnoreCase(module)) { 135 if(module != null) { 136 uriStr += "&module="+module; 137 } else if("module".equals(parentURI.getScheme())) { 138 uriStr += "&module="+parentURI.getAuthority(); 139 } 140 if(filter != null) uriStr += "&filter=" + URLEncoder.encode(filter, "UTF-8"); 141 } 142 } else { 143 if(!"WEBAPP".equalsIgnoreCase(module)) { 144 if(module != null) { 145 uriStr = "module://" + module + "/" + path_str; 146 } else if("module".equals(parentURI.getScheme())) { 147 uriStr = "module://" + parentURI.getAuthority() + "/" + path_str; 148 } 149 } 150 } 151 } else if(uriStr.matches("^dynamic://.*")) { 152 //add missing dynamic URI parameters 153 Matcher matcher = dynamicUriPattern.matcher(uriStr); 154 if(matcher.matches()) { 155 URIParameters params; 156 if(matcher.group(2) != null) params = new URIParameters(matcher.group(2), "UTF-8"); 157 else params = new URIParameters(); 158 if(params.getParameter("part") == null) params.addParameter("part", part); 159 if(params.getParameter("parent") == null) params.addParameter("parent", parent_uri_str); 160 if(matcher.group(2) == null) { 161 if(matcher.group(3) == null) uriStr += "?" + params.toString(); 162 else uriStr = uriStr.substring(0, matcher.start(3)) + "?" + params.toString() + uriStr.substring(matcher.start(3)); 163 } else { 164 uriStr = uriStr.substring(0, matcher.start(2)) + params.toString() + uriStr.substring(matcher.end(2)); 165 } 166 } 167 } 168 124 String uriStr = makeURI(path_str, part, module, search, tenant, language, parentURI); 125 169 126 // EEEEK! this code is in need of some serious beautifying.... 170 127 … … 326 283 } 327 284 285 private static String makeURI(String path, String part, String module, String search, String tenant, String language, URI parentURI) throws Exception { 286 String uriStr = path; 287 if(!uriStr.matches("^\\w+:.*")) { 288 boolean dynamic = false; 289 if(search!=null && !search.trim().equals("")) { 290 if(search.equals("dynamic")) dynamic = true; 291 else throw new XMLException("Unsupported include search argument: " + search); 292 } 293 if(dynamic) { 294 String filter = FilterHelper.getFilter(tenant, language); 295 uriStr = "dynamic:/" + path + "?part=" + part + "&parent=" + parentURI.toASCIIString(); 296 if(!"WEBAPP".equalsIgnoreCase(module)) { 297 if(module != null) { 298 uriStr += "&module="+module; 299 } else if("module".equals(parentURI.getScheme())) { 300 uriStr += "&module="+parentURI.getAuthority(); 301 } 302 if(filter != null) uriStr += "&filter=" + URLEncoder.encode(filter, "UTF-8"); 303 } 304 } else { 305 if(!"WEBAPP".equalsIgnoreCase(module)) { 306 if(module != null) { 307 uriStr = "module://" + module + "/" + path; 308 } else if("module".equals(parentURI.getScheme())) { 309 uriStr = "module://" + parentURI.getAuthority() + "/" + path; 310 } 311 } 312 } 313 } else if(uriStr.matches("^dynamic://.*")) { 314 //add missing dynamic URI parameters 315 Matcher matcher = dynamicUriPattern.matcher(uriStr); 316 if(matcher.matches()) { 317 URIParameters params; 318 if(matcher.group(2) != null) params = new URIParameters(matcher.group(2), "UTF-8"); 319 else params = new URIParameters(); 320 if(params.getParameter("part") == null) params.addParameter("part", part); 321 if(params.getParameter("parent") == null) params.addParameter("parent", parentURI.toASCIIString()); 322 if(matcher.group(2) == null) { 323 if(matcher.group(3) == null) uriStr += "?" + params.toString(); 324 else uriStr = uriStr.substring(0, matcher.start(3)) + "?" + params.toString() + uriStr.substring(matcher.start(3)); 325 } else { 326 uriStr = uriStr.substring(0, matcher.start(2)) + params.toString() + uriStr.substring(matcher.end(2)); 327 } 328 } 329 } 330 return uriStr; 331 } 332 333 public static final boolean exists(XsltContext context, String path_str, String part, TargetGenerator targetgen, 334 String targetkey, String module, String search, String tenant, String language) throws Exception { 335 336 if(path_str.startsWith("docroot:")) path_str = path_str.substring(9); 337 if(module != null) { 338 module = module.trim(); 339 if(module.equals("")) module = null; 340 } 341 if (path_str == null || path_str.equals("")) { 342 throw new XMLException("Need href for pfx:include existence check"); 343 } 344 if (path_str.startsWith("/")) path_str = path_str.substring(1); 345 346 String parentSystemId = getSystemId(context); 347 URI parentURI = new URI(parentSystemId); 348 String uriStr = makeURI(path_str, part, module, search, tenant, language, parentURI); 349 350 try { 351 352 Resource path = ResourceUtil.getResource(uriStr); 353 resolvedUri.set(path.toURI().toString()); 354 355 VirtualTarget target = (VirtualTarget) targetgen.getTarget(targetkey); 356 357 String[] themes = targetgen.getGlobalThemes().getThemesArr(); 358 if (!targetkey.equals(NOTARGET)) { 359 themes = target.getThemes().getThemesArr(); 360 } 361 if (themes == null) { 362 XMLException ex = new XMLException("Target has a 'null' themes array!"); 363 target.setStoredException(ex); 364 throw ex; 365 } 366 if (themes.length < 1) { 367 XMLException ex = new XMLException("Target has an empty themes array!"); 368 target.setStoredException(ex); 369 throw ex; 370 } 371 372 if (path != null && path.exists()) { 373 IncludePartsInfo partsInfo = dynamicResourceProvider.getIncludePartsInfoFactory().getIncludePartsInfo(path); 374 if(partsInfo != null) { 375 IncludePartInfo partInfo = partsInfo.getPart(part); 376 if(partInfo != null) { 377 String matchingTheme = partInfo.getMatchingTheme(themes); 378 if(matchingTheme != null) { 379 return true; 380 } 381 } 382 } 383 } 384 return false; 385 386 } catch (Exception e) { 387 ExtensionFunctionUtils.setExtensionFunctionError(e); 388 throw e; 389 } 390 } 391 392 328 393 public static String getResolvedURI() { 329 394 return resolvedUri.get(); … … 375 440 } 376 441 } 442 443 public static final String getModuleFromSystemId(XsltContext context) { 444 String sysid = context.getSystemId(); 445 if(sysid.startsWith("module://")) { 446 int ind = sysid.indexOf('/', 9); 447 String module = sysid.substring(9, ind); 448 return module; 449 } 450 return ""; 451 } 377 452 378 453 public static boolean isIncludeDocument(XsltContext context) { 379 454 return context.getDocumentElementName().equals("include_parts"); 380 455 } 456 381 457 }// end of class IncludeDocumentExtension -
trunk/pustefix-core/src/main/java/de/schlund/pfixxml/IncludeDocumentExtensionSaxon1.java
r5841 r6114 44 44 } 45 45 46 public static boolean exists(Context context,String path_str,String part,TargetGenerator targetgen,String targetkey, 47 String module,String search, String tenant, String language) throws Exception { 48 try { 49 XsltContext xsltContext=new XsltContextSaxon1(context); 50 return IncludeDocumentExtension.exists(xsltContext,path_str,part,targetgen,targetkey, 51 module,search, tenant, language); 52 } catch(Exception x) { 53 ExtensionFunctionUtils.setExtensionFunctionError(x); 54 throw x; 55 } 56 } 57 46 58 public static String getSystemId(Context context) { 47 59 XsltContext xsltContext=new XsltContextSaxon1(context); … … 52 64 XsltContext xsltContext=new XsltContextSaxon1(context); 53 65 return IncludeDocumentExtension.getRelativePathFromSystemId(xsltContext); 66 } 67 68 public static final String getModuleFromSystemId(Context context) { 69 XsltContext xsltContext = new XsltContextSaxon1(context); 70 return IncludeDocumentExtension.getModuleFromSystemId(xsltContext); 54 71 } 55 72 -
trunk/pustefix-core/src/main/java/de/schlund/pfixxml/IncludeDocumentExtensionSaxon2.java
r5841 r6114 46 46 } 47 47 48 public static boolean exists(XPathContext context,String path_str,String part,TargetGenerator targetgen,String targetkey, 49 String module,String search, String tenant, String language) throws Exception { 50 try { 51 XsltContext xsltContext=new XsltContextSaxon2(context); 52 return IncludeDocumentExtension.exists(xsltContext,path_str,part,targetgen,targetkey, 53 module,search, tenant, language); 54 } catch(Exception x) { 55 ExtensionFunctionUtils.setExtensionFunctionError(x); 56 throw x; 57 } 58 } 59 48 60 public static String getSystemId(XPathContext context) { 49 61 XsltContext xsltContext=new XsltContextSaxon2(context); … … 54 66 XsltContext xsltContext=new XsltContextSaxon2(context); 55 67 return IncludeDocumentExtension.getRelativePathFromSystemId(xsltContext); 68 } 69 70 public static final String getModuleFromSystemId(XPathContext context) { 71 XsltContext xsltContext = new XsltContextSaxon2(context); 72 return IncludeDocumentExtension.getModuleFromSystemId(xsltContext); 56 73 } 57 74 -
trunk/pustefix-core/src/main/java/de/schlund/pfixxml/IncludePartInfo.java
r5788 r6114 1 1 package de.schlund.pfixxml; 2 2 3 import java.util.HashSet; 3 4 import java.util.Set; 4 5 5 6 public class IncludePartInfo { 6 7 7 private String name; 8 private boolean render; 9 private Set<String> renderVariants; 8 private final String name; 9 private final boolean render; 10 private final Set<String> renderVariants; 11 private final Set<String> themes; 10 12 11 13 public IncludePartInfo(String name, boolean render, Set<String> renderVariants) { … … 13 15 this.render = render; 14 16 this.renderVariants = renderVariants; 17 this.themes = new HashSet<String>(); 15 18 } 16 19 … … 27 30 } 28 31 32 public Set<String> getThemes() { 33 return themes; 34 } 35 36 void addTheme(String theme) { 37 themes.add(theme); 38 } 39 40 public String getMatchingTheme(String[] themeList) { 41 for(String theme: themeList) { 42 if(themes.contains(theme)) { 43 return theme; 44 } 45 } 46 return null; 47 } 48 29 49 } -
trunk/pustefix-core/src/main/java/de/schlund/pfixxml/IncludePartsInfo.java
r5788 r6114 1 1 package de.schlund.pfixxml; 2 2 3 import java.util.Collections; 3 4 import java.util.Map; 4 5 5 6 public class IncludePartsInfo { 6 7 7 private Map<String, IncludePartInfo> parts;8 private final Map<String, IncludePartInfo> parts; 8 9 private long lastMod; 9 10 10 public void setParts(Map<String, IncludePartInfo> parts) {11 this.parts = parts;11 public IncludePartsInfo(Map<String, IncludePartInfo> parts) { 12 this.parts = Collections.unmodifiableMap(parts); 12 13 } 13 14 … … 16 17 } 17 18 18 public void setLastMod(long lastMod) {19 this.lastMod = lastMod;19 public IncludePartInfo getPart(String partName) { 20 return parts.get(partName); 20 21 } 21 22 … … 24 25 } 25 26 27 void setLastMod(long lastMod) { 28 this.lastMod = lastMod; 29 } 30 26 31 } -
trunk/pustefix-core/src/main/java/de/schlund/pfixxml/IncludePartsInfoFactory.java
r6095 r6114 9 9 public class IncludePartsInfoFactory { 10 10 11 private Map<String, IncludePartsInfo> urisToInfo;12 private boolean reloadable;11 private final Map<String, IncludePartsInfo> urisToInfo; 12 private final boolean reloadable; 13 13 14 14 public IncludePartsInfoFactory() { 15 15 urisToInfo = new HashMap<String, IncludePartsInfo>(); 16 16 String mode = EnvironmentProperties.getProperties().getProperty("mode"); 17 if(mode != null && !mode.equals("prod")) reloadable = true;17 reloadable = !"prod".equals(mode); 18 18 } 19 19 … … 28 28 public IncludePartsInfo getIncludePartsInfo(Resource resource) throws IncludePartsInfoParsingException { 29 29 String uri = resource.toURI().toString(); 30 IncludePartsInfo info = urisToInfo.get(uri); 30 IncludePartsInfo info = null; 31 synchronized(urisToInfo) { 32 info = urisToInfo.get(uri); 33 } 31 34 if(info == null || (reloadable && (info.getLastMod() < resource.lastModified()))) { 32 35 info = IncludePartsInfoParser.parse(resource); 33 urisToInfo.put(uri, info); 36 synchronized(urisToInfo) { 37 urisToInfo.put(uri, info); 38 } 34 39 } 35 40 return info; … … 37 42 38 43 public void reset() { 39 urisToInfo.clear(); 44 synchronized(urisToInfo) { 45 urisToInfo.clear(); 46 } 40 47 } 41 48 -
trunk/pustefix-core/src/main/java/de/schlund/pfixxml/IncludePartsInfoParser.java
r5788 r6114 44 44 throw new IncludePartsInfoParsingException(source.getSystemId(), x); 45 45 } 46 IncludePartsInfo info = new IncludePartsInfo(); 47 info.setParts(handler.getParts()); 48 return info; 46 return new IncludePartsInfo(handler.getParts()); 49 47 } 50 48 … … 53 51 private int level; 54 52 private boolean isIncludeParts; 53 54 private IncludePartInfo currentInfo; 55 55 56 private Map<String, IncludePartInfo> includePartInfos = new HashMap<String, IncludePartInfo>(); 56 57 … … 66 67 isIncludeParts = true; 67 68 } 68 } else if(level == 2 && isIncludeParts) { 69 if(localName.equals("part")) { 70 String partName = attributes.getValue("name"); 71 if(partName != null) { 72 partName = partName.trim(); 73 boolean render = false; 74 String val = attributes.getValue("render"); 75 if(val != null) { 76 render = Boolean.parseBoolean(val); 69 } else if(isIncludeParts) { 70 if(level == 2) { 71 if(localName.equals("part")) { 72 String partName = attributes.getValue("name"); 73 if(partName != null) { 74 partName = partName.trim(); 75 boolean render = false; 76 String val = attributes.getValue("render"); 77 if(val != null) { 78 render = Boolean.parseBoolean(val); 79 } 80 String[] variants = null; 81 val = attributes.getValue("render-variants"); 82 if(val != null) { 83 val = val.trim(); 84 variants = val.split("\\s+"); 85 } 86 Set<String> variantSet = new HashSet<String>(); 87 if(variants != null) { 88 for(String variant: variants) variantSet.add(variant); 89 } 90 currentInfo = new IncludePartInfo(partName, render, variantSet); 91 includePartInfos.put(partName, currentInfo); 77 92 } 78 String[] variants = null; 79 val = attributes.getValue("render-variants"); 80 if(val != null) { 81 val = val.trim(); 82 variants = val.split("\\s+"); 93 } 94 } else if(level == 3) { 95 if(localName.equals("theme")) { 96 String themeName = attributes.getValue("name"); 97 if(themeName != null) { 98 themeName = themeName.trim(); 99 currentInfo.addTheme(themeName); 83 100 } 84 Set<String> variantSet = new HashSet<String>();85 if(variants != null) {86 for(String variant: variants) variantSet.add(variant);87 }88 IncludePartInfo info = new IncludePartInfo(partName, render, variantSet);89 includePartInfos.put(partName, info);90 101 } 91 102 } -
trunk/pustefix-core/src/main/java/de/schlund/pfixxml/resources/DynamicResourceProvider.java
r5849 r6114 226 226 } 227 227 228 public IncludePartsInfoFactory getIncludePartsInfoFactory() { 229 return incInfo; 230 } 231 228 232 } -
trunk/pustefix-core/src/main/java/de/schlund/pfixxml/targets/TargetGenerator.java
r6095 r6114 83 83 import de.schlund.pfixxml.event.ConfigurationChangeListener; 84 84 import de.schlund.pfixxml.resources.DocrootResource; 85 import de.schlund.pfixxml.resources.DynamicResourceProvider; 85 86 import de.schlund.pfixxml.resources.FileResource; 86 87 import de.schlund.pfixxml.resources.ModuleResource; 87 88 import de.schlund.pfixxml.resources.Resource; 88 89 import de.schlund.pfixxml.resources.ResourceFinder; 90 import de.schlund.pfixxml.resources.ResourceProviderRegistry; 89 91 import de.schlund.pfixxml.resources.ResourceUtil; 90 92 import de.schlund.pfixxml.resources.ResourceVisitor; … … 210 212 sharedLeafFactory = new SharedLeafFactory(); 211 213 pageInfoFactory = new PageInfoFactory(); 212 includePartsInfo = newIncludePartsInfoFactory();214 includePartsInfo = ((DynamicResourceProvider)ResourceProviderRegistry.getResourceProvider("dynamic")).getIncludePartsInfoFactory(); 213 215 Meminfo meminfo = new Meminfo(); 214 216 meminfo.print("TG: Before loading " + config_path.toString()); -
trunk/pustefix-core/src/main/resources/PUSTEFIX-INF/xsl/include.xsl
r5941 r6114 471 471 </xsl:choose> 472 472 </ixsl:with-param> 473 <xsl:if test="@module"> 474 <ixsl:with-param name="module"><xsl:value-of select="@module"/></ixsl:with-param> 475 </xsl:if> 473 <ixsl:with-param name="module"> 474 <xsl:choose> 475 <xsl:when test="@module"> 476 <xsl:value-of select="@module"/> 477 </xsl:when> 478 <xsl:otherwise> 479 <xsl:value-of select="include:getModuleFromSystemId()"/> 480 </xsl:otherwise> 481 </xsl:choose> 482 </ixsl:with-param> 476 483 <xsl:if test="@search"> 477 484 <ixsl:with-param name="search"><xsl:value-of select="@search"/></ixsl:with-param> … … 479 486 </ixsl:call-template> 480 487 </xsl:template> 488 489 <xsl:template match="pfx:checkinclude"> 490 <xsl:param name="part"><xsl:value-of select="@part"/></xsl:param> 491 <xsl:param name="href"><xsl:value-of select="@href"/></xsl:param> 492 <xsl:param name="module"><xsl:value-of select="@module"/></xsl:param> 493 <xsl:param name="search"><xsl:value-of select="@search"/></xsl:param> 494 <xsl:variable name="module_name"> 495 <xsl:choose> 496 <xsl:when test="@module='PAGEDEF' or @module='pagedef'"> 497 <xsl:value-of select="$__defining_module"/> 498 </xsl:when> 499 <xsl:otherwise> 500 <xsl:value-of select="$module"/> 501 </xsl:otherwise> 502 </xsl:choose> 503 </xsl:variable> 504 <xsl:variable name="realpath"> 505 <xsl:choose> 506 <xsl:when test="not($href='')"> 507 <xsl:value-of select="$href"/> 508 </xsl:when> 509 <xsl:otherwise> 510 <xsl:value-of select="include:getRelativePathFromSystemId()"/> 511 </xsl:otherwise> 512 </xsl:choose> 513 </xsl:variable> 514 <xsl:if test="include:exists($realpath, $part, $__target_gen, $__target_key, $module, $search, $tenant, $lang)"> 515 <xsl:apply-templates/> 516 </xsl:if> 517 </xsl:template> 518 519 <xsl:template match="pfx:checkinclude[@level='runtime']"> 520 <ixsl:if test="true()"> 521 <ixsl:variable name="_href_"> 522 <xsl:choose> 523 <xsl:when test="pfx:href"> 524 <xsl:apply-templates select="pfx:href/node()"/> 525 </xsl:when> 526 <xsl:when test="@href"> 527 <xsl:value-of select="@href"/> 528 </xsl:when> 529 <xsl:otherwise> 530 <xsl:value-of select="include:getRelativePathFromSystemId()"/> 531 </xsl:otherwise> 532 </xsl:choose> 533 </ixsl:variable> 534 <ixsl:variable name="_part_"> 535 <xsl:choose> 536 <xsl:when test="pfx:part"> 537 <xsl:apply-templates select="pfx:part/node()"/> 538 </xsl:when> 539 <xsl:otherwise> 540 <xsl:value-of select="@part"/> 541 </xsl:otherwise> 542 </xsl:choose> 543 </ixsl:variable> 544 <ixsl:variable name="_module_"> 545 <xsl:choose> 546 <xsl:when test="@module"> 547 <xsl:value-of select="module"/> 548 </xsl:when> 549 <xsl:otherwise> 550 <xsl:value-of select="include:getModuleFromSystemId()"/> 551 </xsl:otherwise> 552 </xsl:choose> 553 </ixsl:variable> 554 <ixsl:if test="pfx:checkInclude($_href_, $_part_, $_module_, '{@search}')"> 555 <xsl:apply-templates/> 556 </ixsl:if> 557 </ixsl:if> 558 </xsl:template> 559 560 <xsl:template match="pfx:checknoinclude"> 561 <xsl:param name="part"><xsl:value-of select="@part"/></xsl:param> 562 <xsl:param name="href"><xsl:value-of select="@href"/></xsl:param> 563 <xsl:param name="module"><xsl:value-of select="@module"/></xsl:param> 564 <xsl:param name="search"><xsl:value-of select="@search"/></xsl:param> 565 <xsl:variable name="module_name"> 566 <xsl:choose> 567 <xsl:when test="@module='PAGEDEF' or @module='pagedef'"> 568 <xsl:value-of select="$__defining_module"/> 569 </xsl:when> 570 <xsl:otherwise> 571 <xsl:value-of select="$module"/> 572 </xsl:otherwise> 573 </xsl:choose> 574 </xsl:variable> 575 <xsl:variable name="realpath"> 576 <xsl:choose> 577 <xsl:when test="not($href='')"> 578 <xsl:value-of select="$href"/> 579 </xsl:when> 580 <xsl:otherwise> 581 <xsl:value-of select="include:getRelativePathFromSystemId()"/> 582 </xsl:otherwise> 583 </xsl:choose> 584 </xsl:variable> 585 <xsl:if test="not(include:exists($realpath, $part, $__target_gen, $__target_key, $module, $search, $tenant, $lang))"> 586 <xsl:apply-templates/> 587 </xsl:if> 588 </xsl:template> 589 590 <xsl:template match="pfx:checknoinclude[@level='runtime']"> 591 <ixsl:if test="true()"> 592 <ixsl:variable name="_href_"> 593 <xsl:choose> 594 <xsl:when test="pfx:href"> 595 <xsl:apply-templates select="pfx:href/node()"/> 596 </xsl:when> 597 <xsl:when test="@href"> 598 <xsl:value-of select="@href"/> 599 </xsl:when> 600 <xsl:otherwise> 601 <xsl:value-of select="include:getRelativePathFromSystemId()"/> 602 </xsl:otherwise> 603 </xsl:choose> 604 </ixsl:variable> 605 <ixsl:variable name="_part_"> 606 <xsl:choose> 607 <xsl:when test="pfx:part"> 608 <xsl:apply-templates select="pfx:part/node()"/> 609 </xsl:when> 610 <xsl:otherwise> 611 <xsl:value-of select="@part"/> 612 </xsl:otherwise> 613 </xsl:choose> 614 </ixsl:variable> 615 <ixsl:variable name="_module_"> 616 <xsl:choose> 617 <xsl:when test="@module"> 618 <xsl:value-of select="module"/> 619 </xsl:when> 620 <xsl:otherwise> 621 <xsl:value-of select="include:getModuleFromSystemId()"/> 622 </xsl:otherwise> 623 </xsl:choose> 624 </ixsl:variable> 625 <ixsl:if test="not(pfx:checkInclude($_href_, $_part_, $_module_, '{@search}'))"> 626 <xsl:apply-templates/> 627 </ixsl:if> 628 </ixsl:if> 629 </xsl:template> 630 631 <xsl:template match="pfx:href"/> 632 <xsl:template match="pfx:part"/> 481 633 482 634 <xsl:template name="pfx:image_register_src"> … … 682 834 </func:function> 683 835 836 <func:function name="pfx:checkInclude"> 837 <xsl:param name="href"/> 838 <xsl:param name="part"/> 839 <xsl:param name="module"/> 840 <xsl:param name="search"/> 841 <func:result select="include:exists($href, $part, $__target_gen, $__target_key, $module, $search, $tenant, $lang)"/> 842 </func:function> 843 684 844 </xsl:stylesheet>
