Statistics
| Revision:

gvsig-projects-pool / org.gvsig.lidar.prov / org.gvsig.lidar.prov.whitebox / src / main / java / org / gvsig / lidar / prov / whitebox / WhiteboxLASLibrary.java @ 281

History | View | Annotate | Download (3.36 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright ? 2007-2016 gvSIG Association
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.lidar.prov.whitebox;
25

    
26
import org.gvsig.fmap.dal.DALFileLibrary;
27
import org.gvsig.fmap.dal.DALFileLocator;
28
import org.gvsig.fmap.dal.DALLibrary;
29
import org.gvsig.fmap.dal.DALLocator;
30
import org.gvsig.fmap.dal.FileHelper;
31
import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
32
import org.gvsig.lidar.prov.LASDataStoreParameters;
33
import org.gvsig.metadata.MetadataLibrary;
34
import org.gvsig.metadata.exceptions.MetadataException;
35
import org.gvsig.tools.library.AbstractLibrary;
36
import org.gvsig.tools.library.LibraryException;
37

    
38
/**
39
 * 
40
 * @author <a href="mailto:cmartinez@scolab.es">Cesar Martinez Izquierdo</a>
41
 *
42
 */
43
public class WhiteboxLASLibrary extends AbstractLibrary {
44

    
45
    @Override
46
    public void doRegistration() {
47
        registerAsServiceOf(DALLibrary.class);
48
        require(DALLibrary.class);
49
        require(DALFileLibrary.class);
50
        require(MetadataLibrary.class);
51
    }
52

    
53
    @Override
54
    protected void doInitialize() throws LibraryException {
55
    }
56

    
57
    @Override
58
    protected void doPostInitialize() throws LibraryException {
59
        // Register LAS parameters definition
60
        FileHelper.registerParametersDefinition(LASDataStoreParameters.PARAMETERS_DEFINITION_NAME,
61
                        LASDataStoreParameters.class, "LASDataStoreParameters.xml");
62
        DataManagerProviderServices dataman =
63
                (DataManagerProviderServices) DALLocator.getDataManager();
64

    
65
        // Register Whitebox LAS metadata definition
66
        try {
67
            FileHelper.registerMetadataDefinition(WhiteboxLASDataStoreProvider.METADATA_DEFINITION_NAME,
68
                WhiteboxLASDataStoreProvider.class, "WhiteboxLASMetadata.xml");
69
        } catch (MetadataException e) {
70
            throw new LibraryException(getClass(), e);
71
        }
72
        
73
        // Register  Whitebox LAS provider factory
74
        if (!dataman.getStoreProviders().contains(WhiteboxLASDataStoreProvider.NAME)) {
75
            dataman.registerStoreProviderFactory(new WhiteboxLASDataStoreProviderFactory(
76
                WhiteboxLASDataStoreProvider.NAME, WhiteboxLASDataStoreProvider.DESCRIPTION));
77
        }
78

    
79
        // Register Whitebox LAS file system server provider
80
        DALFileLocator.getFilesystemServerExplorerManager().registerProvider(
81
            WhiteboxLASDataStoreProvider.NAME, WhiteboxLASDataStoreProvider.DESCRIPTION,
82
            WhiteboxLASFilesystemServerProvider.class);
83
        
84
        fixDataParameters();
85
    }
86

    
87
    private void fixDataParameters() {
88
    }
89
}