Package com.dotmarketing.common.db

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


      dc.addParam(startDate);
    }
    if(endDate != null){
      dc.addParam(endDate);
    }
    return convertDotConnectMapToPOJO(dc.loadResults());
  }
 
  private List<Identifier> convertDotConnectMapToPOJO(List<Map<String,String>> results){
    List<Identifier> ret = new ArrayList<Identifier>();
    if(results == null || results.size()==0){
View Full Code Here


      db.addParam(ident.getInode());
      db.loadResult();

      db.setSQL("select inode from "+ident.getAssetType()+" where inode=?");
      db.addParam(ident.getInode());
      List<Map<String,Object>> deleteme = db.loadResults();

      String versionInfoTable=UtilMethods.getVersionInfoTableName(ident.getAssetType());
      if(versionInfoTable!=null) {
          db.setSQL("delete from "+versionInfoTable+" where identifier = ?");
          db.addParam(ident.getId());
View Full Code Here

          db.loadResult();
      }
     
      db.setSQL("select id from workflow_task where webasset = ?");
      db.addParam(ident.getId());
      List<Map<String,Object>> tasksToDelete=db.loadResults();
      for(Map<String,Object> task : tasksToDelete) {
          WorkflowTask wft = APILocator.getWorkflowAPI().findTaskById((String)task.get("id"));
          APILocator.getWorkflowAPI().deleteWorkflowTask(wft);
      }
     
View Full Code Here

      DotConnect dc = new DotConnect();
      ArrayList results = new ArrayList();
      String assetType ="";
      dc.setSQL("Select asset_type from identifier where id =?");
      dc.addParam(assetId);
      ArrayList assetResult = dc.loadResults();
     
      if(assetResult.size()>0){
        assetType = (String) ((Map)assetResult.get(0)).get("asset_type");
      }
     
View Full Code Here

      }
     
      if(UtilMethods.isSet(assetType)){
        dc.setSQL("select i.inode, type from inode i,"+assetType+" a where i.inode = a.inode and a.identifier = ?");
        dc.addParam(assetId);
        results = dc.loadResults();
      }
     
      if(results.size() > 0) {
        String type =  (String) ((Map)results.get(0)).get("type");
        String inode = (String) ((Map)results.get(0)).get("inode");
View Full Code Here

        if(idsToClear.size()<MAX_IDS_CLEAR) {
            dc.setSQL(this.selectChildrenStructureByPathSQL, MAX_IDS_CLEAR-idsToClear.size());
            dc.addParam(isHost?"%":folderPath+"%");
            dc.addParam(host.getPermissionId());
            dc.addParam(host.getPermissionId());
            idsToClear.addAll(dc.loadResults());
        }
      }else if(isFolder){
        //Removing permissions and permission references for all children structures
        dc.setSQL(this.deleteStructureReferencesByPathSQLFolder);
        dc.addParam(isHost?"%":folderPath+"%");
View Full Code Here

        // Retrieving the list of structures changed to clear their caches
        if(idsToClear.size()<MAX_IDS_CLEAR) {
            dc.setSQL(this.selectChildrenStructureByPathSQLFolder, MAX_IDS_CLEAR-idsToClear.size());
            dc.addParam(isHost?"%":folderPath+"%");
            dc.addParam(host.getPermissionId());
            idsToClear.addAll(dc.loadResults());
        }
      }


    } else if(isStructure) {
View Full Code Here

    public List<WorkflowTask> findExpiredTasks() throws DotDataException, DotSecurityException {
        final DotConnect db = new DotConnect();
        List<WorkflowTask> list=new ArrayList<WorkflowTask>();
        try {
            db.setSQL(sql.SELECT_EXPIRED_TASKS);
            List<Map<String,Object>> results=db.loadResults();
            for (Map<String, Object> map : results) {
                String taskId=(String)map.get("id");
                WorkflowTask task=findWorkFlowTaskById(taskId);
                list.add(task);
            }
View Full Code Here

      dc.loadResult();
      //Retrieving the list of content changed to clear their caches
      if(idsToClear.size()<MAX_IDS_CLEAR) {
          dc.setSQL(selectChildrenContentByStructureSQL, MAX_IDS_CLEAR-idsToClear.size());
          dc.addParam(permissionable.getPermissionId());
          idsToClear.addAll(dc.loadResults());
      }

    } else if(isCategory) {

      CategoryAPI catAPI = APILocator.getCategoryAPI();
View Full Code Here

      }

      //Looking for children templates overriding inheritance to also apply the cascade changes
      dc.setSQL(selectChildrenTemplateWithIndividualPermissionsSQL);
      dc.addParam(host.getPermissionId());
      List<Map<String, String>> idsToUpdate = dc.loadResults();
      TemplateAPI templateAPI = APILocator.getTemplateAPI();
      int permission = 0;
      if (inheritablePermission != null) {
        permission = inheritablePermission.getPermission();
      }
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.