Examples of PhotovaultSettings


Examples of org.photovault.common.PhotovaultSettings

    void run() {
        checkSystem();
        // 100 MB tile cache
        JaiInitializer.initJAI();
        PhotovaultSettings settings = PhotovaultSettings.getSettings();
        Collection databases = settings.getDatabases();
        if ( databases.size() == 0 ) {
            DbSettingsDlg dlg = new DbSettingsDlg( null, true );
            if ( dlg.showDialog() != dlg.APPROVE_OPTION ) {
                System.exit( 0 );
            }
View Full Code Here

Examples of org.photovault.common.PhotovaultSettings

                }
                extVolName += n;
            }
            ExternalVolume v = new ExternalVolume( extVolName,
                    dir.getAbsolutePath() );
            PhotovaultSettings settings = PhotovaultSettings.getSettings();
            PVDatabase db = settings.getCurrentDatabase();
            try {
                db.addVolume( v );
            } catch (PhotovaultException ex) {
                // This should not happen since we just checked for it!!!
            }
           
            // Set up the indexer
            ExtVolIndexer indexer = new ExtVolIndexer( v );
            PhotoFolder parentFolder = fc.getExtvolParentFolder();
            if ( parentFolder == null ) {
                parentFolder = PhotoFolder.getRoot();
            }
            String rootFolderName = "extvol_" + dir.getName();
            if ( rootFolderName.length() > PhotoFolder.NAME_LENGTH ) {
                rootFolderName = rootFolderName.substring( 0, PhotoFolder.NAME_LENGTH );
            }
            PhotoFolder topFolder = PhotoFolder.create( rootFolderName,
                    parentFolder );
            topFolder.setDescription( "Indexed from " + dir.getAbsolutePath() );
            indexer.setTopFolder( topFolder );

            // Save the configuration of the new volume
            settings.saveConfig();
           
            // Show status dialog & index the directory
            IndexerStatusDlg statusDlg = new IndexerStatusDlg( this, false );
            statusDlg.setVisible( true );
            statusDlg.runIndexer( indexer );
View Full Code Here

Examples of org.photovault.common.PhotovaultSettings

            volumeRoot.mkdir();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
  volume = new Volume( "testVolume", volumeRoot.getAbsolutePath() );
        PhotovaultSettings settings = PhotovaultSettings.getSettings();
        PVDatabase curDb = settings.getCurrentDatabase();
//        try {
//            curDb.addVolume( extVol );
//        } catch (PhotovaultException ex) {
//            ex.printStackTrace();
//        }
View Full Code Here

Examples of org.photovault.common.PhotovaultSettings

        } catch (IOException ex) {
            ex.printStackTrace();
        }
  volume = new Volume( "testVolume", volumeRoot.getAbsolutePath() );
  extVol = new ExternalVolume( "extVolume", extvolRoot.getAbsolutePath() );
        PhotovaultSettings settings = PhotovaultSettings.getSettings();
        PVDatabase curDb = settings.getCurrentDatabase();
        try {
            curDb.addVolume( extVol );
        } catch (PhotovaultException ex) {
            ex.printStackTrace();
        }
View Full Code Here

Examples of org.photovault.common.PhotovaultSettings

    private boolean createDatabase() {
        // Ask for the admin password
        try {
            PVDatabase db = new PVDatabase();
            db.setName( nameFld.getText() );
            PhotovaultSettings settings = PhotovaultSettings.getSettings();
            settings.addDatabase( db );
            String user = "";
            String passwd = "";
            if ( dbServerBtn.isSelected() ) {
                AdminLoginDlg loginDlg = new AdminLoginDlg( this, true );
                if ( loginDlg.showDialog() == AdminLoginDlg.LOGIN_DLG_OK ) {
                    user = loginDlg.getUsername();
                    passwd = loginDlg.getPasswd();
                }
                db.setDbName( dbNameFld.getText() );
                db.setHost( dbHostFld.getText() );
                Volume vol = new Volume( "defaultVolume", volumeDirFld.getText() );
                try {
                    db.addVolume( vol );
                } catch (PhotovaultException ex) {
                    // Should not happen...
                }
            } else {
                // Creating an embedded database
                db.setInstanceType( PVDatabase.TYPE_EMBEDDED );
                db.setEmbeddedDirectory( new File( volumeDirFld.getText() ) );
            }
            db.createDatabase( user, passwd );
            settings.saveConfig();
        } catch (PhotovaultException ex) {
            JOptionPane.showMessageDialog( this, ex.getMessage(),
                    "Error creating database", JOptionPane.ERROR_MESSAGE );
            return false;
        }
View Full Code Here

Examples of org.photovault.common.PhotovaultSettings

        writer.write( "<!--\n  This data was exported from Photovault database\n-->");
        writer.newLine();
        writer.write( "<photovault-data version=\"0.5.0\">" );
        writer.newLine();
        indent += 2;
        PhotovaultSettings settings = PhotovaultSettings.getSettings();
        settings.getCurrentDatabase().getDbName();
        writer.write( getIndent() + "<originator export-time=\"" + new Date().getTime() + "\"/>" );
        writer.newLine();
        writeFolders( new HashSet() );
       
        PhotoQuery query = new PhotoQuery();
View Full Code Here

Examples of org.photovault.common.PhotovaultSettings

    /**
       Returns the current default volume object
    */
    public static VolumeBase getDefaultVolume() {
  if ( defaultVolume == null ) {
            PhotovaultSettings settings = PhotovaultSettings.getSettings();
            PVDatabase db = settings.getCurrentDatabase();
            defaultVolume = db.getDefaultVolume();
  }
  return defaultVolume;
    }
View Full Code Here

Examples of org.photovault.common.PhotovaultSettings

       Returns the volume with a given name or null if such volume does not exist
       @param volName The name to look for
    */
    public static VolumeBase getVolume( String volName ) {
  VolumeBase vol = null;
        PhotovaultSettings settings = PhotovaultSettings.getSettings();
        PVDatabase db = settings.getCurrentDatabase();
  vol = db.getVolume( volName );
  return vol;
    }
View Full Code Here

Examples of org.photovault.common.PhotovaultSettings

     @throws IOException if there is an error constructing canonical form of the file
     @deprecated Use PVDatabase#getVolumeOfFile instead.
     */
    public static VolumeBase getVolumeOfFile( File f ) throws IOException {
        VolumeBase v = null;
        PhotovaultSettings settings = PhotovaultSettings.getSettings();
        PVDatabase db = settings.getCurrentDatabase();
  v = db.getVolumeOfFile( f );
        return v;
    }
View Full Code Here

Examples of org.photovault.common.PhotovaultSettings

       Sets ut the test environment
    */
    public void setUp() {
  String volumeRoot =  "c:\\temp\\photoVaultVolumeTest";
  volume = new Volume( "testVolume", volumeRoot );
        PhotovaultSettings settings = PhotovaultSettings.getSettings();
        db = settings.getCurrentDatabase();
        try {
            db.addVolume( volume );
        } catch (PhotovaultException ex) {
            ex.printStackTrace();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.