Package net.sf.archimede.model.folder

Examples of net.sf.archimede.model.folder.FolderDao


                folders.add(folder);
                seriesCollection.setFolders(folders);
            }
           
           
            FolderDao folderDao = FolderDao.createInstance();
            folderDao.save(folder);
           
            addFiles(folder);
            addMetadata(folder);
        } else {
            throw new ObjectExistsException(folder);
View Full Code Here


                    this.isCollectionsInit = true;
                    return this.collection.getCollections();
                   
                } else if (method.getName().equals("getFolders") && !this.isFoldersInit) {
                    List folders = new ArrayList();
                    FolderDao folderDao = FolderDao.createInstance();
                    Node node = session.getNodeByUUID(this.collection.getId());
                    if (!node.hasNode(NodesTypes.PREFIX + CollectionDao.FOLDERS_NODE_NAME)) {
                        this.isFoldersInit = true;
                      return folders;
                    }
                    for (NodeIterator ni = node.getNode(NodesTypes.PREFIX + CollectionDao.FOLDERS_NODE_NAME).getNodes(); ni.hasNext(); ) {
                        Node folderNode = ni.nextNode();
                        Folder folder = folderDao.retrieve(folderNode.getUUID());
                        folders.add(folder);
                    }
                    Collections.sort(folders, new Comparator() {
                        public int compare(Object arg0, Object arg1) {
                            Collator comp = Collator.getInstance(Locale.US);
View Full Code Here

    }
   
    public Vector getSchemaLocations(String oaiIdentifier) throws IdDoesNotExistException, NoMetadataFormatsException, OAIInternalServerError {
        try {
            DatabaseUtil.getSingleton().beginTransaction(new CredentialsWrapper(this.username, this.password));
            FolderDao folderDao = FolderDao.createInstance();
            String folderId = this.getRecordFactory().fromOAIIdentifier(oaiIdentifier);
            Folder folder = folderDao.retrieve(folderId);
            return getRecordFactory().getSchemaLocations(folder);
        } finally {
            try {
                DatabaseUtil.getSingleton().commitTransaction();
            } catch (TransactionException e) {
View Full Code Here

        try {
            Date fromDate = DATE_FORMAT.parse(from);
            Date untilDate = DATE_FORMAT.parse(until);
           
            DatabaseUtil.getSingleton().beginTransaction(new CredentialsWrapper(this.username, this.password));
            FolderDao folderDao = FolderDao.createInstance();
            List folders = folderDao.list();
            for (Iterator it = folders.iterator(); it.hasNext(); ) {
                Folder currentFolder = (Folder) it.next();
                Date currentDate = currentFolder.getDatestamp().getTime();
               
                boolean validFromDate = fromDate == null || currentDate.compareTo(fromDate) >= 0;
View Full Code Here

    }

    public String getRecord(String oaiIdentifier, String metadataPrefix) throws IdDoesNotExistException, CannotDisseminateFormatException, OAIInternalServerError {
        try {
            DatabaseUtil.getSingleton().beginTransaction(new CredentialsWrapper(this.username, this.password));
            FolderDao folderDao = FolderDao.createInstance();
            String folderId = this.getRecordFactory().fromOAIIdentifier(oaiIdentifier);
            Folder folder = folderDao.retrieve(folderId);
           
            Iterator setSpecs = this.getRecordFactory().getSetSpecs(folder);
            String schemaURL = null;
            if (metadataPrefix != null) {
                if ((schemaURL = getCrosswalks().getSchemaURL(metadataPrefix)) == null) {
View Full Code Here

    public String open() {
        FolderBean folderBean = (FolderBean) FacesContext.getCurrentInstance().getApplication().createValueBinding(FolderBean.BEAN_REF).getValue(FacesContext.getCurrentInstance());    
       
        this.selectedFolder = new ViewFolder((Folder) ((CustomTreeNode) folderBean.getVersionsTreeModel().getNode()).getContent());
        //Refresh the value
        FolderDao folderDao = FolderDao.createInstance();
        Folder folder = folderDao.retrieve(this.selectedFolder.getId());
        this.selectedFolder = new ViewFolder(folder);
        this.metadataTreeModel = getMetadataTreeNode();
       
       return "workspace_folder_version";
    }
View Full Code Here

     */

    public String submit() {
        if (!this.files.isEmpty()) {
            // Re-init the files
            FolderDao folderDao = FolderDao.createInstance();
            Folder folder = new FolderImpl();
            folder.setName("UnamedDocument");
            folder.setParentCollection((Collection) CollectionDao.createInstance().getRootCollection().getCollections().get(0));
            folder.setDatestamp(new GregorianCalendar());
            folderDao.save(folder);
            for (Iterator it = this.files.values().iterator(); it.hasNext();) {
                UploadedFile currentFile = (UploadedFile) it.next();
                List storedFiles = new ArrayList();
                StoredFile newFile = new StoredFileImpl();
                newFile.setName("content" + Math.random() + ".doc");
View Full Code Here

  }

  public String seeDescriptionFromMyResults() {
    SearchResult searchResult = (SearchResult) this.myResults.getRowData();

    FolderDao folderDao = FolderDao.createInstance();
    Folder folder = folderDao
        .retrieve(searchResult.getFolder().getId());

    FolderBean folderBean = (FolderBean) FacesContext
        .getCurrentInstance().getApplication().createValueBinding(
            FolderBean.BEAN_REF).getValue(
View Full Code Here

  public String seeFolder() {

    TreeNode treeNode = this.treeModel.getNode();
    String identifier = treeNode.getIdentifier();

    FolderDao folderDao = FolderDao.createInstance();
    Folder folder = folderDao.retrieve(identifier);

    FolderBean folderBean = (FolderBean) FacesContext
        .getCurrentInstance().getApplication().createValueBinding(
            FolderBean.BEAN_REF).getValue(
            FacesContext.getCurrentInstance());
View Full Code Here

       
        return "";
    }
   
    public String restoreVersion() {
        FolderDao folderDao = FolderDao.createInstance();
        CustomTreeNode ctn = (CustomTreeNode) this.versionsTreeModel.getNode();
        folderDao.restoreVersion((Folder) ctn.getContent());
       
        //TODO faire une méthode refreshState()
        Folder folder = folderDao.retrieve(this.selectedFolder.getId());
        this.selectedFolder = new ViewFolder(folder);
        this.metadataTreeModel = getMetadataTreeNode();
        this.versionsTreeModel = getVersionsTreeNode();
       
        return "";
View Full Code Here

TOP

Related Classes of net.sf.archimede.model.folder.FolderDao

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.