Examples of TCMURI


Examples of com.tridion.util.TCMURI

    String[] items = query.executeQuery();
    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) {
View Full Code Here

Examples of com.tridion.util.TCMURI

    if (value == null) {
      return -1;
    }

    try {
      TCMURI tcmUri = new TCMURI(value);
      return tcmUri.getItemId();
    } catch (ParseException e) {
      try {
        return Integer.parseInt(value);
      } catch (NumberFormatException nfe) {
        return -1;
View Full Code Here

Examples of com.tridion.util.TCMURI

    }
  }

  public static boolean isValidTcmUri(String value) {
    try {
      new TCMURI(value);
      return true;
    } catch (Exception e) {
      return false;
    }
  }
View Full Code Here

Examples of com.tridion.util.TCMURI

      log.debug("Query found " + componentTcmUris.length + " Components");
      if (componentTcmUris.length == 0) {
        return new ComponentPresentation[0];
      }

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

      ComponentPresentationFactory factory = new ComponentPresentationFactory(publicationId);
      ComponentPresentation componentPresentation;
View Full Code Here

Examples of com.tridion.util.TCMURI

    return result.toArray(new ComponentPresentation[0]);
  }

  private String getTemplateTcmUri(int publicationId) {
    if (componentTemplateId > 0) {
      return new TCMURI(publicationId, componentTemplateId, ItemTypes.COMPONENT_TEMPLATE, 0).toString();
    } else {
      return null;
    }
  }
View Full Code Here

Examples of com.tridion.util.TCMURI

    return componentTemplateId;
  }

  public void setComponentTemplate(String componentTemplate) {
    try {
      TCMURI tcmUri = new TCMURI(componentTemplate);
      componentTemplateId = tcmUri.getItemId();
    } catch (ParseException pe) {
      try {
        componentTemplateId = Integer.parseInt(componentTemplate);
      } catch (NumberFormatException nfe) {
        componentTemplateId = -1;
View Full Code Here

Examples of com.tridion.util.TCMURI

    parameterList.add(param);
  }

  private String doImport(TransformContext context) {
    try {
      TCMURI tcmUri = new TCMURI(url);
      return doImport(tcmUri, context);
    } catch (ParseException e) {
      return doImport(url, context);
    }
  }
View Full Code Here

Examples of com.tridion.util.TCMURI

    if (url.startsWith("/")) {
      PageMetaFactory factory = new PageMetaFactory(0);
      Collection<PageMeta> metas = factory.getMetaByURL(url);
      if (metas.size() > 0) {
        PageMeta pageMeta = metas.iterator().next();
        TCMURI pageUri = new TCMURI(pageMeta.getPublicationId(), pageMeta.getId(), 64, 0);
        return doImport(pageUri, context);
      }
    }

    if (!url.contains("?")) {
View Full Code Here

Examples of com.tridion.util.TCMURI

    return className;
  }

  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

Examples of tridion.contentmanager.TcmUri

    session = new Session();
    log.debug("Tridion session created");
  }

  public void getPage() {
    Page page = new Page(new TcmUri("tcm:1-99-64"), session);
    log.debug("Page title: " + page.getTitle());

    for (ComponentPresentation cp : page.getComponentPresentationsList()) {
      Component component = cp.getComponent();
      ComponentTemplate componentTemplate = cp.getComponentTemplate();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.