2

I am doing migration from 2011 sp1 HR1 to 2013 sp1. In 2011 Sp1 HR1 version I have developed the custom deplorer by extending "ComponentPresentationDeployBase" class provided by Tridion. In the custom deplorer we are fetching components Meta information using below code.

Included Java file:

package com.*.*.deployer.extensions;

import com.tridion.broker.HomeFactory;
import com.tridion.broker.components.meta.ComponentMetaHome;
import com.tridion.meta.ComponentMeta;

static ComponentMetaHome componentHome = null;

static
{
   componentHome = (ComponentMetaHome) HomeFactory.findHome("ComponentMeta");
}

public  void postProcessComponentPresentation(ComponentPresentation     
                                 componentPresentation, File comPresentationFile)

{
    //get the component metadata using the Broker API

   componentMeta = componentHome.findByPrimaryKey(getPublicationId(),getComponentItemId());
}

When try to build same code using new tridion 2013 SP1 jar's provided by tridion, Getting below error. However same code working fine for 2011 sp1 JAR's.

The import com.tridion.broker.HomeFactory cannot be resolved The import com.tridion.broker.components.meta.ComponentMetaHome cannot be resolved The import com.tridion.meta.ComponentMeta cannot be resolved

According to the 2013 SP1 upgrade manual, some classes have moved to different jars.

So how can I get the respective jars or solve this error for below classes?

  1. Import com.tridion.broker.HomeFactory;
  2. import com.tridion.broker.components.meta.ComponentMetaHome;
  3. import com.tridion.meta.ComponentMeta;
1

Import com.tridion.broker.HomeFactory;
import com.tridion.broker.components.meta.ComponentMetaHome;

Are in cd_datalayer.jar

import com.tridion.meta.ComponentMeta;

Is in cd_model.jar

1

If you check the release notes of 2013 SP1 and the Content Delivery API documentation for 2013 SP1, you will find the following information:

com.tridion.broker.HomeFactory Deprecated. The Home classes mechanism has been replaced by the Broker Storage Layer API and might be completely removed in future releases. Instead of this class use the StorageManagerFactory class.

com.tridion.broker.components.meta.ComponentMetaHome Deprecated. The Home classes mechanism has been replaced by the Broker Storage Layer API and might be completely removed in future releases. Instead of this interface use the ItemDAO interface.

So you are encouraged to change your code not using deprecated methods, but that of course does not explain the errors you were seeing on build. My educated guess is that those are coming directly from Eclipse, and the solution for that you can find on Stack Exchange in the answer to this question https://stackoverflow.com/questions/4322893/eclipse-error-the-import-xxx-cannot-be-resolved

  • 1
    Broker Homes have been deprecated since version 2011 even. – Bjørn van Dommelen Nov 20 '14 at 16:55

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.