[opencms-dev] Schema Default - advanced logic
Gebert, Anne
a.gebert at comundus.com
Mon Feb 15 09:56:22 CET 2021
Hi Thomas,
perhaps a look at org.opencms.util.CmsMacroResolver.java may help you.
Regards
Anne
-----Ursprüngliche Nachricht-----
Von: opencms-dev <opencms-dev-bounces at opencms.org> Im Auftrag von Thomas Schmidt
Gesendet: Samstag, 13. Februar 2021 01:52
An: The OpenCms mailing list <opencms-dev at opencms.org>
Betreff: [opencms-dev] Schema Default - advanced logic
Hello,
i’m struggling to understand what kind of API is behind the Schema definition and the properties could be used to manipulate e.g. defaults.
E.g. I have a „Author“ field which should make use of the First and Last Name of the OpenCMS user Database:
-.-.-.-.-.-. schnipp -.-.-.-.-.-.
<Setting>
<PropertyName>Author</PropertyName>
<Widget>string</Widget>
<Default><![CDATA[%(currentuser.firstname) %(currentuser.lastname)]]></Default>
</Setting>
-.-.-.-.-.-. schnapp -.-.-.-.-.-.
Now I wonder if there is a possibility instead of using the full first and the full last name to put only initials as default. Is there anything like „substring“ possible ?
When going through all the examples it apears that quiet some (XPath?!) logic might be possible - but it is hard to understand hwo it really works.
Thanks
Kind Regards
ThomasS
_______________________________________________
This mail is sent to you from the opencms-dev mailing list To change your list options, or to unsubscribe from the list, please visit https://lists.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list