Package net.sf.archimede.model.content

Examples of net.sf.archimede.model.content.ContentDao$RemoveUsersLazyInvocationHandler


            retrievedCollection.setName(name);
            retrievedCollection.setDescription(description);
            retrievedCollection.setImageUrl(imageUrl);
            retrievedCollection.setIcon(icon);
           
            ContentDao contentDao = ContentDao.createInstance();
            contentDao.populateFromRepository(retrievedCollection, node.getSession());
           
            return (Collection) Proxy.newProxyInstance(
                    retrievedCollection.getClass().getClassLoader(),
                    retrievedCollection.getClass().getInterfaces(),
                    new LazyInvocationHandler(retrievedCollection));
View Full Code Here


    private void writeToNode(Collection collection, Node collectionNode) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException {
        collectionNode.setProperty(NodesTypes.PREFIX + DESCRIPTION_PROPERTY_NAME, collection.getDescription());
        collectionNode.setProperty(NodesTypes.PREFIX + IMAGEURL_PROPERTY_NAME, collection.getImageUrl());
        collectionNode.setProperty(NodesTypes.PREFIX + ICON_PROPERTY_NAME, collection.getIcon());
       
        ContentDao contentDao = ContentDao.createInstance();
        contentDao.writeToNode(collection, collectionNode);
    }
View Full Code Here

     */
    public void update(Collection collection) throws ObjectLockedException, ObjectExistsException {
        try {            
            Session session = (Session) DatabaseUtil.getSingleton().getDaoSession();
           
            ContentDao contentDao = ContentDao.createInstance();
            contentDao.touchProperties(collection);
           
            Node collectionNode  = session.getNodeByUUID(collection.getId());
            for (PropertyIterator pi = collectionNode.getProperties(); pi.hasNext(); ) {
                Property property = pi.nextProperty();
                //Do no remove JCR properties and the mandatory restrict children property.
View Full Code Here

            if (ni.hasNext()) {
                throw new RuntimeException("More than one root element found for metadata: " + node.getPath());
            }

            ContentDao contentDao = ContentDao.createInstance();
            // TODO Ca se peut que le noeud ne soit pas encore mix-in. Les
            // autres Daos ont le même problème.
            contentDao.populateFromRepository(retrievedMetadata, session);

            return retrievedMetadata;

        } catch (Exception e) {
            throw new RuntimeException(e);
View Full Code Here

            if (metadata.getRootElement() != null) {
              saveElement(metadata.getRootElement(), metadataNode);
            }
           
            ContentDao contentDao = ContentDao.createInstance();
            //TOTO Currently ceactivated
            if (metadataNode.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
                contentDao.writeToNode(metadata, metadataNode);
            }
           
            session.save();

            //TODO Caution, if transaction is not commited uuid will be null.
View Full Code Here

            GroupImpl retrievedGroup = new GroupImpl();
            retrievedGroup.setId(id);
            retrievedGroup.setName(name);
            retrievedGroup.setDescription(description);           
                       
            ContentDao contentDao = ContentDao.createInstance();
            contentDao.populateFromRepository(retrievedGroup, session);
           
            return (Group) Proxy.newProxyInstance(
                    retrievedGroup.getClass().getClassLoader(),
                    retrievedGroup.getClass().getInterfaces(),
                    new LazyInvocationHandler(retrievedGroup));
View Full Code Here

                }
                groupNode.setProperty(NodesTypes.PREFIX + USERS_PROPERTY_NAME, values);
            }
           
           
            ContentDao contentDao = ContentDao.createInstance();
            contentDao.writeToNode(group, groupNode);
           
            session.save();
            //TODO Caution, if transaction is not commited uuid will be null.
            ((GroupImpl) group).setId(groupNode.getUUID());           
        } catch (Exception e) {
View Full Code Here

                    values[index] = valueFactory.createValue(currentUsername);
                }
                groupNode.setProperty(NodesTypes.PREFIX + USERS_PROPERTY_NAME, values);
            }
           
            ContentDao contentDao = ContentDao.createInstance();
            contentDao.writeToNode(group, groupNode);
           
            session.save();         
        } catch (LockException e) {
            throw new ObjectLockedException(group);
        } catch (ItemExistsException e) {
View Full Code Here

            retrievedStoredFile.setName(name);
            retrievedStoredFile.setEncoding(encoding);
            retrievedStoredFile.setMimeType(mimeType);
            retrievedStoredFile.setLastModified(lastModified);
           
            ContentDao contentDao = ContentDao.createInstance();
            //TODO Ca se peut que le noeud ne soit pas encore mix-in. Les autres Daos ont le même problème.
            contentDao.populateFromRepository(retrievedStoredFile, node.getSession());
           
            return (StoredFile) Proxy.newProxyInstance(
                    retrievedStoredFile.getClass().getClassLoader(),
                    retrievedStoredFile.getClass().getInterfaces(),
                    new LazyInvocationHandler(retrievedStoredFile));
View Full Code Here

        contentNode.setProperty("jcr:encoding", storedFile.getEncoding());
        contentNode.setProperty("jcr:mimeType", storedFile.getMimeType());
        contentNode.setProperty("jcr:data", storedFile.getData());
        contentNode.setProperty("jcr:lastModified", storedFile.getLastModified());
       
        ContentDao contentDao = ContentDao.createInstance();
        contentDao.writeToNode(storedFile, storedFileNode);
    }
View Full Code Here

TOP

Related Classes of net.sf.archimede.model.content.ContentDao$RemoveUsersLazyInvocationHandler

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.