Examples of Resolvable


Examples of com.gentics.api.lib.resolving.Resolvable

      for (Resolvable reso : col) {
        boolean found = false;
        if (langs != null) {

          for (String lang : langs) {
            Resolvable langVersion = (Resolvable) reso.get("contentid_" + lang);
            if (langVersion != null) {
              found = true;
              if (!fallbackedColl.contains(langVersion)) {
                fallbackedColl.add(langVersion);
              }
              break;
            }
          }

        }
        if (!found) {
          fallbackedColl.add(reso);
        }
        if (!all && (fallbackedColl.size() >= objectsToProcess)) {
          break;
        }
      }

      if (count != 0) {
        Collection<Resolvable> sizedColl = new ArrayList<Resolvable>();
        Iterator<Resolvable> it = fallbackedColl.iterator();
        int counter = 0;
        while (it.hasNext() && counter < objectsToProcess) {
          Resolvable r = it.next();
          if (counter >= start) {
            sizedColl.add(r);
          }
          counter++;
        }
View Full Code Here

Examples of com.gentics.api.lib.resolving.Resolvable

    String contentid_regex = this.config.getContentidRegex();
    collection = getResolveables(xml);
    crCollection = new ArrayList<CRResolvableBean>(collection.size());
    Iterator<Resolvable> colIterator = collection.iterator();
    while (colIterator.hasNext()) {
      Resolvable item = colIterator.next();
      CRResolvableBean crItem = new CRResolvableBean(item, request.getAttributeArray());
      if (contentid_regex != null)
        crItem.set("contentid", ((String) crItem.get("contentid")).replaceAll(contentid_regex, "$1"));
      crCollection.add(crItem);
    }
View Full Code Here

Examples of com.gentics.api.lib.resolving.Resolvable

  @Override
  public void processBean(final CRResolvableBean contentBean) {
    String targetAttributeValues = "";
    CRResolvableBean folderBean = null;

    Resolvable contentResolvable = contentBean.getResolvable();
    if (contentResolvable != null) {
      folderBean = (CRResolvableBean) contentResolvable.get(FOLDERATTRIBUTE);
      if (folderBean != null) {
        Resolvable folderResolvable = folderBean.getResolvable();
        if (folderResolvable != null) {
          for (String attribute : folderAttributes) {
            Object attributeObject = folderResolvable.getProperty(attribute);
            if (attributeObject != null) {
              String folderAttributesString = attributeObject.toString();
              targetAttributeValues += folderAttributesString;
            }
          }
View Full Code Here

Examples of com.gentics.api.lib.resolving.Resolvable

   * @param request needed for retreiving the url.
   * @return Returns a object bean for binary output from a url.
   * @throws CRException
   */
  public CRResolvableBean getContentByUrl(final CRRequest request) throws CRException {
    Resolvable reso = getBeanByURL(request);
    if (reso == null) {
      log.error("Cannot get Object for path '" + request.getUrl() + "'");
      return null;
    } else {
      return getContent(new CRResolvableBean(reso), request);
View Full Code Here

Examples of com.gentics.api.lib.resolving.Resolvable

  }
 
  @Override
  public void processBean(final CRResolvableBean bean) throws CRException {
    if (bean instanceof CRResolvableBean) {
      Resolvable res = bean.getResolvable();
      if (res instanceof ResolvableFileBean) {
        ResolvableFileBean fileBean = (ResolvableFileBean) res;
        try {
          bean.set(this.targetAttribute, fileBean.getDetectedMimetype());
        } catch (IOException e) {
View Full Code Here

Examples of com.gentics.api.lib.resolving.Resolvable

   * @param request
   * @return a Resolvable Object based on the passed URL.
   */
  @SuppressWarnings("unchecked")
  public CRResolvableBean getObject(final CRRequest request) {
    Resolvable contentObject = null;
    String url = request.getUrl();
    Datasource ds = null;
    if (url != null) {
      try {

View Full Code Here

Examples of com.gentics.api.lib.resolving.Resolvable

   *
   * @param contentid
   */
  public String getPath(final String contentid) {

    Resolvable linkedObject = null;
    Datasource ds = null;
    try {
      ds = this.conf.getDatasource();
      // initialize linked Object
      linkedObject = PortalConnectorFactory.getContentObject(contentid, ds);
View Full Code Here

Examples of com.gentics.api.lib.resolving.Resolvable

      // get filename from linkedObject
      filename = (String) linkedObject.get("filename");

      // Get folder Object from attribute folder_id and attribute pub_dir
      // from it
      Resolvable folder = (Resolvable) linkedObject.get("folder_id");
      if (folder != null) {
        pub_dir = (String) folder.get("pub_dir");
      }
    }

    // If filename is empty or not set, no need to return an path
    if (filename != null && !"".equals(filename)) {
View Full Code Here

Examples of com.gentics.api.lib.resolving.Resolvable

          if (count == 0 || "true".equals(config.getString(CRConfig.ADVPLR_HOST_FORCE))) { //not permitted or forced, build link
            ret = getAlternateUrl(contentid);
          } else {

            Resolvable plinkObject;
            try {

              plinkObject = PortalConnectorFactory.getContentObject(contentid, ds);
              //TODO: make this more beautiful and compatible with portlets
              String filename_attribute = (String) config.get(CRConfig.ADVPLR_FN_KEY);
              String pub_dir_attribute = (String) config.get(CRConfig.ADVPLR_PB_KEY);
              String filename = (String) plinkObject.get(filename_attribute);
              String pub_dir = (String) plinkObject.get(pub_dir_attribute);
              HttpServletRequest servletRequest = (HttpServletRequest) request.get("request");
              String contextPath = servletRequest.getContextPath();
              String servletPath = servletRequest.getServletPath();
              ret = contextPath + servletPath + pub_dir + filename;
            } catch (DatasourceNotAvailableException e) {
View Full Code Here

Examples of com.gentics.api.lib.resolving.Resolvable

    // no cache object so try to prepare a link
    if (("".equals(link) || link == null) && !config.getPortalNodeCompMode()) {

      // Render Content with contentid as template name
      Resolvable plinkObject;
      Datasource ds = null;
      try {
        ds = this.config.getDatasource();
        plinkObject = PortalConnectorFactory.getContentObject(contentid, ds);
       
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.