Package com.gentics.api.lib.resolving

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


   * @param contentid contentid
   * @return string
   */
  public final 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


      // 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) {
        pubdir = (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

          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 filenameattribute = (String) config.get(CRConfig.ADVPLR_FN_KEY);
              String pubdirattribute = (String) config.get(CRConfig.ADVPLR_PB_KEY);
              String filename = (String) plinkObject.get(filenameattribute);
              String pubdir = (String) plinkObject.get(pubdirattribute);
              HttpServletRequest servletRequest = (HttpServletRequest) request.get("request");
              String contextPath = servletRequest.getContextPath();
              String servletPath = servletRequest.getServletPath();
              ret = contextPath + servletPath + pubdir + filename;
            } catch (DatasourceNotAvailableException e) {
View Full Code Here

TOP

Related Classes of com.gentics.api.lib.resolving.Resolvable

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.