KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > cms > cocoon > components > modules > input > PublicationFallbackModule


1 /*
2  * Created on 09.08.2004
3  *
4  * TODO To change the template for this generated file go to
5  * Window - Preferences - Java - Code Style - Code Templates
6  */

7 package org.apache.lenya.cms.cocoon.components.modules.input;
8
9 import java.util.Map JavaDoc;
10
11 import org.apache.avalon.framework.configuration.ConfigurationException;
12 import org.apache.lenya.cms.publication.PageEnvelope;
13 import org.apache.lenya.cms.publication.Publication;
14
15 /**
16  * @author nobby
17  *
18  * TODO To change the template for this generated type comment go to Window - Preferences - Java -
19  * Code Style - Code Templates
20  */

21 public class PublicationFallbackModule extends FallbackModule {
22
23     /**
24      * Ctor.
25      */

26     public PublicationFallbackModule() {
27         super();
28     }
29
30     /**
31      * @throws ConfigurationException
32      * @see org.apache.lenya.cms.cocoon.components.modules.input.FallbackModule#getBaseURIs(java.util.Map)
33      */

34     protected String JavaDoc[] getBaseURIs(Map JavaDoc objectModel) throws ConfigurationException {
35         String JavaDoc[] superUris = super.getBaseURIs(objectModel);
36         String JavaDoc[] uris = new String JavaDoc[superUris.length + 1];
37
38         PageEnvelope envelope = getEnvelope(objectModel);
39         String JavaDoc publicationId = envelope.getPublication().getId();
40
41         String JavaDoc publicationUri = "context://" + Publication.PUBLICATION_PREFIX_URI + "/"
42                 + publicationId + "/lenya";
43         uris[0] = publicationUri;
44
45         for (int i = 0; i < superUris.length; i++) {
46             uris[i + 1] = superUris[i];
47         }
48
49         return uris;
50     }
51 }
Popular Tags