Package com.dotmarketing.common.db

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


  private synchronized void convertFileAssetsToContentlets() throws DotDataException{

    DotConnect dc = new DotConnect();
    dc.setSQL("select inode from file_asset order by mod_date asc");
    List<HashMap<String, Object>> inodes = dc.loadResults();
    for (Map<String, Object> inode : inodes) {
      String id = (String) inode.get("inode");
      File file = null;
      try {
        file = APILocator.getFileAPI().find(id, APILocator.getUserAPI().getSystemUser(), false);
View Full Code Here


    DotConnect db = new DotConnect();
    db.setSQL("SELECT id,last_inode, warnings, errors, results, messages FROM import_audit where id= ?");
    db.addParam(Id);
    List dbResults=null;
    try {
      dbResults=db.loadResults();
      //dbResults=db.loadResults();
    } catch (DotDataException e) {
      Logger.error(ImportAuditUtil.class,e.getMessage(),e);

    };
View Full Code Here

      steps.addAll(mySteps);
    }
   
    DotConnect dc = new DotConnect();
    dc.setSQL("select id, scheme_id, structure_id from workflow_scheme_x_structure");
    List<Map<String, String>> workflowStructures = dc.loadResults();
   
   
   
   
   
View Full Code Here

  public static long createAuditRecord(String userId, String filename){
    DotConnect db = new DotConnect();
    db.setSQL("SELECT max(id) as max FROM import_audit");
    ArrayList<Map<String, String>> ret;
    try {
      ret = db.loadResults();
    } catch (DotDataException e1) {
      Logger.error(ImportAuditUtil.class,e1.getMessage(),e1);
      return 0;
    }
    Long maximum=null;
View Full Code Here

            dc.loadResult();

            if(idsToClear.size()<MAX_IDS_CLEAR) {
                dc.setSQL(selectChildrenContentByStructureSQL, MAX_IDS_CLEAR-idsToClear.size());
                dc.addParam(permissionable.getPermissionId());
                idsToClear.addAll(dc.loadResults());
            }
            ran10=true;
          }
      }
View Full Code Here

        if(toClear.size()<MAX_IDS_CLEAR) {
          dc.setSQL(selectPermissionReferenceSQL, MAX_IDS_CLEAR-toClear.size());
          dc.addParam(permissionable.getPermissionId());
          dc.addParam(type);
          toClear.addAll(dc.loadResults());
        }

      String replacement = referenceReplacement.get(type);
      if(!replacement.equals(permissionable.getPermissionId())) {
View Full Code Here

      if (start > -1)
        dotConnect.setStartRow(start);
      if (limit > -1)
        dotConnect.setMaxRows(limit);

      ArrayList<Map<String, Object>> results = dotConnect.loadResults();

      for (int i = 0; i < results.size(); i++) {
        Map<String, Object> hash = (Map<String, Object>) results.get(i);
        String userId = (String) hash.get("userid");
        users.add(APILocator.getUserAPI().loadUserById(userId,APILocator.getUserAPI().getSystemUser(),false));
View Full Code Here

    List<HashMap<String, String>> inodes = new ArrayList<HashMap<String, String>>();
    String assetType ="";
    dc.setSQL("Select asset_type from identifier where id =?");
    dc.addParam(permissionId);
    ArrayList assetResult = dc.loadResults();
    if(assetResult.size()>0){
      assetType = (String) ((Map)assetResult.get(0)).get("asset_type");
    }
    if(UtilMethods.isSet(assetType)){
      dc.setSQL("select i.inode, type from inode i,"+assetType+" a where i.inode = a.inode and a.identifier = ?");
View Full Code Here

      assetType = (String) ((Map)assetResult.get(0)).get("asset_type");
    }
    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(permissionId);
      inodes= dc.loadResults();
    }

    StringBuilder inodeCondition = new StringBuilder(128);
    inodeCondition.ensureCapacity(32);
    inodeCondition.append("");
View Full Code Here

        dc.loadResult();
        //Retrieving the list of templates to clear their caches later
        if(idsToClear.size()<MAX_IDS_CLEAR) {
            dc.setSQL(selectChildrenTemplateSQL, MAX_IDS_CLEAR-idsToClear.size());
            dc.addParam(host.getPermissionId());
            idsToClear.addAll(dc.loadResults());
        }

        //Removing permissions and permission references for all children containers
        dc.setSQL(deleteContainerReferencesSQL);
        dc.addParam(host.getPermissionId());
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.