Re: metadata

"Khue Nguyen" <[email protected]>
Newsgroups gmane.comp.cms.jahia.template
Message-ID <001701c5e916$8cc8f660$7c02a8c0@SINGASONG>
Hi,

You can retrieve the list of metadatas as ContentFields for a given container list this way:

List metadatas = jahiaContainer.getContentContainer().getMetadatas(); // list of ContentField metadata
then for each ContentField :

JahiaField jahiaField = contentField.getJahiaField(jParams.getEntryLoadRequest());
jahiaField.load(LoadFlags.ALL,jParams); // fully load the field


or given the name of a specific metadata , i.e the creator :

JahiaField jahiaField =  jahiaContainer.getContentContainer().getMetadataAsJahiaField(CoreMetadataConstant.CREATOR,jParams);

or a simplified way

String creator = jahiaContainer.getContentContainer().getMetadataValue(CoreMetadataConstant.CREATOR,jParams,"unknown");


Regards,

Khue Nguyen


  ----- Original Message ----- 
  From: BARREAU Amandine 
  To: [email protected] 
  Sent: Monday, November 14, 2005 12:07 PM
  Subject: metadata


  Hello

  How can I retrieve metada from a container?

  Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.