KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > setup > impl > dl > cmsloader > ContentMetaData


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.setup.impl.dl.cmsloader;
10
11 import org.w3c.dom.Element JavaDoc;
12 import org.jboss.portal.setup.CmsSetupException;
13 import org.jboss.portal.common.util.XML;
14
15 import java.util.List JavaDoc;
16
17 /**
18  * @author <a HREF="mailto:palber@novell.com">Polina Alber</a>
19  * Date: Apr 30, 2005; Time: 4:58:28 PM
20  * @since JBoss portal 2.0
21  * Class org.jboss.portal.setup.impl.dl.cmsloader.ContentMetaData
22  */

23 public class ContentMetaData
24 {
25    private static final String JavaDoc DEFAULT_CONTENT_LOCATION = "content/files";
26    private String JavaDoc m_contentLoaction = DEFAULT_CONTENT_LOCATION;
27    private String JavaDoc m_contentEncoding = "UTF-8";
28    private String JavaDoc m_parentNodeUri = "/files";
29
30    ContentMetaData(Element JavaDoc content)
31    {
32       parseContentConfig(content);
33    }
34
35    private void parseContentConfig(Element JavaDoc content)
36    {
37       Element JavaDoc location = XML.getUniqueChild(content, "content-location", false);
38       if (location != null)
39       {
40          m_contentLoaction = XML.asString(location);
41       }
42       Element JavaDoc parentNodeURI = XML.getUniqueChild(content, "parent-uri", false);
43       if (parentNodeURI != null)
44       {
45          m_parentNodeUri = XML.asString(parentNodeURI);
46       }
47       Element JavaDoc contentEncoding = XML.getUniqueChild(content, "content-encoding", false);
48       if (contentEncoding != null)
49       {
50          m_contentEncoding = XML.asString(contentEncoding);
51       }
52    }
53
54    public String JavaDoc getContentLoaction()
55    {
56       return m_contentLoaction;
57    }
58
59    public String JavaDoc getContentEncoding()
60    {
61       return m_contentEncoding;
62    }
63
64    public String JavaDoc getParentNodeUri()
65    {
66       return m_parentNodeUri;
67    }
68 }
69
Popular Tags