[opencms-dev] Avoiding /export/sites/default/ during static export

rama harini hariniaddanki at gmail.com
Wed Feb 16 12:44:24 CET 2011


Hi Michael,

How to set the property exportname in opencms-importexport.xml? Here is my
current opencms-importexport.xml.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE opencms SYSTEM "
http://www.opencms.org/dtd/6.0/opencms-importexport.dtd">
<opencms>
 <importexport>
  <importexporthandlers>
   <importexporthandler
class="org.opencms.importexport.CmsVfsImportExportHandler"/>
   <importexporthandler
class="org.opencms.module.CmsModuleImportExportHandler"/>
  </importexporthandlers>
  <import>
   <overwrite>true</overwrite>
   <convert>true</convert>
   <importversions>
    <importversion class="org.opencms.importexport.CmsImportVersion2"/>
    <importversion class="org.opencms.importexport.CmsImportVersion3"/>
    <importversion class="org.opencms.importexport.CmsImportVersion4"/>
    <importversion class="org.opencms.importexport.CmsImportVersion5"/>
    <importversion class="org.opencms.importexport.CmsImportVersion6"/>
    <importversion class="org.opencms.importexport.CmsImportVersion7"/>
   </importversions>
   <immutables>
    <resource uri="/system/"/>
    <resource uri="/system/categories/"/>
    <resource uri="/system/galleries/"/>
    <resource uri="/system/galleries/download/"/>
    <resource uri="/system/galleries/externallinks/"/>
    <resource uri="/system/galleries/htmlgalleries/"/>
    <resource uri="/system/galleries/pics/"/>
    <resource uri="/system/login/"/>
    <resource uri="/system/modules/"/>
    <resource uri="/system/shared/"/>
    <resource uri="/system/workplace/"/>
    <resource uri="/system/workplace/admin/"/>
    <resource uri="/system/workplace/help/"/>
    <resource uri="/system/workplace/locales/"/>
    <resource uri="/system/workplace/resources/"/>
    <resource uri="/system/workplace/restypes/"/>
    <resource uri="/system/workplace/scripts/"/>
    <resource uri="/system/workplace/templates/"/>
    <resource uri="/system/workplace/views/"/>
    <resource uri="/sites/"/>
   </immutables>
   <principaltranslations/>
   <ignoredproperties/>
  </import>
 </importexport>
 <staticexport enabled="true">
  <staticexporthandler>org.opencms.staticexport.CmsOnDemandStaticExportHandler</staticexporthandler>
  <linksubstitutionhandler>org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler</linksubstitutionhandler>
  <exportpath>D:\dump</exportpath>
  <exportworkpath>temp</exportworkpath>
  <exportbackups>2</exportbackups>
  <defaultpropertyvalue>false</defaultpropertyvalue>
  <defaultsuffixes>
   <suffix key=".jpg"/>
   <suffix key=".gif"/>
   <suffix key=".png"/>
   <suffix key=".doc"/>
   <suffix key=".xls"/>
   <suffix key=".ppt"/>
   <suffix key=".pdf"/>
   <suffix key=".txt"/>
   <suffix key=".css"/>
   <suffix key=".zip"/>
   <suffix key=".swf"/>
   <suffix key=".html"/>
   <suffix key=".js"/>
   <suffix key=".flv"/>
  </defaultsuffixes>
  <rendersettings>
   <rfs-prefix>${CONTEXT_NAME}/export</rfs-prefix>
   <vfs-prefix>${CONTEXT_NAME}${SERVLET_NAME}</vfs-prefix>
   <userelativelinks>false</userelativelinks>
   <exporturl>http://127.0.0.1:8080${CONTEXT_NAME}/handle404</exporturl>
   <plainoptimization>true</plainoptimization>
   <testresource uri="/system/shared/page.dtd"/>
   <resourcestorender>
    <regex>/sites/.*</regex>
    <regex>/system/workplace/commons/style/.*</regex>
    <regex>/system/galleries/.*</regex>
    <regex>/system/modules/.*/resources/.*</regex>
   </resourcestorender>
  </rendersettings>
 </staticexport>
 <usercsvexport>
        <separator>;</separator>
        <columns>
         <column>description</column>
            <column>lastname</column>
            <column>firstname</column>
            <column>email</column>
            <column>address</column>
            <column>zipcode</column>
            <column>city</column>
            <column>country</column>
            <column>USERPREFERENCES_workplace-startupsettingssite</column>
            <column>USERPREFERENCES_workplace-startupsettingslocale</column>
            <column>password</column>
        </columns>
 </usercsvexport>
 <repositories>
  <repository name="standard" class="org.opencms.repository.CmsRepository">
   <params>
      <param
name="wrapper">org.opencms.file.wrapper.CmsResourceExtensionWrapperJsp</param>
      <param
name="wrapper">org.opencms.file.wrapper.CmsResourceExtensionWrapperXmlContent</param>
      <param
name="wrapper">org.opencms.file.wrapper.CmsResourceExtensionWrapperXmlPage</param>
      <param
name="wrapper">org.opencms.file.wrapper.CmsResourceWrapperSystemFolder</param>
      <param
name="wrapper">org.opencms.file.wrapper.CmsResourceWrapperPropertyFile</param>
   </params>
   <filter type="include">
    <regex>/</regex>
    <regex>/__properties/.*</regex>
    <regex>/sites/.*</regex>
    <regex>/system/</regex>
    <regex>/system/__properties/.*</regex>
    <regex>/system/galleries/.*</regex>
    <regex>/system/modules/.*</regex>
    <regex>/system/workplace/.*</regex>
   </filter>
  </repository>
  <repository name="extended" class="org.opencms.repository.CmsRepository">
   <params>
    <param
name="wrapper">org.opencms.file.wrapper.CmsResourceExtensionWrapperJsp</param>
    <param
name="wrapper">org.opencms.file.wrapper.CmsResourceExtensionWrapperXmlContent</param>
    <param
name="wrapper">org.opencms.file.wrapper.CmsResourceWrapperXmlPage</param>
    <param
name="wrapper">org.opencms.file.wrapper.CmsResourceWrapperSystemFolder</param>
    <param
name="wrapper">org.opencms.file.wrapper.CmsResourceWrapperPropertyFile</param>
   </params>
   <filter type="include">
    <regex>/</regex>
    <regex>/__properties/.*</regex>
    <regex>/sites/.*</regex>
    <regex>/system/</regex>
    <regex>/system/__properties/.*</regex>
    <regex>/system/galleries/.*</regex>
    <regex>/system/modules/</regex>
    <regex>/system/modules/[^/]*/</regex>
    <regex>/system/modules/[^/]*/__properties/.*</regex>
    <regex>/system/modules/[^/]*/resources/.*</regex>
   </filter>
  </repository>
 </repositories>
</opencms>

Regards,
Harini



On Wed, Feb 16, 2011 at 5:00 PM, Michael Emmerich <m.emmerich at alkacon.com>wrote:

> Harini,
>
> OpenCms always needs a prefix for exported files - like the "export",
> but you could reconfigure the opencms-importexport.xml to choose another
> name for it.
>
>
> To get rid of the "/sites/default/" in the export path, you can use the
> "exportname" property.
>
> Lets me explain it with an example:
>
> You have a file in "/sites/default/mypage.html". So the default path
> when you export this file would be
>
> "/export/sites/default/mypage.html"
>
> If you now set the "exportname" property on the folder "/sites/default/"
> to lets say "sunhine", the exported path would be
>
> "/export/sunshine/mypage.html"
>
> If you now set the "exportname" property on the folder "/sites/default/"
> to lets say "/", the exported path would be
>
> "/export/mypage.html"
>
> Important: The value for the "exportname" must be unique in you OpenCms,
> if you use the same exportname twice, it won#t work.
>
> Very important: It is mandatory that you use the <cms:link> tag in all
> your links you use in your JSPs, otherweise your export will never work
> as expected.
>
> Kind Regards,
> Michael
>
>
>
> Am 16.02.2011 12:13, schrieb rama harini:
>  > Hi,
> > I have developed one site using opencms. When I try to do static export,
> > the html files are stored with the prefix /export/sites/default/. Is
> > there any way to avoid this?
> > Regards,
> > Harini
> >
> >
> >
> >
> > _______________________________________________
> > 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
> > http://lists.opencms.org/mailman/listinfo/opencms-dev
>
> --
> Kind Regards,
> Michael.
>
> -------------------
> Michael Emmerich
>
> Visit OpenCms Days 2011 Conference and Expo
> May 9 to May 10 2011 in Cologne, Germany
> http://www.opencms-days.org
>
> Alkacon Software GmbH  - The OpenCms Experts
> http://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
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20110216/1e281a25/attachment.htm>


More information about the opencms-dev mailing list