Hi everybody,
I would like to be able to set tags to assets; the list of assets is stored in
a Hippo CMS backend template.
At the moment I managed to pickup a tag from a selection-list with the
following code:
- extensions/types/types.xml
<types>
...
<resource name="asset" label="types:cms.types.label.asset" type="abstract"
i18n:attr="label">
<properties>cocoon://extensions/types/asset-properties</properties>
</resource>
...
</types>
- extensions/types/sitemap.xmap
<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:pipelines>
<map:pipeline type="noncaching" >
<map:match pattern="asset-properties">
<map:generate src="asset/properties.xml"/>
<map:transform type="include"/>
<map:transform src="resources/tags2props.xsl"/>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="getCategories">
<map:generate
src="webdav://{repository:host}:{repository:port}{repository:rootPath}{repository:filesPath}/content/meta/categories.xml"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
- extesions/asset/properties.xml
<?xml version="1.0"?>
<Properties xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
xmlns:ci="http://apache.org/cocoon/include/1.0">
<Property>
<Name>tag</Name>
<DisplayName>Tag</DisplayName>
<Namespace>http://hippo.nl/cms/1.0</Namespace>
<NamespacePrefix>cms</NamespacePrefix>
<Datatype>string</Datatype>
<ci:include src="cocoon:/getCategories"/>
</Property>
</Properties>
What I would like to have is instead a multivalue field; I tried to patch the
cForm /editor/src/site/explorer/transformers/propform cform, but I get a
binding error
An error occured during loading: Cannot set value of field 'cms-tag' with an
object of type java.lang.String
Probably the multivalue field should rely on a Object[] model; however I
couldn't find the way to fix it. Any ideas?
TIA!
Met vriendelijke groet,
--
Maurizio Pillitu - 0031 (0)615655668
Sourcesense - making sense of Open Source: http://www.sourcesense.com
********************************************
Hippocms-dev: Hippo CMS development public mailinglist