Skip to content

Commit

Permalink
add a redirect to the current block
Browse files Browse the repository at this point in the history
  • Loading branch information
reinhard committed Jun 29, 2006
1 parent dae1354 commit e0494d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ protected void blockDeploymentMonolithicCocoon(final String blocksdir, final Dev
} catch (FileNotFoundException e) {
throw new MojoExecutionException("Problems with setting the basedir of this block.", e);
}
// it is important that the current block is put at the end of the array - the
// MonotlithicCocoonDeployer expects this
DevelopmentBlock[] extBlocks = new DevelopmentBlock[blocks.length + 1];
System.arraycopy(blocks, 0, extBlocks, 0, blocks.length);
extBlocks[blocks.length] = curBlock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void deploy(final Map libraries, final File basedir, final String blocksd
if(developmentBlocks != null && developmentBlocks.length > 0) {
Map templateObjects = new HashMap();
templateObjects.put("devblocks", developmentBlocks);
templateObjects.put("curblock", developmentBlocks[developmentBlocks.length - 1]);
writeStringTemplateToFile(basedir, "sitemap.xmap", templateObjects);
writeStringTemplateToFile(basedir, "WEB-INF/cocoon.xconf", templateObjects);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

<map:pipelines>
<map:pipeline>
<map:match pattern="">
<map:redirect-to uri="blocks/$curblock.artifactId$/"/>
</map:match>
$devblocks:{ devblock |
$if(devblock.cobInfPath)$
<map:match pattern="blocks/$devblock.artifactId$/**">
Expand Down

0 comments on commit e0494d6

Please sign in to comment.