Package net.sf.archimede.model.collection

Examples of net.sf.archimede.model.collection.Collection


    public DataModel getCollectionsModel() {
        if (this.collections.getWrappedData() == null) {
            List collectionsList = this.collection.getCollections();
            List viewCollectionsList = new ArrayList(collectionsList.size());
            for (Iterator it = collectionsList.iterator(); it.hasNext(); ){
                Collection currentCollection = (Collection) it.next();
                viewCollectionsList.add(new ViewCollection(currentCollection));
            }
            Collections.sort(viewCollectionsList, new ContentSortComparator());
            this.collections.setWrappedData(viewCollectionsList);
        }
View Full Code Here


    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (object instanceof Collection) {
            Collection coll = (Collection) object;
            return this.getId().equals(coll.getId());
        }
        return false;
    }
View Full Code Here

  }

  private TreeNode getTreeNode() {

    CollectionDao collectionDao = CollectionDao.createInstance();
    Collection collection = collectionDao.getRootCollection();
    if (collection == null) {
      CustomTreeNode treeData = new CustomTreeNode("root", " ", false);
      return treeData;
    }

    String rootName = collection.getName();
    CustomTreeNode treeData = new CustomTreeNode("root", rootName, false);

    List commnunities = collection.getCollections();
    for (Iterator it = commnunities.iterator(); it.hasNext();) {
      ViewCollection currentCommunity = new ViewCollection(
          (Collection) it.next());
      CustomTreeNode tnb = new CustomTreeNode("community",
          currentCommunity.getName(), false);
      tnb.setContent(currentCommunity);
      tnb.setIdentifier(currentCommunity.getId());
      tnb.setParent(treeData);
      treeData.getChildren().add(tnb);
      int foldersCount = this.addCommunity(tnb, currentCommunity);
      currentCommunity.setFoldersCount(foldersCount);
    }

    List folders = collection.getFolders();
    for (Iterator it = folders.iterator(); it.hasNext();) {
      Folder currentFolder = (Folder) it.next();
      addFolder(treeData, new ViewFolder(currentFolder));
    }
View Full Code Here

        FacesContext.getCurrentInstance());
   
    TreeNode treeNode = this.treeModel.getNode();
    String identifier = treeNode.getIdentifier();
    CollectionDao collectionDao = CollectionDao.createInstance();
    Collection collection = collectionDao.retrieve(identifier);
    List allViewFolders = new ArrayList();
    List elem = populateAllViewFolders(collection,
        allViewFolders);
    ListDataModel ldm = new ListDataModel();
    ldm.setWrappedData(elem);
View Full Code Here

       
        return "workspace_collection_owner";
    }
   
    public String retrieveBaseCollections() {
        Collection rootCollection = CollectionDao.createInstance().getRootCollection();
        if (rootCollection != null) {
            this.selectedCollection = new ViewCollection(rootCollection);
            List baseCollections = this.selectedCollection.getCollections();
            List baseViewCollections = new ArrayList(baseCollections.size());
            for (Iterator it = baseCollections.iterator(); it.hasNext(); ) {
                baseViewCollections.add(new ViewCollection((Collection) it.next()));
            }
            this.collections = new ListDataModel();
            this.collections.setWrappedData(baseViewCollections);
           
            List collectionFolders = rootCollection.getFolders();
            List collectionViewFolders = new ArrayList(collectionFolders.size());
            for (Iterator it = collectionFolders.iterator(); it.hasNext(); ) {
                collectionViewFolders.add(new ViewFolder((Folder) it.next()));
            }
           
View Full Code Here

    public String seeFromList() {
        this.selectedCollection = (ViewCollection) this.collections.getRowData();
       
        //Get a fresh copy
        String selectCollectionId = this.selectedCollection.getId();
        Collection collection = CollectionDao.createInstance().retrieve(selectCollectionId);
        this.selectedCollection = new ViewCollection(collection);
       
        List collectionCollections = collection.getCollections();
        List collectionViewCollections = new ArrayList(collectionCollections.size());
        for (Iterator it = collectionCollections.iterator(); it.hasNext(); ) {
            collectionViewCollections.add(new ViewCollection((Collection) it.next()));
        }
        this.collections = new ListDataModel();
        this.collections.setWrappedData(collectionViewCollections);
       
       
        List collectionFolders = collection.getFolders();
        List collectionViewFolders = new ArrayList(collectionFolders.size());
        for (Iterator it = collectionFolders.iterator(); it.hasNext(); ) {
            collectionViewFolders.add(new ViewFolder((Folder) it.next()));
        }
       
View Full Code Here

    public String seeParentFromList() {
        this.selectedCollection = (ViewCollection) this.selectedCollection.getParentsModel().getRowData();
       
        //Get a fresh copy
        String selectCollectionId = this.selectedCollection.getId();
        Collection collection = CollectionDao.createInstance().retrieve(selectCollectionId);
       
        List collectionCollections = collection.getCollections();
        List collectionViewCollections = new ArrayList(collectionCollections.size());
        for (Iterator it = collectionCollections.iterator(); it.hasNext(); ) {
            collectionViewCollections.add(new ViewCollection((Collection) it.next()));
        }
        this.collections = new ListDataModel();
        this.collections.setWrappedData(collectionViewCollections);
       
       
        List collectionFolders = collection.getFolders();
        List collectionViewFolders = new ArrayList(collectionFolders.size());
        for (Iterator it = collectionFolders.iterator(); it.hasNext(); ) {
            collectionViewFolders.add(new ViewFolder((Folder) it.next()));
        }
       
View Full Code Here

       
        return "";
    }
   
    public String seePermissions() {
        Collection collection = CollectionDao.createInstance().retrieve(this.selectedCollection.getId());
        this.selectedCollection = new ViewCollection(collection);
       
        return "workspace_collection_edition_permissions";
    }
View Full Code Here

   
    public String open() {
        this.selectedCollection = (ViewCollection) this.collections.getRowData();
        //Refresh the value
        CollectionDao collectionDao = CollectionDao.createInstance();
        Collection collection = collectionDao.retrieve(this.selectedCollection.getId());
        this.selectedCollection = new ViewCollection(collection);
       
        return "workspace_collection_edition";
    }
View Full Code Here

        }
        return "";
    }
    public String paste() throws ObjectLockedException, ObjectExistsException {
        CollectionDao collectionDao = CollectionDao.createInstance();
        Collection destinationCollection = this.selectedCollection.getCollection();
        if (this.selectedCollections != null) {
            if (this.cutRequested && this.copyRequested) {
                throw new IllegalStateException("The object cannot request cut and copy operations all at once.");
            }
            if (this.cutRequested) {
                for (Iterator it = this.selectedCollections.iterator(); it.hasNext(); ){
                    ViewCollection viewCollection = (ViewCollection) it.next();
                    Collection cutCollection = viewCollection.getCollection();
                    collectionDao.cutTo(cutCollection, destinationCollection);
                    this.cutRequested = false;
                }               
            } else if (this.copyRequested) {
                for (Iterator it = this.selectedCollections.iterator(); it.hasNext(); ){
                    ViewCollection viewCollection = (ViewCollection) it.next();
                    Collection copiedCollection = viewCollection.getCollection();
                    collectionDao.copyTo(copiedCollection, destinationCollection);
                    this.copyRequested = false;
               
            } else {
                //All false: nothing to do
View Full Code Here

TOP

Related Classes of net.sf.archimede.model.collection.Collection

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.