Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.ServiceParameterPersister


            Preferences toSave = Platform.getPreferencesService().getRootNode().node(
                    ProjectPlugin.ID).node(layerIDToString());
            if (resources != LayerImpl.NULL) {
                connectionParams.clear();

                ServiceParameterPersister persister = new LayerCatalogRefPersister(
                        connectionParams, getMapFile());

                persister.store(ProgressManager.instance().get(), toSave, resources);
            }

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            Platform.getPreferencesService().exportPreferences((IEclipsePreferences) toSave, out,
                    null);
View Full Code Here


        ByteArrayInputStream input = new ByteArrayInputStream(decoded.getBytes());
        try {
            IPreferencesService preferencesService = Platform.getPreferencesService();
            IExportedPreferences paramsNode = preferencesService.readPreferences(input);

            ServiceParameterPersister persister = new LayerCatalogRefPersister(connectionParams,
                    null);

            persister.restore(findParameterNode(paramsNode));
        } catch (Throwable e) {
            // ok maybe it is an from an older version of uDig so try the oldCatalogRef
            ProjectPlugin.log("CatalogRef#parseResourceParameters, couldn't load paramters", e); //$NON-NLS-1$
        }
View Full Code Here

        try {
            FileInputStream input = new FileInputStream(catalogLocation);
            IPreferencesService preferencesService = Platform.getPreferencesService();
            IExportedPreferences paramsNode = preferencesService.readPreferences(input);

            ServiceParameterPersister persister = new ServiceParameterPersister(this, factory, catalogLocation);
            Preferences parameterNode = findParameterNode(paramsNode);
           
            persister.restore(parameterNode);
        } catch (Throwable e) {
            CatalogPlugin.trace("Unable to restore catalog:"+e, e); //$NON-NLS-1$
            try {
                loadFromFileOld(factory, e);
                CatalogPlugin.trace("Restored from old catalog format",null);
View Full Code Here

    public void loadFromFileOld(IServiceFactory factory, Throwable e) {
        IPreferencesService prefs = Platform.getPreferencesService();
        IEclipsePreferences root = prefs.getRootNode();
        Preferences node = root.node(InstanceScope.SCOPE).node(
                CatalogPlugin.ID + ".services"); //$NON-NLS-1$
        ServiceParameterPersister persister = new ServiceParameterPersister(this, factory);
        persister.restore(node);
    }
View Full Code Here

    public void saveToFile( File catalogLocation, IServiceFactory factory, IProgressMonitor monitor ) {
        try {
            Preferences toSave = Platform.getPreferencesService().getRootNode().node(
                    CatalogPlugin.ID).node("LOCAL_CATALOG_SERVICES"); //$NON-NLS-1$
            if (services != null) {
                ServiceParameterPersister persister = new ServiceParameterPersister(this, factory,
                        catalogLocation.getParentFile());

                persister.store(monitor, toSave, services);
            }

            FileOutputStream out = new FileOutputStream(catalogLocation);
            Platform.getPreferencesService().exportPreferences((IEclipsePreferences) toSave, out,
                    null);
View Full Code Here

TOP

Related Classes of org.locationtech.udig.catalog.ServiceParameterPersister

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.