cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture Web content meta data?

hansraj
Champ in-the-making
Champ in-the-making
Hi,

I'm using Alfresco Labs3b.
Is it possible to capture web content meta data?
If so, pls explain the procedure or direct me to related wiki page.
Thank you.

Regards,
Hans
6 REPLIES 6

samuel_penn
Champ in-the-making
Champ in-the-making
Do you mean getting data out of a web form onto an object? If so, see:

http://wiki.alfresco.com/wiki/Metadata_Extraction#XML_Meta-data_Extractor_Configuration_for_WCM

hansraj
Champ in-the-making
Champ in-the-making
Hi,

Thank you for reply.
i could enable meta data extractor for wcm by following the doc, but i don't know how to test that.
could you please explain me the steps to be followed to test the meta data?
Thank you.

Regards,
Hans

samuel_penn
Champ in-the-making
Champ in-the-making
Once the data has been extracted, it should just appear as properties on the object in the AVM. View the object properties like you would any other. If the metadata is being written to something like cm:title or cm:description then these should be visible automatically (they're good properties to try it out on first, since it's obvious then if it's worked, and if it doesn't work, then the problem is in the meta-data extraction, not anywhere else).

If you have your own custom properties (defined in an aspect), then you will need to edit web-client-config-custom.xml so that those properties show up in the UI. If you've created an Aspect to hold the properties, then I assume you've also seen the documentation on making these visible to users, if not, have a look at: http://wiki.alfresco.com/wiki/Displaying_Custom_Metadata.

Alternatively, you could use the node browser to find the object and look at the properties on it. This doesn't require any configuration, but the UI sort of sucks so making the properties visible is best longer term.

The properties should be written when the form data file is edited or created. There's a lot more discussion of this from when I was asking questions about the subject recently here: http://forums.alfresco.com/en/viewtopic.php?f=30&t=14554

Sam.

hansraj
Champ in-the-making
Champ in-the-making
Hi Sam,

Thank you for ur detailed answer.
My situation is very simple. 
I created a web content item (say testArticle ) of article web form in a web project. i want to verify meta data of testArticle.
I did the following:

1). removed .sample extension and saved the wcm-xml-metadata-extracter-context.xml file.

2a).  i added the following (for article).
<property name="xpathMappingProperties">
         <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
            <property name="properties">
               <props>
                  <prop key="namespace.prefix.fm">http://www.alfresco.org/model/forum/1.0</prop>
                  <prop key="author">/article_article/author/text()</prop>
                  <prop key="title">/article_article/@name</prop>
                  <prop key="description">/model/article_article/text()</prop>
                  <prop key="version">/article_article/version/text()</prop>
               </props>
            </property>
         </bean>
</property>

2b). <bean  id="extracter.xml.sample.selector.XPathSelector"
         class="org.alfresco.repo.content.selector.XPathContentWorkerSelector"
         init-method="init">
      <property name="workers">
         <map>
            …….
           <entry key="/article_article">
               <ref bean="extracter.xml.sample.AlfrescoModelMetadataExtracter" />
            </entry>
         </map>
      </property>
   </bean>

3). i created a web content item based on article web form in a web project.
4). restarted the server

my questions are:

If you have your own custom properties (defined in an aspect), then you will need to edit web-client-config-custom.xml so that those properties show up in the UI.

1).As u said we should modify this xml only if there is any custom aspect. I don't have any such things, is it not required to add even that article section as what i did in step 2? please tell me what to do next to verify meta data?  
If it is already answered,please direct me that page.
Thank you.

Regards,
Hans

samuel_penn
Champ in-the-making
Champ in-the-making
What do you have set in mappingProperties? The xpathMappingProperties define what values are being read out of the form, but mappingProperties (the section prior to it) defines what properties on the object these values are written into to. I assume they are still set to the default of:


         <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
            <property name="properties">
               <props>
                  <prop key="namespace.prefix.cm">http://www.alfresco.org/model/content/1.0</prop>
                  <prop key="author">cm:author</prop>
                  <prop key="title">cm:title</prop>
                  <prop key="description">cm:description</prop>
               </props>
            </property>
         </bean>

After the server has been restarted, go and edit your file in the WCM, and save it. At this point the meta data should be copied into the above property fields. If you view the properties of the object (by clicking on the View Details icon for your .xml file), then you should see that the Author, Title and Description have been set to the values in the form.

Since the above properties are all standard Alfresco properties, you don't need to configure any aspects.

Sam.

hansraj
Champ in-the-making
Champ in-the-making
Hi Sam,

Thank you very much.
I could now see meta data fields in View details page.

Regards,
Hans