Package net.sf.archimede.model

Examples of net.sf.archimede.model.CredentialsWrapper


        ThesisMetadata thesisMetadata = ThesisMetadata.createInstanceFromFile(metadataFile);
       
        DatabaseUtil dbUtil = DatabaseUtil.getSingleton();
        try {
            //FIXME Do not hardcode
            dbUtil.beginTransaction(new CredentialsWrapper(username, password));
           
            Collection folderCollection = this.createOrGetThesisCollection(thesisMetadata);
            if (folderCollection.getFolders() == null) {
                folderCollection.setFolders( new ArrayList() );
            }
View Full Code Here


            // Series
            for (int j = 0; j < seriesFiles.length; j++) {
              DatabaseUtil dbUtil = DatabaseUtil.getSingleton();
                try {
                    // FIXME Do not hardcode
                    dbUtil.beginTransaction(new CredentialsWrapper(username, password));
             
                  File seriesFile = seriesFiles[j];
                 
                  File[] folderFiles = seriesFile.listFiles();
                  // File
View Full Code Here

  protected void setUp() throws Exception {
    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());
View Full Code Here

       
  }

  protected void tearDown() throws Exception {
        super.tearDown();
        DatabaseUtil.getSingleton().beginTransaction(new CredentialsWrapper(AllTests.ADMIN_USERNAME, AllTests.ADMIN_PASSWORD));
       
        this.collectionDao.remove(this.aCollection);
       
    DatabaseUtil.getSingleton().commitTransaction();
        System.out.println("tear down------------------------------------------");
View Full Code Here

    DatabaseUtil.getSingleton().commitTransaction();
        System.out.println("tear down------------------------------------------");
  }
 
  public void testSave() throws TransactionException {
        DatabaseUtil.getSingleton().beginTransaction(new CredentialsWrapper(AllTests.ADMIN_USERNAME, AllTests.ADMIN_PASSWORD));
       
        Folder folder3 = new FolderImpl();
    folder3.setName("folder_3");
    folder3.setParentCollection(this.aCollection);
    folder3.setDatestamp(new GregorianCalendar());
View Full Code Here

    }
  
  public void testRetrieve() throws TransactionException {
    this.testSave();
   
        DatabaseUtil.getSingleton().beginTransaction(new CredentialsWrapper(AllTests.ADMIN_USERNAME, AllTests.ADMIN_PASSWORD));
       
        List folders = this.collectionDao.retrieve(this.aCollection.getId()).getFolders();
    Folder folderFromCollection = (Folder) folders.get(0);
    String id = folderFromCollection.getId();
         
View Full Code Here

//    }
 
  public void testDelete() throws TransactionException, ObjectLockedException, ObjectExistsException {
    this.testSave();
   
        DatabaseUtil.getSingleton().beginTransaction(new CredentialsWrapper(AllTests.ADMIN_USERNAME, AllTests.ADMIN_PASSWORD));
                      
        List folders = collectionDao.retrieve(aCollection.getId()).getFolders();
    Folder folderFromCollection = (Folder) folders.get(0);
    folderDao.remove(folderFromCollection);
View Full Code Here

        }
    this.folder = folder;
        this.excerpt = excerpt;
  }
    public ViewFolder(Folder folder) {
      CredentialsWrapper cw = SystemPrincipal.getCredentials();
        if (folder == null) {
            throw new IllegalArgumentException("folder is null");
        }
        this.folder = folder;
    }
View Full Code Here

    public ArchimedeCatalog(Properties properties) {
        this.limitPerRequest = Integer.parseInt((String) properties.get("Archimede.limitPerRequest"));
    }
   
    private List listCollections() {
        DatabaseUtil.getSingleton().beginTransaction(new CredentialsWrapper(this.username, this.password));
        CollectionDao collectionDao = CollectionDao.createInstance();
        List collections = collectionDao.list();
        return collections;
    }
View Full Code Here

        return sb.toString();
    }
   
    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 {
View Full Code Here

TOP

Related Classes of net.sf.archimede.model.CredentialsWrapper

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.