Package net.sf.archimede.model.user

Examples of net.sf.archimede.model.user.User


    }
   
    public String retrieveOwnerFolders() {
        VisitBean visitBean = (VisitBean) FacesContext.getCurrentInstance().getApplication().createValueBinding(VisitBean.BEAN_REF).getValue(FacesContext.getCurrentInstance());
        String username = visitBean.getCredentials().getUsername();
        User user = UserDao.createInstance().retrieve(username);
        List ownerFolders = FolderDao.createInstance().ownerList(user);
        List ownerViewFolders = new ArrayList(ownerFolders.size());
        for (Iterator it = ownerFolders.iterator(); it.hasNext(); ) {
            ownerViewFolders.add(new ViewFolder((Folder) it.next()));
        }
View Full Code Here


            } else {
                groupUsersSet = new HashSet(this.group.getUsers());
            }
           
            for (Iterator it = allUsers.iterator(); it.hasNext(); ) {
                User currentUser = (User) it.next();
                ViewUser viewUser = new ViewUser(currentUser);
                if (groupUsersSet.contains(currentUser)) {
                    viewUser.setMember(true);
                }
                allViewUsers.add(viewUser);
View Full Code Here

    }
   
    public String retrieveOwnerCollections() {
        VisitBean visitBean = (VisitBean) FacesContext.getCurrentInstance().getApplication().createValueBinding(VisitBean.BEAN_REF).getValue(FacesContext.getCurrentInstance());
        String username = visitBean.getCredentials().getUsername();
        User user = UserDao.createInstance().retrieve(username);
        List ownerCollections = CollectionDao.createInstance().ownerList(user);
        List ownerViewCollections = new ArrayList(ownerCollections.size());
        for (Iterator it = ownerCollections.iterator(); it.hasNext(); ) {
            ownerViewCollections.add(new ViewCollection((Collection) it.next()));
        }
View Full Code Here

            FacesContext context = FacesContext.getCurrentInstance();
            context.addMessage(this.passwordComponent.getClientId(context), message);
            return "";
        }
       
        User user = new UserImpl();
        user.setUsername(this.username);
        user.setPassword(this.password);
        try {
            UserDao.createInstance().save(user);
        } catch (ObjectExistsException e) {
          ResourceBundleUtil bundleUtil = ResourceBundleUtil.getInstance();
            FacesMessage message = new FacesMessage( bundleUtil.getMessage("username_alreadySelected") );
View Full Code Here

            context.addMessage(null , message);
            return "";
        }
      
        UserDao userDao = UserDao.createInstance();
        User updatedUser = new UserImpl();
        updatedUser.setUsername(this.username);
        updatedUser.setPassword(this.password);
        userDao.update(updatedUser);
       
        visitBean.setCredentials(new CredentialsWrapper(this.username, this.password));
       
        ResourceBundleUtil bundleUtil = ResourceBundleUtil.getInstance();
View Full Code Here

            List groupUsers = group.getUsers();
            if (groupUsers != null && !groupUsers.isEmpty()) {
                Value[] values = new Value[groupUsers.size()];
                for (ListIterator it = groupUsers.listIterator(); it.hasNext(); ) {
                    int index = it.nextIndex();
                    User groupUser = (User) it.next();
                    String currentUsername = groupUser.getUsername();
                    ValueFactory valueFactory = new ValueFactoryImpl();
                    values[index] = valueFactory.createValue(currentUsername);
                }
                groupNode.setProperty(NodesTypes.PREFIX + USERS_PROPERTY_NAME, values);
            }
View Full Code Here

            List groupUsers = group.getUsers();
            if (groupUsers != null && !groupUsers.isEmpty()) {
                Value[] values = new Value[groupUsers.size()];
                for (ListIterator it = groupUsers.listIterator(); it.hasNext(); ) {
                    int index = it.nextIndex();
                    User currentGroupUser = (User) it.next();
                    String currentUsername = currentGroupUser.getUsername();
                    ValueFactory valueFactory = new ValueFactoryImpl();
                    values[index] = valueFactory.createValue(currentUsername);
                }
                groupNode.setProperty(NodesTypes.PREFIX + USERS_PROPERTY_NAME, values);
            }
View Full Code Here

                    if (node.hasProperty(NodesTypes.PREFIX + USERS_PROPERTY_NAME)) {
                        Property usersProp = node.getProperty(NodesTypes.PREFIX + USERS_PROPERTY_NAME);
                        Value[] usersValues = usersProp.getValues();
                        UserDao userDao = UserDao.createInstance();
                        for (int i = 0; i < usersValues.length; i++) {
                            User user = userDao.retrieve(usersValues[i].getString());
                            users.add(user);
                        }
                    } else {
                        users = new ArrayList();
                    }
View Full Code Here

    try {
        DatabaseUtil dbUtil = DatabaseUtil.getSingleton();
            dbUtil.beginTransaction(SystemPrincipal.getCredentials());
           
            User admin = new UserImpl();
            admin.setUsername("admin");
            admin.setPassword("admin");
            UserDao.createInstance().save(admin);
           
            User anonymous = new UserImpl();
            anonymous.setUsername("anonymous");
            anonymous.setPassword("anonymous");
            UserDao.createInstance().save(anonymous);
           
            User user = new UserImpl();
            user.setUsername("user");
            user.setPassword("user");
            UserDao.createInstance().save(user);
           
            CollectionDao collectionDao = CollectionDao.createInstance();
            Collection rootCollection = new CollectionImpl();
            rootCollection.setName(CollectionDao.ROOT_COLLECTION);
View Full Code Here

    public List getUsersContentPermissions() {
        Map usersMap = new HashMap();
        List allUsers = UserDao.createInstance().list();
        for (Iterator it = allUsers.iterator(); it.hasNext(); ) {
            User currentUser = (User) it.next();
            UserContentPermissions ucp = new UserContentPermissions(this, currentUser);
            usersMap.put(currentUser, ucp);
        }
        if (this.readUsers != null) {
          for (Iterator it = this.readUsers.iterator(); it.hasNext(); ) {
              User currentUser = (User) it.next();
              UserContentPermissions ucp = (UserContentPermissions) usersMap.get(currentUser);
              ucp.setReadable(true);
              usersMap.put(currentUser, ucp);
          }
        }
       
        if (this.writeUsers != null) {
          for (Iterator it = this.writeUsers.iterator(); it.hasNext(); ) {
              User currentUser = (User) it.next();
              UserContentPermissions ucp = (UserContentPermissions) usersMap.get(currentUser);
              ucp.setWritable(true);
              usersMap.put(currentUser, ucp);
          }
        }
       
        if (this.removeUsers != null) {
          for (Iterator it = this.removeUsers.iterator(); it.hasNext(); ) {
              User currentUser = (User) it.next();
              UserContentPermissions ucp = (UserContentPermissions) usersMap.get(currentUser);
              ucp.setRemoveable(true);
              usersMap.put(currentUser, ucp);
          }
        }
       
        if (this.ownerUsers != null) {
          for (Iterator it = this.ownerUsers.iterator(); it.hasNext(); ) {
              User currentUser = (User) it.next();
              UserContentPermissions ucp = (UserContentPermissions) usersMap.get(currentUser);
              ucp.setOwner(true);
              usersMap.put(currentUser, ucp);
          }
        }
View Full Code Here

TOP

Related Classes of net.sf.archimede.model.user.User

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.