8

I am trying to configure cd_storage and getting issue in setting up dynamic component presentation as they get over written by child and published to same folder from every publication.

I know we can define the publication level settings but once we define that then it expect us to define everything inside that publication tag. We do not want to define every thing 50 times in publication tag.

Could any one suggest the best practice for same.

this is for sdl tridion 2011 sp1

Thanks in advance...

Daniel Neagu
  • 1,711
  • 11
  • 13
chiku
  • 383
  • 1
  • 12
  • Thanks for the Tridion question. Have you supported our [Tridion Stackexchange proposal](http://area51.stackexchange.com/proposals/38335/tridion?referrer=LicaWzvmveuNn9xqeeO2NA2) already? – Hendrik Beenker Jan 25 '13 at 11:04
  • chiku, please google for tridion area51 and support the tridion stack exchange. thanks – robrtc Jan 26 '13 at 14:55

1 Answers1

8

Your problem is in how you defined your storage configuration for the storage which you use to store ComponentPresentations. There is a flag in the definition of a storage which sets exactly this type of behavior: defaultFilesystem. You probably have it set to false which causes all ComponentPresentations from all publications to be stored in the same location. By setting this flag to true you will get ComponentPresentations from different publications stored in different locations. I will give an example to show how this works in cd_storage_conf.xml:

<Storage Type="filesystem" Class="com.tridion.storage.filesystem.FSDAOFactory" Id="defaultCPs" defaultFilesystem="true">
        <Root Path="c:\temp\cpRoot" />
</Storage>
....
<ItemTypes defaultStorageId="defaultFile" cached="true">
    <Item typeMapping="ComponentPresentation" itemExtension=".jsp" storageId="defaultCPs"/>
....

This is really easy to maintain and will make the Broker to store ComponentPresentations to locations like: c:\temp\cpRoot\pub109\dcp\jsp\*** (here I have publicationId=109).

Hope this helps.

Daniel Neagu
  • 1,711
  • 11
  • 13
  • thanks that was it... also can i have my publication path defined in publication property instead of pubxx ?.. thanks a lot... – chiku Jan 25 '13 at 11:07
  • Unfortunately this property is not configurable at all. – Daniel Neagu Jan 25 '13 at 12:26
  • 2
    While you could push the dcp's dynamically to a common location through the deployer, you need to be careful on using them in the context of your web site or webapp. For J2EE, if the dcps (jsp) are not part of your webapp docroot then most app servers won't render them. Same for IIS, if .ascx are not part of docroot under app_usercontrols or similar you won't be able to render them as well. So in summary, you are just publishing them to some location but you won't be able to use them really in any web site (you might get errors too). – Kaylan Jan 25 '13 at 18:34