Package net.sf.archimede.model.collection

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


       
        List collections = rootCollection.getCollections();
        //Community
        for (Iterator collIt = collections.iterator(); collIt.hasNext(); ){
            Collection currentCollection = (Collection) collIt.next();
            Collection comparisonCollection = new CollectionImpl();
            comparisonCollection.setName(this.oldFolder.getGroupName());
            if (currentCollection.getName().equals(comparisonCollection.getName())) {
               return currentCollection;
            }
        }
       
        return null;
View Full Code Here


            return null;
        }
        //Community
        for (Iterator collIt = collections.iterator(); collIt.hasNext(); ) {
            Collection currentCollection = (Collection) collIt.next();
            Collection comparisonCollection = new CollectionImpl();
            comparisonCollection.setName(this.oldFolder.getSeriesName());
            if (currentCollection.getName().equals(comparisonCollection.getName())) {
               return currentCollection;
            }
        }
       
        return null;
View Full Code Here

       
        Collection groupCollection = getGroupInRepository();
        if (groupCollection == null) {
            CollectionDao collectionDao = CollectionDao.createInstance();
            Collection rootCollection = collectionDao.getRootCollection();
            groupCollection = new CollectionImpl();
            groupCollection.setName(this.oldFolder.getGroupName());
            groupCollection.setParent(rootCollection);
           
            if (groupCollection.getReadUsers() == null) {
              groupCollection.setReadUsers(new ArrayList());
            }
            groupCollection.getReadUsers().add(new UserImpl("anonymous", ""));
           
            if (rootCollection.getCollections() != null) {
                rootCollection.getCollections().add(groupCollection);
            } else {
                List collections = new ArrayList();
                collections.add(groupCollection);
                rootCollection.setCollections(collections);
            }
           
            collectionDao.save(groupCollection);
        }
           
        Collection seriesCollection = getSeriesInRepository(groupCollection);
        if (seriesCollection == null) {
            CollectionDao collectionDao = CollectionDao.createInstance();
            seriesCollection = new CollectionImpl();
            seriesCollection.setName(this.oldFolder.getSeriesName());
            seriesCollection.setParent(groupCollection);
           
            if (seriesCollection.getReadUsers() == null) {
              seriesCollection.setReadUsers(new ArrayList());
View Full Code Here

        }
        if (!found) {
            if (parentCollection.getCollections() == null) {
                parentCollection.setCollections(new ArrayList());
            }
            Collection newCollection = new CollectionImpl();
            newCollection.setName(newCollectionName);
            newCollection.setParent(parentCollection);
            parentCollection.getCollections().add(newCollection);
            collection = newCollection;
           
            if (newCollection.getReadUsers() == null) {
                newCollection.setReadUsers(new ArrayList());
            }
            newCollection.getReadUsers().add(new UserImpl("anonymous", ""));
           
            CollectionDao.createInstance().save(newCollection);
        }
       
        return collection;
View Full Code Here

    super.setUp();
       
        if (this.aCollection == null) {
            DatabaseUtil.getSingleton().beginTransaction(new CredentialsWrapper(AllTests.ADMIN_USERNAME, AllTests.ADMIN_PASSWORD));
           
            this.aCollection = new CollectionImpl();
        this.aCollection.setName("" + Math.random());
        this.aCollection.setDescription("A fantastic collection of documents");
        this.aCollection.setParent(this.collectionDao.getRootCollection());
        this.collectionDao.save(this.aCollection);
           
View Full Code Here

        this.newName = newName1;
    }
   
    public String newCollection() throws ObjectLockedException, ObjectExistsException {
        if (this.newName != null && !this.newName.trim().equals("")) {
            Collection collection = new CollectionImpl();
            collection.setName(this.newName);
            collection.setParent(this.selectedCollection.getCollection());
            CollectionDao.createInstance().save(collection);
            this.newName = null;
        }
        this.selectedCollection = new ViewCollection(CollectionDao.createInstance().retrieve(this.selectedCollection.getId()));
        this.collections = this.selectedCollection.getCollectionsModel();
View Full Code Here

            user.setUsername("user");
            user.setPassword("user");
            UserDao.createInstance().save(user);
           
            CollectionDao collectionDao = CollectionDao.createInstance();
            Collection rootCollection = new CollectionImpl();
            rootCollection.setName(CollectionDao.ROOT_COLLECTION);
            rootCollection.setDescription("Access point");
            //Read
            {
                List readUsers = new ArrayList();
                readUsers.add(anonymous);
                readUsers.add(admin);
                rootCollection.setReadUsers(readUsers);
            }
            {
                List writeUsers = new ArrayList();
                writeUsers.add(admin);
                rootCollection.setWriteUsers(writeUsers);
            }
            {
                List removeUsers = new ArrayList();
                removeUsers.add(admin);
                rootCollection.setRemoveUsers(removeUsers);
            }
            {
                List ownerUsers = new ArrayList();
                ownerUsers.add(admin);
                rootCollection.setOwnerUsers(ownerUsers);
            }
           
            collectionDao.save(rootCollection);
           
            dbUtil.commitTransaction();
View Full Code Here

TOP

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

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.