Package com.dotmarketing.common.db

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


            dc.setStartRow(query.getStart());
        }
        if(query.getLimit() > 0){
            dc.setStartRow(query.getLimit());
        }
        List<Map<String, String>> dbrows = dc.loadResults();
        for (Map<String, String> row : dbrows) {
            Map<String, Serializable> m = new HashMap<String, Serializable>();
            for (String colkey : row.keySet()) {
                if(colkey.startsWith("bool")){
                    if(fieldsMap.get(colkey) != null){
View Full Code Here


        //not cause a problem with the other databases
        DotConnect dc = new DotConnect();

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

        String deleteContentletSQL = "delete from contentlet where identifier<>'SYSTEM_HOST' and mod_date < ? " +
        "and not exists (select * from contentlet_version_info where working_inode=contentlet.inode or live_inode=contentlet.inode)";
        dc.setSQL(deleteContentletSQL);
View Full Code Here

        dc.setSQL(deleteOrphanInodes);
        dc.addParam(date);
        dc.loadResult();

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

        int deleted=before - after;

        // deleting orphan binary files
View Full Code Here

        User systemUser = null;
        try {
           systemUser = APILocator.getUserAPI().getSystemUser();
           dc.setSQL("Select * from contentlet where mod_user = ?");
           dc.addParam(userId);
           List<HashMap<String, String>> contentInodes = dc.loadResults();
           dc.setSQL("UPDATE contentlet set mod_user = ? where mod_user = ? ");
           dc.addParam(systemUser.getUserId());
           dc.addParam(userId);
           dc.loadResult();
           for(HashMap<String, String> ident:contentInodes){
View Full Code Here

        //String parentFolderId = parentFolder!=null?parentFolder.getInode():FolderAPI.SYSTEM_FOLDER;
        DotConnect dc = new DotConnect();
        dc.setSQL("select identifier,inode from identifier,contentlet where identifier.id = contentlet.identifier and parent_path = ? and host_inode=?");
        dc.addParam(folderId.getPath());
        dc.addParam(folder.getHostId());
        List<HashMap<String, String>> contentInodes = dc.loadResults();
        dc.setSQL("update identifier set parent_path = ? where asset_type='contentlet' and parent_path = ? and host_inode=?");
        dc.addParam("/");
        dc.addParam(folderId.getPath());
        dc.addParam(folder.getHostId());
        dc.loadResult();
View Full Code Here

          dc.addParam(endDate);
          dc.addParam(startDate);
          dc.addParam(endDate);
          dc.addParam(structureInode);

          List<Map<String, String>> contentIdentifiers = dc.loadResults();

          PermissionAPI perAPI = APILocator.getPermissionAPI();
          IdentifierAPI identAPI = APILocator.getIdentifierAPI();

          for(Map<String, String> ident:contentIdentifiers){
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(idx.getIdentToIndex());
        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

        db.addParam(uri);
        db.addParam(startDate);
        db.addParam(endDate);
        db.addParam(hostId);
        db.setMaxRows(5);
        return db.loadResults();
    }
   
    @SuppressWarnings("unchecked")
  public static List<Map<String, String>> getTopExternalReferringPages(String uri, java.util.Date startDate, java.util.Date endDate, String hostId) throws DotDataException {
        DotConnect db = new DotConnect();
View Full Code Here

        db.addParam(uri);
        db.addParam(startDate);
        db.addParam(endDate);
        db.addParam(hostId);
        db.setMaxRows(5);
        return db.loadResults();
    }

    @SuppressWarnings("unchecked")
  public static List<Map<String, String>> getTopUsers(String uri, java.util.Date startDate, java.util.Date endDate, String hostId) throws DotDataException {
        DotConnect db = new DotConnect();
View Full Code Here

        db.addParam(uri);
        db.addParam(startDate);
        db.addParam(endDate);
        db.addParam(hostId);
        db.setMaxRows(10);
        return db.loadResults();
    }
   
    @SuppressWarnings("unchecked")
  public static List<Map<String, String>> getAllUsers(String uri, java.util.Date startDate, java.util.Date endDate, String hostId) throws DotDataException {
        DotConnect db = new DotConnect();
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.