Re: metadata

"Khue Nguyen" <[email protected]>
Newsgroups gmane.comp.cms.jahia.template
Message-ID <001f01c5ea01$0d834220$7c02a8c0@SINGASONG>
this feature is only available in last cvs.
It's possible now to create container sorter with custom data provider ( like FileNameProvider or FileSizeProvider ) for a given field of each container to sort.

   ContainerSorterBean sorter = new ContainerSorterBean("directoryPeopleContainer",jParams,"directoryPeoplePicture",
    false, jParams.getEntryLoadRequest());
   
    sorter.setFieldValueProvider(new org.jahia.data.containers.containersorterfieldvalueproviderimpl.FileNameProvider());    


The template peoples.jsp of the corporate_portal_templates provide an example of sorting people by picture's file name or size.




  ----- Original Message ----- 
  From: BARREAU Amandine 
  To: [email protected] 
  Sent: Tuesday, November 15, 2005 11:30 AM
  Subject: RE: metadata


  Thaks you.
  and do you know if I can sort on File name?



----------------------------------------------------------------------------
    From: Khue Nguyen [mailto:[email protected]] 
    Sent: 14 November 2005 15:45
    To: [email protected]
    Subject: Re: metadata


    is it about sorting containers to be displayed within a container list ?
    If true, the org.jahia.data.containers.ContainerMetadataSorterBean class that extends ContainerSorterBean allows you  to sort containers on a specific metadata.


    It works the same way ContainerSorterBean are used to sort containers on a specific container data field.





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


      and can I sort on this fields?



------------------------------------------------------------------------
        From: Khue Nguyen [mailto:[email protected]] 
        Sent: 14 November 2005 13:38
        To: [email protected]
        Subject: Re: metadata


        sorry, it's the Jahia 5.0 beta 2 API ( the one in cvs ).
        If not, use "creator", "creationDate" or maybe you can update from last cvs.




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


          But the class CoreMetadataConstant doesn't exists in my jahia



--------------------------------------------------------------------
            From: Khue Nguyen [mailto:[email protected]] 
            Sent: 14 November 2005 13:26
            To: [email protected]
            Subject: Re: metadata


            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.