[opencms-dev] Export Rules of nested Sites

Rainer Reichel rainer.reichel at rus.uni-stuttgart.de
Thu Jan 22 17:16:45 CET 2009


Hi Christian,

pretty well!
With the this RE we can exclude a list of folders which belongs to the
nested sites. So, any nested site is exported separatly!

<export-rule>
   <name>site1</name>
   <description>Site 1</description>
   <modified-resources>
   <regex>/sites/default/site1/(?!(site2/|
subfolder1/subfolder2/site3/)).*</regex>
   </modified-resources>
   <export-resources>
   <uri>/sites/default/site1/</uri>
</export-resources>

<export-rule>
   <name>site2</name>
   <description>Site 2</description>
   <modified-resources>
   <regex>/sites/default/site1/site2/.*</regex>
   </modified-resources>
   <export-resources>
   <uri>/sites/default/site1/site2/</uri>
</export-resources>
...

Now only site1 takes all resources for export. 
Consequently it would good if the <uri> tag was a RE too!

Regards

Rainer

> 
> I don't know whether opencms supports negative regexps in this context but the expression that you mention can't work.
> [^xyz] means one character that is neither "x" nor "y" nor "z".
> 
> 
> You may want to try whether negative expressions are supported. For your example, a negative version should be:
> <regex>/system/modules/com.example.site1/(?!resources/).*</regex>
> 
> see for example http://www.xellsoft.com/regular_expression.html
> 
> 
> I don't know if this will work - that would depend on the regex library that opencms uses. I think the regexp library that is bundled with Java does support some such. 
> Here, a look into the javadocs of package java.util.regex is recommended
> 
> Maybe you can comment again, after you have found a solution or found that this is a dead-end so that others benefit too.
> 
> Regards
> Christian
> 
> > ???Hi,
> > 
> > is it possible to configure export rules 
> > (CmsAfterPublishStaticExportHandler) that
> > two nested sites are exported separatly?
> > 
> > This means, if I have a structure like
> > site1/subfolder1
> >      /subfolder2
> >      /site2
> >      /subfolder3
> > that for site1 everything is exported except site2 folder.
> > 
> > There is a tutorial, see
> > http://www.opencms-forum.de/opencms-forum/viewthread?thread=1279#3399
> > which seems to use negated regular expressions like
> > <regex>/system/modules/com.example.site1/[^resources/].*</regex>
> > but a) this expression seems strange and does not exclude the
> > string "resource" and b) even variations never worked.
> > 
> > Regards,
> > 
> > Rainer
> > 

-- 
**********************************************************************
OpenCms, das Enterprise Content Management System an der Universität
Stuttgart.
Mehr Infos unter http://opencms.uni-stuttgart.de/opencms/opencms/info/
**********************************************************************

Dipl.-Inf. Rainer Reichel
Rechenzentrum Universität Stuttgart
Neue Medien in Forschung und Lehre

E-Mail: rainer.reichel at rus.uni-stuttgart.de
Tel:    +49-711-685-65579
Fax:    +49-711-685-55579

Zimmer 0.74
Allmandring 3a
D-70550 Stuttgart

www.rus.uni-stuttgart.de




More information about the opencms-dev mailing list