Revision 44645
Added by Katerina Iatropoulou over 7 years ago
RequestResponseHandler.java | ||
---|---|---|
11 | 11 |
PROJECT("project"), |
12 | 12 |
DATASOURCE("datasource"), |
13 | 13 |
ORGANIZATION("organization"), |
14 |
PERSON("person"); |
|
14 |
PERSON("person"), |
|
15 |
NONE(""); |
|
15 | 16 |
|
16 | 17 |
private String value; |
17 | 18 |
Entity(String value) { |
... | ... | |
46 | 47 |
case PERSON: |
47 | 48 |
return PERSON_PREFIX; |
48 | 49 |
|
50 |
case NONE: |
|
51 |
return ""; |
|
52 |
|
|
49 | 53 |
default: |
50 | 54 |
throw new IllegalArgumentException(); |
51 | 55 |
} |
... | ... | |
72 | 76 |
case PERSON: |
73 | 77 |
return "people"; |
74 | 78 |
|
75 |
default: |
|
76 |
throw new IllegalArgumentException(); |
|
77 |
} |
|
79 |
case NONE: |
|
80 |
return "resources"; |
|
78 | 81 |
|
79 |
} |
|
80 |
|
|
81 |
/*public Map<String, String> geIndexParameterMap() { |
|
82 |
switch (this) { |
|
83 |
case PUBLICATION: |
|
84 |
return CQLQueryGeneration.resultIndexParameterMap; |
|
85 | 82 |
default: |
86 | 83 |
throw new IllegalArgumentException(); |
87 | 84 |
} |
88 |
} |
|
89 | 85 |
|
90 |
public Map<String, String> getParameterIndexMap() { |
|
91 |
switch (this) { |
|
92 |
case PUBLICATION: |
|
93 |
return CQLQueryGeneration.resultParameterIndexMap; |
|
94 |
|
|
95 |
case DATASET: |
|
96 |
return CQLQueryGeneration.resultParameterIndexMap; |
|
97 |
|
|
98 |
case PROJECT: |
|
99 |
return CQLQueryGeneration.projectParameterIndexMap; |
|
100 |
|
|
101 |
case DATASOURCE: |
|
102 |
return CQLQueryGeneration.datasourceParameterIndexMap; |
|
103 |
|
|
104 |
case ORGANIZATION: |
|
105 |
return CQLQueryGeneration.organizationParameterIndexMap; |
|
106 |
|
|
107 |
case PERSON: |
|
108 |
return CQLQueryGeneration.projectParameterIndexMap; |
|
109 |
|
|
110 |
default: |
|
111 |
throw new IllegalArgumentException(); |
|
112 |
} |
|
113 | 86 |
} |
114 |
|
|
115 |
public Map<String, String> getParameterOperatorMap() { |
|
116 |
switch (this) { |
|
117 |
case PUBLICATION: |
|
118 |
return CQLQueryGeneration.resultParameterOperatorMap; |
|
119 |
|
|
120 |
case DATASET: |
|
121 |
return CQLQueryGeneration.resultParameterOperatorMap; |
|
122 |
|
|
123 |
case PROJECT: |
|
124 |
return CQLQueryGeneration.projectParameterOperatorMap; |
|
125 |
|
|
126 |
case DATASOURCE: |
|
127 |
return CQLQueryGeneration.datasourceParameterOperatorMap; |
|
128 |
|
|
129 |
case ORGANIZATION: |
|
130 |
return CQLQueryGeneration.organizationParameterOperatorMap; |
|
131 |
|
|
132 |
case PERSON: |
|
133 |
return CQLQueryGeneration.organizationParameterOperatorMap; |
|
134 |
|
|
135 |
default: |
|
136 |
throw new IllegalArgumentException(); |
|
137 |
} |
|
138 |
}*/ |
|
139 | 87 |
} |
140 | 88 |
|
141 | 89 |
public final static String PUBLICATION_PREFIX = "(oaftype exact result) and (resulttypeid exact publication)"; |
Also available in: Unified diff
more code cleaning