Package com.dotmarketing.beans

Examples of com.dotmarketing.beans.Inode


    //update parents to new version delete old versions parents if not
    // live.
    while (parentsIterator.hasNext()) {
      Object obj = parentsIterator.next();
        if(obj instanceof Inode){
        Inode parentInode = (Inode) obj;
        if(!InodeUtils.isSet(parentInode.getInode())){
        continue;
       }
       parentInode.addChild(workingLink);

       //to keep relation types from parent only if it exists
       Tree tree = com.dotmarketing.factories.TreeFactory.getTree(
          parentInode, linkVersion);
       if ((tree.getRelationType() != null)
          && (tree.getRelationType().length() != 0)) {
        Tree newTree = com.dotmarketing.factories.TreeFactory.getTree(
            parentInode, workingLink);
        newTree.setRelationType(tree.getRelationType());
        newTree.setTreeOrder(0);
        TreeFactory.saveTree(newTree);
       }

       // checks type of parent and deletes child if not live version.
       if (!linkVersion.isLive()) {
        if (parentInode instanceof Inode) {
          parentInode.deleteChild(linkVersion);
        }
       }
       }
    }
View Full Code Here


      // Retrieving the current user
      User user = userWebAPI.getLoggedInUser(request);
      Structure hostStrucuture = StructureCache.getStructureByVelocityVarName("Host");

      if (InodeFactory.isInode(inodeOrIdentifier)) {
        Inode inode = InodeFactory.find(inodeOrIdentifier);
        p = inode;
        asset.setType(((Permissionable) inode).getClass().getName());
      } else {
        ContentletAPI contAPI = APILocator.getContentletAPI();
        Contentlet content = contAPI.find(inodeOrIdentifier, user, false);
View Full Code Here

          Logger.info(MaintenanceUtil.class, "Unable to instaniate object");
          Logger.debug(MaintenanceUtil.class,"Unable to instaniate object", e);
          continue;
        }
        if(o instanceof Inode){
          Inode i = (Inode)o;
          String type = i.getType();
          String tableName = ((com.dotcms.repackage.net.sf.hibernate.persister.AbstractEntityPersister)map.get(x)).getTableName();
          cleanInodeTableData(tableName, type);
        }
      }
    }
    it = map.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry pairs = (Map.Entry) it.next();
      Class x = (Class) pairs.getKey();
      if (!x.equals(Inode.class)){
        Object o;
        try {
          o = x.newInstance();
        } catch (Exception e) {
          Logger.info(MaintenanceUtil.class,"Unable to instaniate object");
          Logger.debug(MaintenanceUtil.class,"Unable to instaniate object", e);
          continue;
        }
        if(o instanceof Inode){
          Inode i = (Inode)o;
          String type = i.getType();
          String tableName = ((com.dotcms.repackage.net.sf.hibernate.persister.AbstractEntityPersister)map.get(x)).getTableName();
          removeOphanedInodes(tableName, type);
        }
      }
    }
View Full Code Here

  public static final int compareInodes(String inodeStr1, String inodeStr2) {

    int result = 0;

    if (isSet(inodeStr1) && isSet(inodeStr2)) {
      Inode inodeObj1 = InodeFactory.getInode(inodeStr1, Inode.class);
      Inode inodeObj2 = InodeFactory.getInode(inodeStr2, Inode.class);
      result = inodeObj1.getiDate().compareTo(inodeObj2.getiDate());
    }

    return result;
  }
View Full Code Here

        APILocator.getContentletAPI().publish(cont, user, false);
        return true;
      }

    java.util.List relatedAssets = new java.util.ArrayList();
        Inode inodeObj = InodeFactory.getInode(inode,Inode.class);

        HTMLPage htmlPage = null;

        if( inodeObj instanceof HTMLPage ) {
          htmlPage =(HTMLPage)inodeObj;
        }

        if (htmlPage != null && InodeUtils.isSet(htmlPage.getInode())) {
      relatedAssets = PublishFactory.getUnpublishedRelatedAssets(htmlPage,relatedAssets, user, false);
        }

        if ((relatedAssets == null) || (relatedAssets.size() == 0)) {
        Inode asset = inodeObj;

          if (!permissionAPI.doesUserHavePermission(asset, PERMISSION_PUBLISH, user))
        throw new Exception("The user doesn't have the required permissions.");

          return PublishFactory.publishAsset(asset, req);
View Full Code Here

            Logger.error(this, "Error trying to obtain the current liferay user from the request.", e);
            throw new DotRuntimeException ("Error trying to obtain the current liferay user from the request.");
        }

      HashMap<String, Object> result = new HashMap<String, Object> ();
      Inode asset = (Inode) InodeFactory.getInode(inode, Inode.class);
      if (asset instanceof Folder) {
        Folder folder = (Folder) asset;
        result.put("lastValue", folder.getSortOrder());
        WebAssetFactory.changeAssetMenuOrder (asset, newValue, user);
      } else {
View Full Code Here

    StringBuilder permIds = new StringBuilder();
    //Iterate over 500 at a time to build the SQL
    int permIdCount = 0;
    List<P> permsToReturn = new ArrayList<P>();
    for(P perm : permissionables){
      Inode inode = (Inode)perm;
      permissionableMap.put(inode.getIdentifier(), perm);
      permIds.append("'"+inode.getIdentifier()+"'");
      if((permIdCount>0 && permIdCount%500==0) || (permIdCount==permissionables.size()-1)){
        permIds.append(") ");
        DotConnect dc = new DotConnect();
        dc.setSQL(permissionRefSQL.toString()+permIds.toString() + " UNION " +individualPermissionSQL.toString() + permIds.toString());
        List<Map<String, Object>> results = (ArrayList<Map<String, Object>>)dc.loadResults();
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.