Package com.dotmarketing.common.db

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


                for(Map<String, Object> rr : results) {
                    String id=rr.get("id").toString();
                    Integer langId=Integer.parseInt(rr.get("language_id").toString());
                    sql="select inode from contentlet where identifier=? and language_id=? order by mod_date desc";
                    dc.setSQL(sql);
                    dc.addParam(id);
                    dc.addParam(langId);
                    List<Map<String, Object>> versions = dc.loadObjectResults();
                    String inode=versions.get(0).get("inode").toString();
                    APILocator.getVersionableAPI().setWorking(
                       APILocator.getContentletAPI().find(inode, APILocator.getUserAPI().getSystemUser(), false)
View Full Code Here


                    String id=rr.get("id").toString();
                    Integer langId=Integer.parseInt(rr.get("language_id").toString());
                    sql="select inode from contentlet where identifier=? and language_id=? order by mod_date desc";
                    dc.setSQL(sql);
                    dc.addParam(id);
                    dc.addParam(langId);
                    List<Map<String, Object>> versions = dc.loadObjectResults();
                    String inode=versions.get(0).get("inode").toString();
                    APILocator.getVersionableAPI().setWorking(
                       APILocator.getContentletAPI().find(inode, APILocator.getUserAPI().getSystemUser(), false)
                    );
View Full Code Here

        db.addParam(inode.getInode());
        db.getResult();
                   
      HibernateUtil.delete(o);
      db.setSQL("delete from inode where inode = ?");
      db.addParam(inode.getInode());
      db.getResult();
  }

  public static void deleteChildrenOfClass(Inode parent, Class c) {
    if( c.equals(Identifier.class)){
View Full Code Here

      String tableName = ((Inode) c.newInstance()).getType();
      DotConnect db = new DotConnect();
      db
      .setSQL("select count(*) as test from inode, tree where inode.inode = tree.child and tree.parent = ?  and inode.type = '"
          + tableName + "' ");
      db.addParam(i.getInode());
      // db.addParam(tableName);
      return db.getInt("test");
    } catch (Exception e) {
      Logger.warn(InodeFactory.class, "countChildrenOfClass failed:" + e, e);
      throw new DotRuntimeException(e.toString());
View Full Code Here

        }
 
        DotConnect db = new DotConnect();
        db
        .setSQL("select count(*) as test, inode.type from inode, tree where inode.inode = tree.child and tree.parent = ?  and inode.type IN (" + params + ") group by inode.type");
        db.addParam(i.getInode());
       
        for(String type: types) {
          db.addParam(type);
        }

View Full Code Here

        db
        .setSQL("select count(*) as test, inode.type from inode, tree where inode.inode = tree.child and tree.parent = ?  and inode.type IN (" + params + ") group by inode.type");
        db.addParam(i.getInode());
       
        for(String type: types) {
          db.addParam(type);
        }

        ArrayList<Map<String, Object>> results = db.getResults();
        int length = results.size();
        for(n = 0; n < length; n++)
View Full Code Here

    //To Check whether given inode exists in DB or not
  public static boolean isInode(String inode){
    DotConnect dc = new DotConnect();
    String InodeQuery = "Select count(*) as count from inode where inode = ?";
    dc.setSQL(InodeQuery);
    dc.addParam(inode);
    ArrayList<Map<String, String>> results = new ArrayList<Map<String, String>>();
    try {
      results = dc.getResults();
    } catch (DotDataException e) {
      Logger.error(InodeFactory.class,"isInode method failed:"+ e, e);
View Full Code Here

            inode = identifier.get("inode");
            Logger.debug(CMSMaintenanceFactory.class,"Non Working Contentlet inode : " + inode);
            Logger.debug(CMSMaintenanceFactory.class,"Running query: " + fixContentletQuery);
            db.setSQL(fixContentletQuery);
            db.addParam(inode);
            db.getResult();

            FixAssetsProcessStatus.addAError();
            counter++;
          }
View Full Code Here

              "identifier inode " + identifierInode);
          Logger.debug(CMSMaintenanceFactory.class, "Running query: "
              + fix2FileAssetQuery);

          db.setSQL(fix2FileAssetQuery);
          db.addParam(identifierInode);
          versions = db.getResults();
          modifiedData.addAll(versions);

          if (0 < versions.size()) {
            version = versions.get(0);
View Full Code Here

            Logger.debug(CMSMaintenanceFactory.class,
                "Non Working File inode : " + inode);
            Logger.debug(CMSMaintenanceFactory.class,
                "Running query: " + fix3FileAssetQuery);
            db.setSQL(fix3FileAssetQuery);           
            db.addParam(inode);
            db.addParam(identifierInode);
            db.getResult();

            FixAssetsProcessStatus.addAError();
            counter++;
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.