Statistics
| Revision:

root / trunk / extensions / extWCS / src / es / uji / lsi / wcs / XmlWcsParsing / Service.java @ 1877

History | View | Annotate | Download (4.12 KB)

1
package es.uji.lsi.wcs.XmlWcsParsing;
2
/*
3
 * Service.java
4
 *
5
 * Created on 21 de diciembre de 2004, 1:02
6
 */
7
/**
8
 *
9
 * @author  jaume
10
 */
11
public class Service {
12
    private String description;                   // A description of the server. (optional)
13
    private String name;                          // A name the service provider assigns to the server. (required)
14
    private String label;                         // A human-readable label for this server, for use in menus and other displays. (required)
15
    private String metadataLink;                  // A link to external metadata (of type "FGDC", "TC211", or "other"). (optional)
16
    private String keywords;                      // Short words to aid catalog searching. (optional)
17
    private String responsibleParty;              // A tree of elements that identify the service provider and provide contact details. (optional)
18
    private String fees;                          // A text string indicating any fees imposed by the service provider. The keyword NONE is reserved to mean no fees. (required)
19
    private String accessConstraints;             // A list of codes describing any access constraints imposed by the service provider. The keyword NONE is reserved to mean no access constraints are imposed. (required)
20
    
21
    /** Creates a new instance of Service */
22
    public Service(XMLNode node) {
23
        for (int i=0; i<node.getNumSubNodes(); i++){
24
            XMLNode subnode = node.getSubNode(i);
25
            if (WCSToolkit.isWCSTab(subnode, "description")) setDescription(subnode.getText());
26
            if (WCSToolkit.isWCSTab(subnode, "name")) setName(subnode.getText());
27
            if (WCSToolkit.isWCSTab(subnode, "label")) setLabel(subnode.getText());
28
            if (WCSToolkit.isWCSTab(subnode, "metadataLink")) setMetadataLink(subnode.getText());
29
            if (WCSToolkit.isWCSTab(subnode, "keywords")) setKeywords(subnode);
30
            if (WCSToolkit.isWCSTab(subnode, "responsibleParty")) setResponsibleParty(subnode);
31
            if (WCSToolkit.isWCSTab(subnode, "fees")) setFees(subnode.getText());
32
            if (WCSToolkit.isWCSTab(subnode, "accessConstraints")) setAccessConstraints(subnode.getText());
33
        }
34
    }
35
    
36
    public String getDescription(){
37
        return description;
38
    }
39

    
40
    public String getName(){
41
        return name;
42
    }
43

    
44
    public String getLabel(){
45
        return label;
46
    }
47

    
48
    public String getMetadataLink(){
49
        return metadataLink;
50
    }
51

    
52
    public String getKeywords(){
53
        return keywords;
54
    }
55

    
56
    public String getResponsibleParty(){
57
        return responsibleParty;
58
    }
59

    
60
    public String getFees(){
61
        return fees;
62
    }
63
    
64
    public String getAccessConstraints(){
65
        return accessConstraints;
66
    }
67
    
68
    public void setDescription(String s){
69
        description = s;
70
    }
71
    
72
    public void setName(String s){
73
        name = s;
74
    }
75
    
76
    public void setLabel(String s){
77
        label = s;
78
    }
79
    
80
    public void setMetadataLink(String s){
81
        metadataLink = s;
82
    }
83
    
84
    public void setKeywords(XMLNode node){
85
        keywords = "";
86
        for (int i=0; i<node.getNumSubNodes(); i++){
87
            keywords += node.getSubNode(i).getText()+";";
88
        }
89

    
90
//        for (int i=0; i<node.getNumSubNodes(); i++){
91
//            keywords.add(node.getSubNode(i).getText());
92
//        }
93
    }
94

    
95
    public void setResponsibleParty(XMLNode node){
96
        responsibleParty = "";
97
        for (int j=0; j<node.getNumSubNodes(); j++){
98
            responsibleParty += node.getSubNode(j).getName()+"="+node.getSubNode(j).getText()+";";
99
        }   
100
    }
101

    
102
    public void setFees(String s){
103
        fees = s;
104
    }
105
    
106
    public void setAccessConstraints(String s){
107
        accessConstraints = s;
108
    }
109
    
110
    public String toString(){
111
        return "\nDescription: "+getDescription()+
112
               "\nName: "+getName()+
113
               "\nLabel: "+getLabel()+
114
               "\nMetadata Link: "+getMetadataLink()+
115
               "\nKeywords: "+getKeywords()+
116
               "\nResponsible party: "+getResponsibleParty()+
117
               "\nFees: "+getFees()+
118
               "\nAccess Constraints: "+getAccessConstraints();
119
    }
120
}