Package com.dotmarketing.common.db

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


          replaceStr="replace(replace(replace(tagname,'\\n',' '),'\\r',' '),'\\t',' ')";
      }
     
      Set<String> replacedNames = new HashSet<String>();
      dc.setSQL("SELECT tagname, "+replaceStr+" AS replaced FROM tag");
      List<HashMap<String,String>> results=dc.loadResults();
      for(HashMap<String,String> names : results) {
          String tag=names.get("tagname");
          String replaced=names.get("replaced");
          if(replacedNames.contains(replaced)) {
              // we need to avoid dupes
View Full Code Here


      dc.executeStatement("UPDATE tag set tagname = " + replaceStr);
      dc.executeStatement("UPDATE tag_inode set tagname = " + replaceStr);
     
      //update tag and tag_inode ids
      dc.setSQL(pullTagNames);
      List<HashMap<String,String>> tagNames = dc.loadResults();
      if(UtilMethods.isSet(tagNames)){
        for(HashMap<String,String> tagName : tagNames){
          String tag = tagName.get("tagname").toString();
          String uuid = UUIDGenerator.generateUuid();
View Full Code Here

    try {

      DotConnect dc = new DotConnect();
      dc.setSQL(findLayouts);
      List<HashMap<String,String>>  layouts = dc.loadResults();

      if(UtilMethods.isSet(layouts)){
        for(HashMap<String,String> layout : layouts){
          String layout_name = layout.get("layout_name").toString();
          if(layout_name.contains("CMS Admin")||layout_name.equals("CMS_Admin")){
View Full Code Here

    String query = "select contentlet.identifier,folder.path from contentlet,folder,identifier where contentlet.folder<>'SYSTEM_FOLDER' " +
               "and contentlet.folder = folder.inode and contentlet.identifier = identifier.id ";
    String dropFolderColumn ="ALTER TABLE contentlet DROP COLUMN folder";
    String dropFK = "";
    dc.setSQL(query);
    List<Map<String, String>> contentFolders = dc.loadResults();
    for(Map<String, String> contentFolder : contentFolders){
      String identifier = contentFolder.get("identifier");
      String parentPath = contentFolder.get("path");
      dc.setSQL("Update identifier set parent_path=? where id=?");
      dc.addParam(parentPath);
View Full Code Here

    dc.executeStatement(addIdentifierToFolder);
    dc.executeStatement(addFK);

    dc.setSQL(folderQuery);
    List<Map<String, String>> folders = dc.loadResults();

    for(Map<String,String> folder : folders){
      String inode = folder.get("inode").trim();
      String name = folder.get("name");
      String path = folder.get("path");
View Full Code Here

                Logger.warn(this, "bad path data for Folder inode:"+inode+" name:"+name  );
            }
    }

    dc.setSQL("select * from folder where inode='SYSTEM_FOLDER'");
    if(dc.loadResults().size()>0){
      Map<String,String> folder = (Map<String,String>)dc.loadResults().get(0);
      String inode = folder.get("inode").trim();
      String type = "folder";
      String uuid = UUIDGenerator.generateUuid();
      Logger.info(this, "Executing Insert into identifier(id,parent_path,asset_name,host_inode,asset_type)values ("+uuid+","+folder.get("path")+","+folder.get("name")+","+Host.SYSTEM_HOST+","+type+")");
View Full Code Here

            }
    }

    dc.setSQL("select * from folder where inode='SYSTEM_FOLDER'");
    if(dc.loadResults().size()>0){
      Map<String,String> folder = (Map<String,String>)dc.loadResults().get(0);
      String inode = folder.get("inode").trim();
      String type = "folder";
      String uuid = UUIDGenerator.generateUuid();
      Logger.info(this, "Executing Insert into identifier(id,parent_path,asset_name,host_inode,asset_type)values ("+uuid+","+folder.get("path")+","+folder.get("name")+","+Host.SYSTEM_HOST+","+type+")");
      dc.setSQL("insert into identifier(id,parent_path,asset_name,host_inode,asset_type)values (?,?,?,?,?)");
View Full Code Here

    String uri = "";
    String assetType ="";
    String assetName ="";
    String parentPath = "";
    dc.setSQL("SELECT * from identifier order by uri");
    List<Map<String, String>> identifierData = dc.loadResults();
    for(Map<String,String> iden :identifierData){
       uri = iden.get("uri");
       String ident = iden.get("id").trim();
       if(uri.contains("content")&& !uri.contains("/")){
       assetType = "contentlet";
View Full Code Here

      dc.executeStatement(addTemplateFK);
      dc.executeStatement(addContainerFK);
      dc.executeStatement(createIndex);
     
      dc.setSQL(template_container_relations);
      List<Map<String, String>> relations = dc.loadResults();
     
      for(Map<String,String> relation : relations){
         String containerId = relation.get("child");
         String templateId = relation.get("identifier");
         String uuid = UUIDGenerator.generateUuid();
View Full Code Here

  @SuppressWarnings("unchecked")
  private void deleteRolesFromLayout(Layout layout) throws DotDataException{
    DotConnect dc = new DotConnect();
    dc.setSQL("select role_id from layouts_cms_roles where layout_id = ?");
    dc.addParam(layout.getId());
    List l =dc.loadResults();
   
    dc.setSQL("delete from layouts_cms_roles where layout_id = ?");
    dc.addParam(layout.getId());
    dc.loadResult();
   
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.