Package com.dotmarketing.common.db

Examples of com.dotmarketing.common.db.DotConnect.addParam()


        .append(" and ").append(concat).append(include?" LIKE ?":" NOT LIKE ?");
        dc.setSQL(bob.toString());
        dc.addParam(startDate);
        dc.addParam(endDate);
        dc.addParam(host.getIdentifier());
        dc.addParam(likepattern);
       
        try {
            for (Map<String,Object> row : dc.loadObjectResults())
                ret.add((String)row.get("pident"));
        } catch (DotDataException e) {
View Full Code Here


    }
    if(perm == null) {
      DotConnect dc = new DotConnect();
      String assetType ="";
      dc.setSQL("select asset_type as type from identifier where id = ?");
      dc.addParam(assetId);
      ArrayList idResults = dc.loadResults();
      if(idResults.size()>0){
         assetType = (String)((Map)idResults.get(0)).get("type");

         dc.setSQL("select inode, type from inode,"+assetType+" asset,identifier where inode.inode = asset.inode and " +
View Full Code Here

      if(idResults.size()>0){
         assetType = (String)((Map)idResults.get(0)).get("type");

         dc.setSQL("select inode, type from inode,"+assetType+" asset,identifier where inode.inode = asset.inode and " +
                "asset.identifier = identifier.id and asset.identifier = ?");
         dc.addParam(assetId);
         ArrayList results = dc.loadResults();

        if(results.size() > 0) {
          String inode = (String) ((Map)results.get(0)).get("inode");
          perm = InodeFactory.getInode(inode, Inode.class);
View Full Code Here

//                    " on (inode=live_inode or inode=working_inode) and contentlet.identifier=?";
            String sql = "select working_inode,live_inode from contentlet_version_info where identifier=?";
         
            DotConnect dc = new DotConnect();
            dc.setSQL(sql);
            dc.addParam(ident);
            List<Map<String,String>> ret = dc.loadResults();
            List<String> inodes = new ArrayList<String>();
            for(Map<String,String> m : ret) {
              String workingInode = m.get("working_inode");
              String liveInode = m.get("live_inode");
View Full Code Here

          String categoriesSQL = "select category.category_velocity_var_name as cat_velocity_var "+
                    " from  category join tree on (tree.parent = category.inode) join contentlet c on (c.inode = tree.child) " +
                    " where c.inode = ?";
          DotConnect db = new DotConnect();
            db.setSQL(categoriesSQL);
            db.addParam(con.getInode());
            ArrayList<String> categories=new ArrayList<String>();
          List<HashMap<String, String>> categoriesResults = db.loadResults();
          for (HashMap<String, String> crow : categoriesResults)
              categories.add(crow.get("cat_velocity_var"));
View Full Code Here

      ContentletAPI conAPI=APILocator.getContentletAPI();

      String relatedSQL = "select tree.* from tree where parent = ? or child = ? order by tree_order";
      DotConnect db = new DotConnect();
      db.setSQL(relatedSQL);
        db.addParam(con.getIdentifier());
        db.addParam(con.getIdentifier());
        ArrayList<HashMap<String, String>> relatedContentlets = db.loadResults();

        if(relatedContentlets.size()>0) {

View Full Code Here

      String relatedSQL = "select tree.* from tree where parent = ? or child = ? order by tree_order";
      DotConnect db = new DotConnect();
      db.setSQL(relatedSQL);
        db.addParam(con.getIdentifier());
        db.addParam(con.getIdentifier());
        ArrayList<HashMap<String, String>> relatedContentlets = db.loadResults();

        if(relatedContentlets.size()>0) {

            List<Relationship> relationships = RelationshipFactory.getAllRelationshipsByStructure(con.getStructure());
View Full Code Here

  }

  protected void loadRelationshipFields(Contentlet con, Map<String,String> m) throws DotStateException, DotDataException {
      DotConnect db = new DotConnect();
        db.setSQL("select * from tree where parent = ? or child = ? order by tree_order asc");
        db.addParam(con.getIdentifier());
        db.addParam(con.getIdentifier());

        for(Map<String, Object> relatedEntry : db.loadObjectResults()) {

            String childId = relatedEntry.get("child").toString();
View Full Code Here

  protected void loadRelationshipFields(Contentlet con, Map<String,String> m) throws DotStateException, DotDataException {
      DotConnect db = new DotConnect();
        db.setSQL("select * from tree where parent = ? or child = ? order by tree_order asc");
        db.addParam(con.getIdentifier());
        db.addParam(con.getIdentifier());

        for(Map<String, Object> relatedEntry : db.loadObjectResults()) {

            String childId = relatedEntry.get("child").toString();
            String parentId = relatedEntry.get("parent").toString();
View Full Code Here

       
        final String insertSQL="INSERT INTO indicies VALUES(?,?)";
       
        if(info.working!=null) {
            dc.setSQL(insertSQL);
            dc.addParam(info.working);
            dc.addParam(IndexTypes.WORKING.toString().toLowerCase());
            dc.loadResult(conn);
        }
       
        if(info.live!=null) {
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.