Re: Custom I_CmsFileNameGenerator or CmsDefaultFileNameGenerator

Daniel Seidel via opencms-dev <[email protected]>
Newsgroups gmane.comp.cms.opencms.devel
Message-ID <[email protected]>
Hi Sandrine,

in the opencms-vfs.xml, right above the <mimetypes> element you have to 
add an element <namegenerator class="my.custom.FileNameGenerator" />

Best, Daniel.

Am 21.03.23 um 10:16 schrieb Sandrine Prousteau via opencms-dev:
> Hi
>
> On OpenCms 13 or higher, how to use a custom implementation of 
> I_CmsFileNameGenerator, in order to take into account a custom macro 
> (%(date), replaced by "yyyy-MM-dd-" formatted current date on resource 
> creation)?
>
> I've tried to set if in my module handler, but it doesn't work :
>
> OpenCms./getResourceManager/().setNameGenerator(*new* 
> CmsCustomFileNameGenerator());
>
> generate this error :
> /org.opencms.configuration.CmsConfigurationException: The resource 
> manager configuration is possible only during system startup. {}/
>
> PS : I still need the %(number) macro.
>
>
> Thanks.
>
> Sandrine P.
>
> _______________________________________________
> 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
>
>
>
-- 
Kind Regards

Daniel.

-------------------

Daniel Seidel
Alkacon Software GmbH & Co. KG - The OpenCms Experts
https://www.alkacon.com  -http://www.opencms.org

_______________________________________________
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
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.