Package com.dotmarketing.beans

Examples of com.dotmarketing.beans.Inode


      while (keysIterator.hasNext()) {
        String key = keysIterator.next();
        HashMap<Integer, String> hashInodes = hashMap.get(key);
        for (int i = 0; i < hashInodes.size(); i++) {
          String inode = (String) hashInodes.get(i);
          Inode asset = (Inode) InodeFactory.getInode(inode,
              Inode.class);
          Contentlet c = null;
          try {
            c = APILocator.getContentletAPI().find(inode, user,
                false);
View Full Code Here


    Iterator i = itemsList.iterator();
    int x = 0;
    while (i.hasNext()) {

      Inode item = (Inode) i.next();
      Contentlet c = null;
      try {
        c = APILocator.getContentletAPI().find(item.getInode(), user, false);
      } catch(ClassCastException cce) {
      }

      if (item.getInode().equalsIgnoreCase( itemInode)) {
        //this is the item to move
        if (item instanceof Folder) {
          ((Folder)item).setSortOrder(x + increment);
        }
        else if(item instanceof WebAsset) {
View Full Code Here

* @author  will
*/
public class MultiTreeFactory {

  public static void deleteMultiTree(Object o1, Object o2, Object o3) {
    Inode inode1 = (Inode) o1;
    Inode inode2 = (Inode) o2;
    Inode inode3 = (Inode) o3;

    try {


      DotConnect db = new DotConnect();
      db.setSQL("delete from multi_tree where parent1 =? and parent2 = ? and child = ? ");
      db.addParam(inode1.getInode());
      db.addParam(inode2.getInode());
      db.addParam(inode3.getInode());
      db.getResult();
    }
    catch (Exception e) {
      throw new DotRuntimeException(e.getMessage());
    }
View Full Code Here

    }

  }

  public static boolean existsMultiTree(Object o1, Object o2, Object o3) {
    Inode inode1 = (Inode) o1;
    Inode inode2 = (Inode) o2;
    Inode inode3 = (Inode) o3;

    try {

      DotConnect db = new DotConnect();
      db.setSQL("select count(*) mycount from multi_tree where parent1 =? and parent2 = ? and child = ? ");
      db.addParam(inode1.getInode());
      db.addParam(inode2.getInode());
      db.addParam(inode3.getInode());
     
      int count = db.getInt("mycount");
     
      return (count > 0);
    }
View Full Code Here

      }

      dh.setSQLQuery(sql.toString());

      for (int x = 0; x < inodes.size(); x++) {
        Inode i = (Inode) inodes.get(x);
        dh.setParam(i.getInode());
      }
      if (limit != 0) {
        dh.setFirstResult(offset);
        dh.setMaxResults(limit);
      }
View Full Code Here

      sql.append(condition);
      dh.setSQLQuery(sql.toString());

      for (int x = 0; x < inodes.size(); x++) {
        Inode i = (Inode) inodes.get(x);
        dh.setParam(i.getInode());
      }
      if (limit != 0) {
        dh.setFirstResult(offset);
        dh.setMaxResults(limit);
      }
View Full Code Here

        if(dc.loadResults().size()>0){
          c = InodeUtils.getClassByDBType(dc.getString("type"));
        }
        else{
          Logger.debug(InodeFactory.class,  x + " is not an Inode " );
          return new Inode();
        }
      } catch (DotDataException e) {
        // this is not an INODE
        Logger.debug(InodeFactory.class,  x + " is not an Inode", e );
        return new Inode();
      }
    }
   
   
    Inode inode = null;
    try {
      inode = (Inode) new HibernateUtil(c).load(x);
    } catch (Exception e) {
      //return (Inode) new HibernateUtil(c).load(x);
    }
View Full Code Here

  public static void deleteInode(Object o) throws DotHibernateException {
    if(Identifier.class.equals(o.getClass())){
      throw new DotStateException("Identifiers are no longer Inodes!");
    }
    Inode inode = (Inode) o;
    if(inode ==null || !UtilMethods.isSet(inode.getInode())){
     
      Logger.error(Inode.class, "Empty Inode Passed in");
      return;
    }
   
   
    if(o instanceof Permissionable){
      try {
        APILocator.getPermissionAPI().removePermissions((Permissionable)o);
      } catch (DotDataException e) {
        Logger.error(InodeFactory.class,"Cannot delete object because permissions not deleted : " + e.getMessage(),e);
        return;
      }
    }
   

        // workaround for dbs where we can't have more than one constraint
        // or triggers
        DotConnect db = new DotConnect();
        db.setSQL("delete from tree where child = ? or parent =?");
        db.addParam(inode.getInode());
        db.addParam(inode.getInode());
        db.getResult();
 
        // workaround for dbs where we can't have more than one constraint
        // or triggers
        db.setSQL("delete from multi_tree where child = ? or parent1 =? or parent2 = ?");
        db.addParam(inode.getInode());
        db.addParam(inode.getInode());
        db.addParam(inode.getInode());
        db.getResult();
                   
      HibernateUtil.delete(o);
      db.setSQL("delete from inode where inode = ?");
      db.addParam(inode.getInode());
      db.getResult();
  }
View Full Code Here

      return true;
    }
    return false;
  }   
  public static Inode find(String id) throws DotDataException {
    Inode inode = null;
    try {
      inode = (Inode) HibernateUtil.load(Inode.class, id);
    } catch (DotHibernateException e) {
      if(!(e.getCause() instanceof ObjectNotFoundException))
        throw e;
View Full Code Here

      //elements.addAll(templatesListSubChildren);
      //elements.addAll(containersListSubChildren);

      java.util.Iterator elementsIter = elements.iterator();
      while (elementsIter.hasNext()) {
        Inode inode = (Inode) elementsIter.next();
          Logger.debug(PublishFactory.class, "*****I'm a Folder -- Publishing my Inode Child=" + inode.getInode());
        publishAsset(inode,user, respectFrontendRoles, isNewVersion);
      }
     
      java.util.List<Contentlet> contentlets = conAPI.findContentletsByFolder(parentFolder, user, false);
      java.util.Iterator<Contentlet> contentletsIter = contentlets.iterator();
View Full Code Here

TOP

Related Classes of com.dotmarketing.beans.Inode

Copyright © 2018 www.massapicom. 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.