AW: [opencms-dev] does in fact nobody knows the answer?

Thomas Gick thomasgick at web.de
Mon Nov 25 18:39:14 CET 2002


Hi Andreas,

thank you very much for your rapid answer.

Thomas


opencms-dev at www.opencms.org schrieb am 25.11.02 18:00:33:
> Hi Thomas,
> 
> first you have to write a class and extend it from the CmsXmlTemplate class.
> In the getContent method you have to place the following code:
> 
> 	  String filename = cms.getRequestContext().getUri();
>         Vector allFiles = cms.readAllFileHeadersForHist(filename);
>         if(allFiles.size()>0){
>             // we only need the last change
>             CmsBackupResource file =
> (CmsBackupResource)allFiles.lastElement();
>             String username = "";
>             try{
>                 username =
> cms.readUser(file.getResourceLastModifiedBy()).getName();
>             }catch(CmsException e){
>                 username = file.getLastModifiedByName();
>             }
>             template.setData("user", username);
>             template.setData("date",
> Utils.getNiceDate(file.getDateLastModified()));
>         } else {
>             template.setData("user", "");
>             template.setData("date", "");
> 
>         }
> 
> Then you have to create an element like this:
> 
> <TEMPLATE>
> <![CDATA[
> Last update: ]]><PROCESS>date</PROCESS><![CDATA[ 
> ]]><PROCESS>user</PROCESS><![CDATA[
> ]]>
> </TEMPLATE>
> 
> and call the element with your new class...
> That should do the work!
> 
> Andreas Zahner
> 
> OpenCms Professional Services
> Framfab Deutschland AG
> http://www.framfab.de
> http://opencms.framfab.de
> 
> -----Ursprüngliche Nachricht-----
> Von: Thomas Gick [mailto:thomasgick at web.de]
> Gesendet: Montag, 25. November 2002 17:31
> An: opencms-dev at opencms.com
> Betreff: [opencms-dev] does in fact nobody knows the answer?
> 
> 
> Hi list,
> 
> i posted the following question some days ago. But nobody seems to know the
> answer.
> The Question: How can i integrate the author and the last modification date
> of a requested page in the used xml contenttemplate.
> Is there generally the possibility to get these information?
> 
> Thomas
> 
> 
> ____________________________________________________________________________
> __
> Sie haben mehr zu sagen als in eine SMS passt? Mit WEB.DE FreeMail ist
> das jetzt kein Problem mehr! http://freemail.web.de/features/?mc=021182

-- 
Hinweis: Diese Mail wurde aufgrund technischer Problem weitergeleitet. Falls Sie auf 
diese Mail direkt antworten, so tun Sie das bitte nur heute am 02. Oktober 2002.
Danach können Sie selbstverständlich wieder die Mailadresse unseres Mitarbeiters nutzen.

Wir bitten um Ihr Verständnis.

Wieland Electric GmbH
______________________________________________________________________________
Sie haben mehr zu sagen als in eine SMS passt? Mit WEB.DE FreeMail ist
das jetzt kein Problem mehr! http://freemail.web.de/features/?mc=021182




More information about the opencms-dev mailing list