8

I have installed Experience Manager for Tridion 2011 SP1 HR1. When installing I had to configure a 'Content Delivery session preview Web service'.

I got the service to work by removing type mappings that refer to published files. See https://stackoverflow.com/questions/10656909/content-delivery-service-reports-unable-to-retrieve-desired-results

  <!--
<Storage Type="filesystem" Class="com.tridion.storage.filesystem.FSDAOFactory" Id="defaultFile" defaultStorage="true" defaultFilesystem="false">
    <Root Path="D:\Inetpub\staging" />
</Storage>
  -->
...

<Item typeMapping="ComponentPresentation" cached="true" itemExtension=".Asp" storageId="defaultdb" />
<Item typeMapping="Schema" storageId="defaultdb" />
<Item typeMapping="XSLT" cached="true" storageId="defaultdb" />
<!--
<Item typeMapping="Page" storageId="defaultFile" />
<Item typeMapping="Binary" storageId="defaultFile" />
-->
...

Now when I have a page I want to edit in Experience Manager with an image, I get the following error

Access to the path '898011338_article_tcm9-78615.png' is denied.

I am guessing this has something to do with Binary files not being available in the database. Is this correct? and how should I fix this?

7

The session preview webservice needs indeed everything to be configured to be in the database, but this has nothing to do with how your site stores your files.

I'd recommend looking through my sample configurations for the webservice here and the website here.

Basically - in your website leave the storage as is, but ADD the "SessionPreviewDatabase" info:

<StorageBindings>
  <Bundle src="preview_dao_bundle.xml"/>
</StorageBindings>
<Wrappers>
  <Wrapper Name="SessionWrapper">
    <Storage Type="persistence" Id="sessionDb" dialect="MSSQL" ass="com.tridion.storage.persistence.JPADAOFactory">
      <Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
      <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
        <Property Name="serverName" Value="localhost" />
        <Property Name="portNumber" Value="1433" />
        <Property Name="databaseName" Value="##SESSION_PREVIEW_DATABASE_NAME##"/>
        <Property Name="user" Value="##SESSION_PREVIEW_USER_NAME##"/>
        <Property Name="password" Value="##SESSION_PREVIEW_PASSWORD##"/>
      </DataSource>
    </Storage>
  </Wrapper>
</Wrappers>

And in your webservice cd_storage_conf add the same wrapper information and a normal storage config (with the SAME database information as the WRAPPER) and with no Item Type bindings (everything in database):

    <Storage Type="persistence" Id="sqlserver" dialect="MSSQL" Class="com.tridion.storage.persistence.JPADAOFactory">
      <Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
      <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
        <Property Name="serverName" Value="localhost" />
        <Property Name="portNumber" Value="1433" />
        <Property Name="databaseName" Value="##DATABASE_NAME##" />
        <Property Name="user" Value="##USER_NAME##" />
        <Property Name="password" Value="##PASSWORD##" />
      </DataSource>
    </Storage>
  </Storages>
</Global>
<ItemTypes defaultStorageId="sqlserver" cached="false" /> 
  • Nuno, trying to use your info to fix a somehow related issue with session preview. Could you please shed a light: what is <Wrapper> config in website cd_storage_config.xml used for? I don't get a concept: if webservice is a fast-track deployer, than it's clear that it must have this sort of persistence, but what about website? – esteewhy Sep 23 '14 at 7:21
  • 1
    The website needs to retrieve the data from the same database, so it needs to be aware of where to get it from. Website uses JDBC to get the data, not the webservice. – Nuno Linhares Sep 23 '14 at 10:12
  • Thanks Nuno, it's getting clearer. Is it correct to say in simple terms that: webservice writes to preview db and website reads from it afterwards? – esteewhy Sep 23 '14 at 10:14
  • 1
    Yes, that is exactly how it works. – Nuno Linhares Sep 23 '14 at 10:16
8

I would assume your binaries are actually published to the file system and that is where the staging site retrieves it from. But the session preview web service is mapped to the database for all item types. What does your cd_storage_conf.xml on the staging site set the binaries to be read from? This is what the preview web service should be set to as well for preview to work properly. Same for the Page item type.

  • The binaries are indeed published to the file system, but if i configure the session preview web service, to use the filesystem as well, i get the following error : StorageManagerFactory - Loading a non cached DAO for publicationId/typeMapping/itemExtension: 0 / Query / null JPQLExecutor - Can not create JPAQueryDAO object How can i make use of files with the 'session preview web service' ? – FuZZbaLL Mar 15 '13 at 8:34
6

That error is usually caused by insufficient Windows permissions on the directory where the temporary files are created (e.g. c:\inetpub\wwwroot).

The exact location and the user who needs Write permissions will depend on your environment, so the only solid advice I can give you is to monitor the attempt using a tool like Process Monitor -- so you can see the user you need to give permissions to and act accordingly.

  • Using Process Monitor i found that there is a special preview folder in the Tridion installation that needed different rights. Thanx C:\Program Files (x86)\Tridion\web\Preview\FastTrackPreview\2f75882a-c34f-406e-a88c-be76a2377d6a\com\system\images\476464881-898011338_article_tcm9-78615.png – FuZZbaLL Mar 19 '13 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.