Package com.dotmarketing.common.db

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


        Date date = calendar.getTime();
        DotConnect dc = new DotConnect();

        String countSQL = ("select count(*) as count from "+ assetType);
        dc.setSQL(countSQL);
        List<Map<String, String>> result = dc.loadResults();
        int before = Integer.parseInt(result.get(0).get("count"));
        String versionInfoTable = UtilMethods.getVersionInfoTableName(assetType);

        String condition = " mod_date < ? and not exists (select * from "+versionInfoTable+
                " where working_inode="+assetType+".inode or live_inode="+assetType+".inode)";
View Full Code Here


        dc.addParam(assetType);
        dc.addParam(date);
        dc.loadResult();

        dc.setSQL(countSQL);
        result = dc.loadResults();
        int after = Integer.parseInt(result.get(0).get("count"));

      return before-after;
  }
}
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 " +
                "asset.identifier = identifier.id and asset.identifier = ?");
View Full Code Here

         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

            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");
              inodes.add(workingInode);
View Full Code Here

                    " 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"));

          categoriesString=UtilMethods.join(categories, " ").trim();
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

            info=cache.get();
            if(info==null) {
                info=new IndiciesInfo();
                DotConnect dc = new DotConnect();
                dc.setSQL("SELECT index_name,index_type FROM indicies");
                List<Map<String,Object>> results=dc.loadResults(conn);
                for(Map<String,Object> rr : results) {
                    String name=(String)rr.get("index_name");
                    String type=(String)rr.get("index_type");
                    if(type.equalsIgnoreCase(IndexTypes.WORKING.toString()))
                        info.working=name;
View Full Code Here

      HibernateUtil.startTransaction();
      int total = 0;
       try {
           DotConnect dc = new DotConnect();
           dc.setSQL(filesWithInvalidMimeType);
           List<Map<String, String>> filesWithInvalidMimeTypeResult = dc.loadResults();
       
           total = total + filesWithInvalidMimeTypeResult.size();
           FixAssetsProcessStatus.setTotal(total);
   
           if ((filesWithInvalidMimeTypeResult != null) && (0 < filesWithInvalidMimeTypeResult.size())) {
View Full Code Here

      if(userIds!=null && !userIds.isEmpty()){
        DotConnect dc = new DotConnect();
        dc.setSQL("select tagname, user_id from tag where user_id is not null");
       
        //Gets all the tags from DB that are not null.
        List<Map<String, Object>> results = (ArrayList<Map<String, Object>>)dc.loadResults();
       
        //Checks each of the tag to see if match any of the users in the list.
        for (int i = 0; i < results.size(); i++) {
          Map<String, Object> hash = (Map<String, Object>) results.get(i);
         
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.