Statistics
| Revision:

gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.lib / org.gvsig.scripting.lib.api / src / main / java / org / gvsig / scripting / ScriptingManager.java @ 468

History | View | Annotate | Download (4.53 KB)

1
package org.gvsig.scripting;
2

    
3
import java.io.File;
4
import java.util.List;
5
import java.util.Map;
6
import org.gvsig.tools.service.spi.ProviderFactory;
7

    
8
/**
9
 * There are two top level management roles within ScriptingFramework: logical
10
 * and User's Interface (UI) management.
11
 *
12
 * This class is responsible of the logical role. It provides all the services
13
 * to manage the information used in ScriptingFramework.
14
 *
15
 * @see ScriptingUIManager
16
 * @see ScriptingHelpManager
17
 */
18
public interface ScriptingManager {
19

    
20
    public static final String INSTALLER_PROVIDER_NAME = "Script";
21
    public static final String INSTALLER_PROVIDER_DESCRIPTION = "Provider to install scripts";
22

    
23
    public static final String UNIT_SCRIPT = "Script";
24
    public static final String UNIT_DIALOG = "Dialog";
25
    public static final String UNIT_FOLDER = "Folder";
26

    
27
    public void setHomeFolder(File home);
28

    
29
    public File getHomeFolder();
30

    
31
    /**
32
     * Returns the System's Folder
33
     *
34
     * @return a {@link ScriptingFolder} with the System's Folder.
35
     */
36
    public ScriptingFolder getSystemFolder();
37

    
38
    /**
39
     * Returns the User's Folder
40
     *
41
     * @return a {@link ScriptingFolder} with the User's Folder.
42
     */
43
    public ScriptingFolder getUserFolder();
44

    
45
    public List<ScriptingFolder> getAlternativeUserFolders();
46

    
47
    public void addAlternativeUserFolder(File f, String name, String description);
48

    
49
    public ScriptingUnit createUnit(String unitType, ScriptingFolder folder, String id);
50

    
51
    public ScriptingUnit createUnit(String unitType, ScriptingFolder folder, String id, String language);
52

    
53
    public List<String> getUnitTypes();
54

    
55
    /**
56
     * Returns the {@link ScriptingBaseScript} associated with the file
57
     * specified
58
     *
59
     * @param file File where is contained the {@link ScriptingBaseScript}'s
60
     * information
61
     *
62
     * @return {@link ScriptingBaseScript}
63
     */
64
    public ScriptingBaseScript getScript(File file);
65

    
66
    public ScriptingBaseScript getScript(String name);
67

    
68
    /**
69
     * Returns the {@link ScriptingFolder} associated with the file specified
70
     *
71
     * @param file File where is contained the {@link ScriptingFolder}'s
72
     * information
73
     *
74
     * @return {@link ScriptingFolder}
75
     */
76
    public ScriptingFolder getFolder(File file);
77

    
78
    /**
79
     * Returns the path of the User's Folder
80
     *
81
     * @return a String with the path of the User's Folder
82
     */
83
//    public String getRootUserFolder();
84
    /**
85
     * Registers a File System with {@link ScriptingUnit}s in the SystemFolder
86
     *
87
     * @param name String with the identificator name of the File System
88
     * registered
89
     * @param folder File with the root of the File System to register
90
     */
91
    public void registerSystemFolder(String name, File folder);
92

    
93
    public List<String> getSupportedLanguages();
94

    
95
    public String getExtensionOfLanguage(String language);
96

    
97
    public String getEngineNameByLanguage(String langName);
98

    
99
    /**
100
     * Checks if an id is unique in a determinate folder
101
     *
102
     * @param folder {
103
     * @ScriptingFolder} with the directory to verify the id
104
     * @param id String with the id to validate
105
     *
106
     * @return true if there isn't another {@link ScriptingUnit} with the same
107
     * id, and false in the other case
108
     */
109
    public boolean validateUnitId(ScriptingFolder folder, String id);
110

    
111
    /**
112
     * Sets a key/value pair in the state of the ScriptingManager that may
113
     * either create a Java Language Binding to be used in the execution of
114
     * scripts
115
     *
116
     * @param key The name of named value to add
117
     * @param value The value of named value to add.
118
     */
119
    public void put(String key, Object value);
120

    
121
    /**
122
     * Retrieves a value set in the state of this ScriptingManager
123
     *
124
     * @param key The key whose value is to be returned
125
     *
126
     * @return an Object with the value corresponding to the key
127
     */
128
    public Object get(String key);
129

    
130
    /**
131
     * Gets the Help manager
132
     *
133
     * @return a {@link ScriptingHelpManager}
134
     *
135
     * @see ScriptingHelpManager
136
     */
137
    public ScriptingHelpManager getHelpManager();
138

    
139
    public void addLibFolder(File lib);
140

    
141
    public File getRootUserFolder();
142
    
143
    public ProviderFactory getInstallerFactory();
144
    
145
    /**
146
     * Devuelbe la carpeta en la que se encuentran los paquetes
147
     * de la aplicacion.
148
     * 
149
     * @return 
150
     */
151
    public File getPackagesFolder();
152
    
153
    /**
154
     * Establece la carpeta en la que se encuentran los paquetes
155
     * de la aplicacion.
156
     * @param folder 
157
     */
158
    public void setPackagesFolder(File folder);
159
}