Package com.gentics.api.lib.datasource

Examples of com.gentics.api.lib.datasource.Datasource


    if (request != null) {
      url = (String) request.get("url");
      if (url == null)
        return getDynamicUrl(contentid);
      else {
        Datasource ds = null;
        String ret = null;
        try {
          //if there is an attribute URL the servlet was called with a beautiful URL so give back a beautiful URL         
          //check if valid local link
          String applicationrule = (String) config.get("applicationrule");
          ds = config.getDatasource();
          Expression expression = null;
          try {
            expression = PortalConnectorFactory.createExpression("object.contentid == '" + contentid
                + "' && " + applicationrule);
          } catch (ParserException exception) {
            log.error("Error while building expression object for " + contentid, exception);
            System.out.println("Error while building expression object for " + contentid);
            ret = getDynamicUrl(contentid);
          }

          DatasourceFilter filter = null;
          try {
            filter = ds.createDatasourceFilter(expression);
          } catch (ExpressionParserException e) {
            log.error("Error while building filter object for " + contentid, e);
            ret = getDynamicUrl(contentid);
          }
          int count = 0;
          try {
            count = ds.getCount(filter);
          } catch (DatasourceException e) {
            log.error("Error while querying for " + contentid, e);
            ret = getDynamicUrl(contentid);
          }
View Full Code Here


    // 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

   * @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);
      return getPath(linkedObject);
View Full Code Here

    if (request != null) {
      url = (String) request.get("url");
      if (url == null) {
        return getDynamicUrl(contentid);
      } else {
        Datasource ds = null;
        String ret = null;
        try {
          //if there is an attribute URL the servlet was
          //called with a beautiful URL so give back a beautiful URL
          //check if valid local link
          String applicationrule = (String) config.get("applicationrule");
          ds = config.getDatasource();
          Expression expression = null;
          try {
            expression = PortalConnectorFactory.createExpression("object.contentid == '" + contentid
                + "' && " + applicationrule);
          } catch (ParserException exception) {
            log.error("Error while building expression object for " + contentid, exception);
            ret = getDynamicUrl(contentid);
          }

          DatasourceFilter filter = null;
          try {
            filter = ds.createDatasourceFilter(expression);
          } catch (ExpressionParserException e) {
            log.error("Error while building filter object for " + contentid, e);
            ret = getDynamicUrl(contentid);
          }
          int count = 0;
          try {
            count = ds.getCount(filter);
          } catch (DatasourceException e) {
            log.error("Error while querying for " + contentid, e);
            ret = getDynamicUrl(contentid);
          }
View Full Code Here

TOP

Related Classes of com.gentics.api.lib.datasource.Datasource

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.