[Hippo-cms7-user] How to add a metadata column to a content type

Jeroen Reijn j.reijn at onehippo.com
Tue Aug 4 17:03:12 CEST 2009


Hi,

I only have few minutes to write this post, but it should get you 
started. The trick here is the root plugin of the template for the 
article document type:

Search for the following code snippit in the url down below.

         <sv:node sv:name="root">
           <sv:property sv:name="jcr:primaryType" sv:type="Name">
             <sv:value>frontend:plugin</sv:value>
           </sv:property>
           <sv:property sv:name="plugin.class" sv:type="String">
             <sv:value>org.hippoecm.defaultcontent.Annotated</sv:value>
           </sv:property>
           <sv:property sv:name="wicket.id" sv:type="String">
             <sv:value>${wicket.id}</sv:value>
           </sv:property>
           <sv:property sv:name="wicket.extensions" sv:type="String">
             <sv:value>extension.main</sv:value>
             <sv:value>extension.select</sv:value>
             <sv:value>extension.mixins</sv:value>
           </sv:property>
           <sv:property sv:name="extension.main" sv:type="String">
             <sv:value>${cluster.id}.main</sv:value>
           </sv:property>
           <sv:property sv:name="extension.select" sv:type="String">
             <sv:value>${cluster.id}.select</sv:value>
           </sv:property>
           <sv:property sv:name="extension.mixins" sv:type="String">
             <sv:value>${cluster.id}.mixins</sv:value>
           </sv:property>
         </sv:node>

http://svn.hippocms.org/repos/hippo/hippo-ecm/tags/Tag-HREPTWO-v2_06_07/addon/defaultcontent/repository/src/main/resources/defaultcontent-namespace.xml

If you take a look at the following line:

<sv:property sv:name="plugin.class" sv:type="String">
   <sv:value>org.hippoecm.defaultcontent.Annotated</sv:value>
</sv:property>

You will notice that the plugin.class is different from all the other 
templates. Looking up the file on the class path, you might find out 
that it references to a wicket html fragment located at [2].

http://svn.hippocms.org/repos/hippo/hippo-ecm/tags/Tag-HREPTWO-v2_06_07/addon/defaultcontent/frontend/src/main/java/org/hippoecm/defaultcontent/Annotated.html

As you will see, the html file contains wicket id's like:

wicket:id="extension.main"

which resemble the CMS template configuration

<sv:property sv:name="wicket.extensions" sv:type="String">
    <sv:value>extension.main</sv:value>
    <sv:value>extension.select</sv:value>
    <sv:value>extension.mixins</sv:value>
</sv:property>

I think you should be able to handle it from here on. If you need more 
help please let me know.

This might change in the next release, since in the 2.07.00 you should 
be able to do this from the template editor as well (choosing a layout), 
but i'm not sure if the actual configuration is different, since I have 
been away for about a month.

Regards,

Jeroen

Aharpour wrote:
> 
> 
> Rita Bylsma wrote:
>> On Tue, Aug 4, 2009 at 2:12 PM, Aharpour
>> <aharpour.ebrahim at kpmg-ct.com>wrote:
>>
>>>
>>>
>>> Rita Bylsma wrote:
>>>> On Tue, Aug 4, 2009 at 11:02 AM, Aharpour
>>>> <aharpour.ebrahim at kpmg-ct.com>wrote:
>>>>
>>>>> Hi
>>>>> I am trying to make a metadata column for one of my content types,
>>>>> something
>>>>> like what the article content type has for tags, but with more fields.
>>> I
>>>>> couldn't find any thing about that on the wiki.
>>>>>
>>>> Try the user guide on the documentation site:
>>>>
>>>>
>>> http://www.onehippo.org/cms7/delve_into/user/information_architects/index.html
>>>> What article content type do you mean? From some quickstart war? Which
>>>> version are you using?
>>>> Before 2.07.00 there are no columns in the quickstart war.
>>>> The user guide pointed to above is not about making columns, but it is
>>>> about
>>>> adding meta data.
>>>>
>>>> The CMS 2.07.00 tag has as a new feature that you can define the layout
>>> of
>>>> documents as they appear in the document editor. So you can make
>>> columns.
>>>> This is explained in the newer version of the same user guide, but that
>>> is
>>>> not live yet, because the 2.07.00 is a tag, not a release. If you can
>>> not
>>>> wait you can check out the tag:
>>>>   svn checkout
>>>> http://svn.hippocms.org/repos/hippo/hippo-ecm/Tag-HREPTWO-v2_07_00/
>>>> You can build the documentation locally with mvn -N site.
>>>>
>>>> Best regards,
>>>>                          Rita Bylsma
>>>>
>>>>> --
>>>>> View this message in context:
>>>>>
>>> http://n2.nabble.com/How-to-add-a-metadata-column-to-a-content-type-tp3383347p3383347.html
>>>>> Sent from the Document Types mailing list archive at Nabble.com.
>>>>> _______________________________________________
>>>>> Hippo-cms7-user mailing list and forums
>>>>> http://www.onehippo.org/cms7/support/community.html
>>>>>
>>>> _______________________________________________
>>>> Hippo-cms7-user mailing list and forums
>>>> http://www.onehippo.org/cms7/support/community.html
>>>>
>>>
>>>
>>> Yes, the article content type I am talking about is from a quickstart
>>> war,
>>> I checked out Hippo 7 sources form the following address
>>> "
>>> http://svn.onehippo.org/repos/hippo/hippo-ecm//releases/Release-HREPTWO-v2_06_06
>>> "
>>> ~/cms”
>>> And used the following line to build a quick start war
>>> cms/quickstart/war> mvn jetty:run-war
>>> There is a sample content type there called article, this content type
>>> has
>>> a
>>> metadata column on its right-hand side.
>>> I search though the wiki, but I couldn’t find any thing there about how
>>> to
>>> add metadata to a content type
>>
>> Lets make sure we are talking about the same things:
>>  - There is a document type editor in which you define document types.
>>  - In the document type editor there is a column of field types at the
>> right-hand side from which you can select
>>    a field type to add a field of that type in a document type.
>>  - You can also configure such a field and how to do that you can read in
>> the user guide I mentioned before.
>>  - There is a document editor in which authors write documents. The
>> documents will contain the fields defined in the document type of the
>> document.
>>  - If you want to add meta data to documents, like for wat audience it is
>> or
>> what the subject is, then you add the appropiate fields to a document type
>> and create documents of that type.
>>  - Standard there are no columns visible in the document editor upto
>> version
>> 2.07.00. But sinds 2.07.00 there are.
>>  - If you want to add more field types in the document type editor, you
>> also
>> need version 2.07.00. It allows you to define complex field types
>> (compound
>> types) just like you define a document type, but a compound type gets into
>> the list at the right and can be reused in document types and other
>> compound
>> types. Do no forget to 'update all content' to see the new compound type
>> in
>> the list.
>>
>>
>>> or How to making a column.
>>> Also I tried to check out the documentations form
>>> http://svn.hippocms.org/repos/hippo/hippo-ecm/Tag-HREPTWO-v2_07_00/
>>> but unfortunately this URL is not available.
>>
>> O, sorry, I made a typo, left /tags/ out. It should be:
>>
>> http://svn.hippocms.org/repos/hippo/hippo-ecm/tags/Tag-HREPTWO-v2_07_00/<http://svn.hippocms.org/repos/hippo/hippo-ecm/Tag-HREPTWO-v2_07_00/>
>>
>> Best regards,
>>                           Rita
>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://n2.nabble.com/How-to-add-a-metadata-column-to-a-content-type-tp3383347p3384128.html
>>> Sent from the Document Types mailing list archive at Nabble.com.
>>> _______________________________________________
>>> Hippo-cms7-user mailing list and forums
>>> http://www.onehippo.org/cms7/support/community.html
>>>
>> _______________________________________________
>> Hippo-cms7-user mailing list and forums
>> http://www.onehippo.org/cms7/support/community.html
>>
> 
> I know all that, I know how to use document type editor, even I have made my
> own custom made add-on plug-in and added a new field type there. No problem
> there. But the problem is when I add a new filed to a content type it
> appears in a horizontal box, namely in a row. But if you look up the example
> which I mentioned, there is vertical box at the right side of page right
> next to the field type’s column. For sake of clarity I have attached a
> screenshot of the page and highlighted the column with red ink. 
> http://n2.nabble.com/file/n3384984/2009-08-04.jpg 
> As you can see in the image, there is a check box in the column, called
> taggable. When I create an instance of this content type I can click on this
> check box and a text box appears on beneath of it, and I can add multiple
> tags there. These tags get stored as a property called “hippostd:tags” in
> the node of the page. But the question is how can I make such a column? 
> Initially I try to dissect this example and figure out how it was made. I
> looked up definition of the content type in the console, CND file and I
> exported the xml file of the name space. Interestingly it does not appear in
> any off them.
> Of course as you said, I can add some fields for the metadata like any other
> filed, but I would rather to make a metadata column as it is in the example.
> Because I am trying to migrating an already existing application from hippo
> 6 to hippo 7, in the old application the metadata are filled in, inside such
> a metadata column. So for sake of consistency I would like to keep the
> appearance of the content types as they are in the old application. Thanks a
> lot for helping me out
> 



More information about the Hippo-cms7-user mailing list