Package com.tridion.dcp

Examples of com.tridion.dcp.ComponentPresentationFactory


    if (items.length == 0) {
      return result;
    }

    int publicationId = new TCMURI(items[0]).getPublicationId();
    ComponentPresentationFactory factory = new ComponentPresentationFactory(publicationId);

    for (String tcmUri : items) {
      com.tridion.dcp.ComponentPresentation oldCP = factory.getComponentPresentationWithHighestPriority(tcmUri);
      if (oldCP != null) {
        ComponentPresentation componentPresentation = MapperFactory.mapComponentPresentation(oldCP);
        result.add(componentPresentation);
      }
    }
View Full Code Here


      TCMURI tcmUri = new TCMURI(componentTcmUris[0]);
      int publicationId = tcmUri.getPublicationId();
      String templateTcmUri = getTemplateTcmUri(publicationId);

      ComponentPresentationFactory factory = new ComponentPresentationFactory(publicationId);
      ComponentPresentation componentPresentation;

      for (String componentTcmUri : componentTcmUris) {
        if (templateTcmUri == null) {
          componentPresentation = factory.getComponentPresentationWithHighestPriority(componentTcmUri);
        } else {
          componentPresentation = factory.getComponentPresentation(componentTcmUri, templateTcmUri);
        }
        if (componentPresentation != null) {
          result.add(componentPresentation);
        }
      }
View Full Code Here

    return result;
  }

  private int getComponentTemplateId(TCMURI tcmUri) {
    ComponentPresentationFactory factory = new ComponentPresentationFactory(tcmUri.getPublicationId());
    ComponentPresentation dcp = factory.getComponentPresentationWithHighestPriority(tcmUri.getItemId());

    return dcp == null ? -1 : dcp.getComponentTemplateId();
  }
View Full Code Here

  }

  private ComponentPresentation getComponentPresentation(String componentUri, String componentTemplateUri)
      throws ParseException {
    int publicationId = new TCMURI(componentUri).getPublicationId();
    ComponentPresentationFactory cpFactory = new ComponentPresentationFactory(publicationId);

    return cpFactory.getComponentPresentation(componentUri, componentTemplateUri);
  }
View Full Code Here

TOP

Related Classes of com.tridion.dcp.ComponentPresentationFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.