3

I have written a Storage Extension for dynamic component presentations (based on JPAComponentPresentationDAO) as stated HERE in a SDL Tridion 2011 setup. It was working fine.

However, if I try to run this storage extension on SDL Tridion 2013 SP1 setup even if it is compiled with all the latest JAR files; it gives the below error in the log:

java.lang.RuntimeException: Fatal error, unable to load the StorageManagerFactory
3

I realized that the JPAComponentPresentationDAO which is the base class we are using in our custom storage extension class have got changed a lot in terms of the class members and the method signature. This required us to re-write and re-build the class inherited from this DAO such that it implements and reflect correctly all the parent members.

A step-by-step guide for storage extension has been updated and written at my blog HERE

I hope it will help others while implementing Storage Extension for SDL Tridion 2013. UPDATE: As requested, adding the class as under:

package com.tridion.storage.extension;

import com.tridion.broker.StorageException;
import com.tridion.storage.ComponentPresentation;
import com.tridion.storage.dao.ComponentPresentationDAO;
import com.tridion.storage.persistence.JPAComponentPresentationDAO;
import com.tridion.storage.util.ComponentPresentationTypeEnum;
import java.util.Collection;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component(“JPACustomComponentPresentationDAO”)
@Scope(“prototype”)
public class JPACustomComponentPresentationDAO
extends JPAComponentPresentationDAO
implements ComponentPresentationDAO
{
public JPACustomComponentPresentationDAO(String storageId, EntityManagerFactory entityManagerFactory, String storageType)
{
super(storageId, entityManagerFactory, storageType);
}

public JPACustomComponentPresentationDAO(String storageId, EntityManagerFactory entityManagerFactory, EntityManager entityManager, String storageType)
{
super(storageId, entityManagerFactory, entityManager, storageType);
}

public void create(ComponentPresentation itemToCreate, ComponentPresentationTypeEnum componentPresentationType)
throws StorageException
{
super.create(itemToCreate);
}

public void update(ComponentPresentation itemToUpdate, ComponentPresentationTypeEnum componentPresentationType)
throws StorageException
{
super.update(itemToUpdate);
}

public void remove(ComponentPresentation itemToRemove, ComponentPresentationTypeEnum componentPresentationType)
throws StorageException
{
remove(itemToRemove.getPublicationId(), itemToRemove.getComponentId(), itemToRemove.getTemplateId(), componentPresentationType);
}

public ComponentPresentation getComponentPresentation(int publicationId, int componentId, int templateId, ComponentPresentationTypeEnum componentPresentationType)
throws StorageException
{
return super.getComponentPresentation(publicationId, componentId, templateId, componentPresentationType);
}

public Collection<ComponentPresentation> findAll(int publicationId, int componentId, ComponentPresentationTypeEnum componentPresentationType)
throws StorageException
{
return super.findAll(publicationId, componentId, componentPresentationType);
}

public void remove(int publicationId, int componentId, int componentTemplateId, ComponentPresentationTypeEnum componentPresentationType)
throws StorageException
{
super.remove(publicationId, componentId, componentTemplateId, componentPresentationType);
}

public String getBindingName()
{
return super.getBindingName();
}

public String getStorageId()
{
return super.getStorageId();
}

public String getStorageType()
{
return super.getStorageType();
}

public String getTypeMapping()
{
return null;
}
}
| improve this answer | |
  • Hi Pankaj, do you think you could reproduce your excellent blog here to save people the extra click? Currently this answer doesn't exactly answer your question on its own. – Rob Stevenson-Leggett Jul 19 '14 at 13:21
  • Makes sense Rob... Will do it in a while... Thanks for the suggestion :) – Pankaj Gaur Jul 19 '14 at 13:41
  • Pankaj, did you ever use this extension along with "Publish to child publications" which publishes to 20 or more publications in one go? and did you face any issues? – GJin Jan 12 '18 at 18:54
  • @GJin I did tested it for scenario where publish to child publications was only 2 or 3 - not to a scale of 20+. I did not faced issue with those 2 or 3 child publication. What issue you are facing BTW? – Pankaj Gaur Jan 15 '18 at 7:25
  • the item gets published to different storages when there are more 10 or 15 child publications. that is, instead of going to node1, it can go to any other node. But my further analysis is telling me that the issue is not with this particular module but with the way Solrnet is implemented. Thanks for your reply though! – GJin Jan 17 '18 at 17:30

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.