[opencms-dev] Accessing content from outside JSP?

Jan.Hegewald at sdm.de Jan.Hegewald at sdm.de
Wed Jul 12 19:10:18 CEST 2006


Dear list,

I've got a rather simple question, but I constantly fail to find the answer.

I want to access the content of a specific document from within a Java
class. 
The idea behind is, that I created a resource type which shall contain some
configuration as the files in /_configuration with templateone. In a Java
class first of all I fetch the file with the following code:

public Configuration(CmsObject cms)
	{
		this.cms = cms;
		try
		{
			configdoc = cms.readResource(CONFIG_FILE);
		} catch (CmsException e)
		{
			logger.error("Unable to read config file '" +
CONFIG_FILE + "' from VFS.", e);
		}
	}

But how can I access the fields of it? I may read properties with
cms.readPropertyObject(configdoc, key, false); but I don't want to read the
properties but the content fields themselves!?

Any help would be greatly appreciated.

Greetings,
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6597 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060712/8aa02a3e/attachment.bin>


More information about the opencms-dev mailing list