3

I am struggling to get my custom DAO for handling binaries to get invoked. I have taken MOST steps mentioned in various posts, but no luck so far. I have created the bundle XML as follows:

<StorageDAOBundles>
    <StorageDAOBundle type="persistence">
        <StorageDAO typeMapping="Binary" class="com.tridion.storage.extension.JPABinaryDAOExtensionImpl" />
    </StorageDAOBundle>
</StorageDAOBundles>

I see in the server log that my DAO bundle, as added to the cd_storage_conf.xml, gets found:

Executing configuration step: BundleLoader
Custom storage bindings defined, loading binary_dao_bundle.xml
Replaced 'Binary' for storage 'persistence' with .com.tridion.storage.extension.JPABinaryDAOExtensionImpl'.

What I am unsure of is if something still needs to be done with the item types/mapping, ie:

<ItemTypes defaultStorageId="???" cached="false">
  <Item typeMapping="Binary" cached="false" storageId="???" />
</ItemTypes>

Do I need to add a section like above per ItemTypes/Publication? I want to configure that only for binaries published to specific publications my new Binary DAO class is used to handle the binaries, and the regular DAO can be used in the other cases. That is probably the step I am missing right now, but how to configure this?

2 Answers 2

4

JPA DOAs are used only for non-filesystem storage. If you want to extend the behaviour of storage on the filesystem you need to extend the corresponding FSDAO class.

Note that you can change the storage ID (and caching settings) per publication to use and thus switch between DB/filesystem but you cannot change the DAO to use per publication as your custom DAO is not tied to a single storage ID...

You can of course configure your extension to enable this kind of behaviour by just calling the base class functionality depending on custom configuration settings (so use extended functionality for publication X and base functionality for publication Y).

2

Thanks Bjørn, you sent me in the right direction. In my DAO xml I have changed

<StorageDAOBundle type="persistence">

into

<StorageDAOBundle type="filesystem">

Now my DAO methods are being invoked.

1
  • Your class is named 'JPABinaryDAOExtensionImpl' so I assumed it extends the JPABinaryDAO and not the FSBinaryDAO? Not sure if using a JPADAO to store on the filesystem is supported/intended? Commented Jan 22, 2015 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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