KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xdoclet > modules > portlet > PortletXmlSubTask


1 /*
2  * Copyright (c) 2001, 2002 The XDoclet team
3  * All rights reserved.
4  */

5 package xdoclet.modules.portlet;
6
7 import xdoclet.XDocletException;
8 import xdoclet.XDocletMessages;
9 import xdoclet.XmlSubTask;
10 import xdoclet.util.Translator;
11
12 /**
13  * Generates portlet.xml deployment descriptor, per JSR-168.
14  *
15  * @author Craig Walls (xdoclet@habuma.com)
16  * @created August 18, 2003
17  * @ant.element display-name="portlet.xml" name="portletxml" parent="xdoclet.modules.portlet.PortletDocletTask"
18  * @xdoclet.merge-file file="custom-portlet-modes.xml" relates-to="portlet.xml" description="An XML unparsed entity
19  * containing custom-portlet-mode entities for a portlet application deployed to a JSR-168 compliant portlet
20  * container.
21  * @xdoclet.merge-file file="portlet-custom-window-states.xml" relates-to="portlet.xml" description="An XML unparsed
22  * entity containing custom-window-state entities for portlet application deployed to a JSR-168 compliant portlet
23  * container.
24  * @xdoclet.merge-file file="portlet-user-attributes.xml" relates-to="portlet.xml" description="An XML unparsed entity
25  * containing user-attribute entities for portlet application deployed to a JSR-168 compliant portlet container.
26  * @xdoclet.merge-file file="portlet-security.xml" relates-to="portlet.xml" description="An XML unparsed entity
27  * containing security-constraint entities for portlet application deployed to a JSR-168 compliant portlet
28  * container.
29  */

30 public class PortletXmlSubTask extends XmlSubTask
31 {
32     private static String JavaDoc DEFAULT_PORTLET_XML_SCHEMA = "http://java.sun.com/xml/portlet.xsd";
33
34     private static String JavaDoc DEFAULT_TEMPLATE_FILE = "resources/portlet_xml.xdt";
35
36     private static String JavaDoc GENERATED_FILE_NAME = "portlet.xml";
37
38     public PortletXmlSubTask()
39     {
40         setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE));
41         setDestinationFile(GENERATED_FILE_NAME);
42         setSchema(DEFAULT_PORTLET_XML_SCHEMA);
43     }
44
45     /**
46      * Describe what the method does
47      *
48      * @exception XDocletException
49      */

50     public void execute() throws XDocletException
51     {
52         startProcess();
53     }
54
55     protected void engineStarted() throws XDocletException
56     {
57         System.out.println(Translator.getString(XDocletMessages.class, XDocletMessages.GENERATING_SOMETHING, new String JavaDoc[]{getDestinationFile()}));
58     }
59 }
60
Popular Tags