001/**
002 * Copyright 2014 Tampere University of Technology, Pori Department
003 * 
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * 
008 *   http://www.apache.org/licenses/LICENSE-2.0
009 * 
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package service.tut.pori.contentanalysis;
017
018/**
019 * Definitions for the content analysis package.
020 * 
021 */
022public final class Definitions {
023  /* services */
024  /** service name declaration */
025  public static final String SERVICE_CA = "ca";
026
027  /* methods */
028  /** service method declaration */
029  public static final String METHOD_ADD_TASK = "addTask";
030  /** service method declaration */
031  public static final String METHOD_DELETE_PHOTO_METADATA = "deletePhotos";
032  /** service method declaration */
033  public static final String METHOD_PHOTO_ANALYSIS = "photoAnalysis";
034  /** implemented by Front-end */
035  public static final String METHOD_QUERY_TASK_DETAILS = "queryTaskDetails";
036  /** implemented by analysis back-ends */
037  public static final String METHOD_QUERY_TASK_STATUS = "queryTaskStatus";
038  /** service method declaration */
039  public static final String METHOD_REDIRECT = "r";
040  /** service method declaration */
041  public static final String METHOD_RETRIEVE_MEDIA_OBJECTS = "getObjects";
042  /** service method declaration */
043  public static final String METHOD_RETRIEVE_PHOTO_METADATA = "getPhotos";
044  /** service method declaration */
045  public static final String METHOD_SEARCH_SIMILAR_BY_CONTENT = "similarPhotosByContent";
046  /** service method declaration */
047  public static final String METHOD_SEARCH_SIMILAR_BY_ID = "similarPhotosById";
048  /** service method declaration */
049  public static final String METHOD_SEARCH_SIMILAR_BY_KEYWORD = "similarPhotosByKeyword";
050  /** service method declaration */
051  public static final String METHOD_SEARCH_SIMILAR_BY_OBJECT = "similarPhotosByObject";
052  /** service method declaration */
053  public static final String METHOD_SIMILARITY_FEEDBACK = "similarityFeedback";
054  /** service method declaration */
055  public static final String METHOD_TASK_FINISHED = "taskFinished";
056  /** service method declaration */
057  public static final String METHOD_UPDATE_PHOTO_METADATA = "updatePhotos";
058
059  /* xml elements */
060  /** xml element declaration */
061  public static final String ELEMENT_ANALYSIS_TYPE = "analysisType";
062  /** xml element declaration */
063  public static final String ELEMENT_ANALYSIS_TYPELIST = "analysisTypeList";
064  /** xml element declaration */
065  public static final String ELEMENT_BACKEND = "backend";
066  /** xml element declaration */
067  public static final String ELEMENT_BACKEND_ID = "backendId";
068  /** xml element declaration */
069  public static final String ELEMENT_BACKEND_STATUS = "backendStatus";
070  /** xml element declaration */
071  public static final String ELEMENT_BACKEND_STATUS_LIST = "backendStatusList";
072  /** xml element declaration */
073  public static final String ELEMENT_CALLBACK_URI = "callbackUri";
074  /** xml element declaration */
075  public static final String ELEMENT_CAPABILITY = "capability";
076  /** xml element declaration */
077  public static final String ELEMENT_CAPABILITY_LIST = "capabilityList";
078  /** xml element declaration */
079  public static final String ELEMENT_CONFIDENCE = "confidence";
080  /** xml element declaration */
081  public static final String ELEMENT_CREDITS = "credits";
082  /** xml element declaration */
083  public static final String ELEMENT_DELETED_PHOTOLIST = "deletedMediaList";
084  /** xml element declaration */
085  public static final String ELEMENT_DESCRIPTION = "description";
086  /** xml element declaration */
087  public static final String ELEMENT_DISSIMILAR_PHOTOLIST = "dissimilarMediaList";
088  /** xml element declaration */
089  public static final String ELEMENT_ENABLED = "enabled";
090  /** xml element declaration */
091  public static final String ELEMENT_END_ITEM = "endItem";
092  /** xml element declaration */
093  public static final String ELEMENT_FEEDBACKLIST= "feedbackList";
094  /** xml element declaration */
095  public static final String ELEMENT_GUID = "UID";
096  /** xml element declaration */
097  public static final String ELEMENT_MEDIA_OBJECT = "object";
098  /** xml element declaration */
099  public static final String ELEMENT_MEDIA_OBJECTLIST = "objectList";
100  /** xml element declaration */
101  public static final String ELEMENT_MEDIA_OBJECT_ID = "mediaObjectId";
102  /** xml element declaration */
103  public static final String ELEMENT_MEDIA_OBJECT_TYPE = "objectType";
104  /** xml element declaration */
105  public static final String ELEMENT_MEDIA_TYPE = "mediaType";
106  /** xml element declaration */
107  public static final String ELEMENT_MESSAGE = "message";
108  /** xml element declaration */
109  public static final String ELEMENT_NAME = "name";
110  /** xml element declaration */
111  public static final String ELEMENT_OBJECT_ID = "objectId";
112  /** xml element declaration */
113  public static final String ELEMENT_PHOTO = "media";
114  /** xml element declaration */
115  public static final String ELEMENT_PHOTOLIST = "mediaList";
116  /** xml element declaration */
117  public static final String ELEMENT_RANK = "rank";
118  /** xml element declaration */
119  public static final String ELEMENT_REFERENCE_PHOTOLIST = "referenceMediaList";
120  /** xml element declaration */
121  public static final String ELEMENT_RESULT_COUNT = "resultCount";
122  /** xml element declaration */
123  public static final String ELEMENT_RESULT_INFO = "resultInfo";
124  /** xml element declaration */
125  public static final String ELEMENT_SERVICE_ID = "serviceId";
126  /** xml element declaration */
127  public static final String ELEMENT_SIMILAR_PHOTOLIST = "similarMediaList";
128  /** xml element declaration */
129  public static final String ELEMENT_START_ITEM = "startItem";
130  /** xml element declaration */
131  public static final String ELEMENT_STATUS = "status";
132  /** xml element declaration */
133  public static final String ELEMENT_TASK_DATAGROUPS = "taskDatagroups";
134  /** xml element declaration */
135  public static final String ELEMENT_TASK_ID = "taskId";
136  /** xml element declaration */
137  public static final String ELEMENT_TASK_DETAILS = "taskDetails";
138  /** xml element declaration */
139  public static final String ELEMENT_TASK_PARAMETERS = "taskParameters";
140  /** xml element declaration */
141  public static final String ELEMENT_TASK_RESULTS = "taskResults";
142  /** xml element declaration */
143  public static final String ELEMENT_TASK_TYPE = "taskType";
144  /** xml element declaration */
145  public static final String ELEMENT_URL = "url";
146  /** xml element declaration */
147  public static final String ELEMENT_USER_CONFIDENCE = "userConfidence";
148  /** xml element declaration */
149  public static final String ELEMENT_VALUE = "value";
150  /** xml element declaration */
151  public static final String ELEMENT_VISIBILITY = "visibility";
152  /** xml element declaration */
153  public static final String ELEMENT_VISUAL_SHAPE = "shape";
154  /** xml element declaration */
155  public static final String ELEMENT_VISUAL_SHAPE_TYPE = "shapeType";
156  
157  /* visibility values */
158  /** visibility type name for group visibility */
159  public static final String VISIBILITY_GROUP = "GROUP";
160  /** visibility type name for private visibility */
161  public static final String VISIBILITY_PRIVATE = "PRIVATE";
162  /** visibility type name for public visibility */
163  public static final String VISIBILITY_PUBLIC = "PUBLIC";
164
165  /* parameters */
166  /** service method parameter declaration */
167  public static final String PARAMETER_ANALYSIS_TYPE = "analysis_type";
168  /** service method parameter declaration */
169  public static final String PARAMETER_BACKEND_ID = "backend_id";
170  /** service method parameter declaration */
171  public static final String PARAMETER_GUID = "uid";
172  /** service method parameter declaration */
173  public static final String PARAMETER_KEYWORDS = "keywords";
174  /** service method parameter declaration */
175  public static final String PARAMETER_MEDIA_OBJECT_ID = "media_object_id";
176  /** service method parameter declaration */
177  public static final String PARAMETER_SERVICE_ID = "service_id";
178  /** service method parameter declaration */
179  public static final String PARAMETER_SORT = "sort";
180  /** service method parameter declaration */
181  public static final String PARAMETER_TASK_ID = "task_id";
182  /** service method parameter declaration */
183  public static final String PARAMETER_URL = "url";
184  
185  /* common database columns */
186  /** SQL database column declaration */
187  public static final String COLUMN_BACKEND_ID = "backend_id";
188  /** SQL database column declaration */
189  public static final String COLUMN_CONFIDENCE = "confidence";
190  /** SQL database column declaration */
191  public static final String COLUMN_CREDITS = "credits";
192  /** SQL database column declaration */
193  public static final String COLUMN_DESCRIPTION = "description";
194  /** SQL database column declaration */
195  public static final String COLUMN_MEDIA_OBJECT_ID = "media_object_id";
196  /** SQL database column declaration */
197  public static final String COLUMN_NAME = "name";
198  /** SQL database column declaration */
199  public static final String COLUMN_SERVICE_ID = "service_id";
200  /** SQL database column declaration */
201  public static final String COLUMN_STATUS = "status";
202  /** SQL database column declaration */
203  public static final String COLUMN_VALUE = "value";
204  /** SQL database column declaration */
205  public static final String COLUMN_VISIBILITY = "visibility";
206  
207  /* data groups */
208  /** not included in data group {@value core.tut.pori.http.parameters.DataGroups#DATA_GROUP_ALL} */
209  public static final String DATA_GROUP_BACKEND_STATUS = "backend_status";
210  /** not included in data group {@value core.tut.pori.http.parameters.DataGroups#DATA_GROUP_ALL} */
211  public static final String DATA_GROUP_RESULT_INFO = "result_info";
212  /** not included in data group {@value core.tut.pori.http.parameters.DataGroups#DATA_GROUP_ALL} */
213  public static final String DATA_GROUP_STATUS = "status";
214  /** 
215   * timecodes should be included in media objects 
216   * 
217   * @see service.tut.pori.contentanalysis.MediaObject#getTimecodes()
218   */
219  public static final String DATA_GROUP_TIMECODES = "timecodes";
220  /** in general internally used data group for requesting the presence of visibility data in a response. See {@link service.tut.pori.contentanalysis.CAContentCore.Visibility} */
221  public static final String DATA_GROUP_VISIBILITY = "visibility";
222  /* media object datagroups */
223  /** data group for requesting media objects of type {@link service.tut.pori.contentanalysis.MediaObject.MediaObjectType#FACE} */
224  public static final String DATA_GROUP_FACE = "face";
225  /** data group for requesting media objects of type {@link service.tut.pori.contentanalysis.MediaObject.MediaObjectType#KEYWORD} */
226  public static final String DATA_GROUP_KEYWORDS = "keywords";
227  /** data group for requesting media objects of type {@link service.tut.pori.contentanalysis.MediaObject.MediaObjectType#METADATA} */
228    public static final String DATA_GROUP_METADATA = "metadata";
229    /** data group for requesting media objects of type {@link service.tut.pori.contentanalysis.MediaObject.MediaObjectType#OBJECT} */
230    public static final String DATA_GROUP_OBJECT = "object";
231    /* confirmation status datagroups */
232    /** data group for requesting media objects with status {@link service.tut.pori.contentanalysis.MediaObject.ConfirmationStatus#BACKEND_REMOVED} */
233  public static final String DATA_GROUP_BACKEND_REMOVED = "backend_removed";
234  /** data group for requesting media objects with status {@link service.tut.pori.contentanalysis.MediaObject.ConfirmationStatus#CANDIDATE} */
235    public static final String DATA_GROUP_CANDIDATE = "candidate";
236    /** data group for requesting media objects with status {@link service.tut.pori.contentanalysis.MediaObject.ConfirmationStatus#USER_CONFIRMED} */
237    public static final String DATA_GROUP_USER_CONFIRMED = "user_confirmed";
238    /** data group for requesting media objects with status {@link service.tut.pori.contentanalysis.MediaObject.ConfirmationStatus#USER_REJECTED} */
239  public static final String DATA_GROUP_USER_REJECTED = "user_rejected";
240  
241  /* service types */
242  /** service id declaration */
243  public static final String SERVICE_ID_PICASA = "1";
244  /** service id declaration */
245  public static final String SERVICE_ID_FSIO = "2";
246  /** service id declaration */
247  public static final String SERVICE_ID_FACEBOOK_JAZZ = "3";
248  /** service id declaration */
249  public static final String SERVICE_ID_FACEBOOK_PHOTO = "4";
250  /** service id declaration */
251  public static final String SERVICE_ID_TWITTER_JAZZ = "5";
252  /** service id declaration */
253  public static final String SERVICE_ID_TWITTER_PHOTO = "6";
254  /** service id declaration */
255  public static final String SERVICE_ID_URL_STORAGE = "7";
256  
257  /* metadata keys */
258  /** metadata key for related task id */
259  public static final String METADATA_RELATED_TASK_ID = "relatedTaskId";
260  
261  /* solr dynamic field datatypes */
262  private static final String SOLR_DATE = "_dt";
263  private static final String SOLR_DOUBLE = "_d";
264  private static final String SOLR_INTEGER = "_i";
265  private static final String SOLR_LONG = "_l";
266  private static final String SOLR_SEARCH_FIELD = "_search";  //field created in mediaObjects solr schema for case insensitive searches (actually value_search)
267  private static final String SOLR_STRING = "_s";
268  private static final String SOLR_TEXT = "_s";
269  private static final String SOLR_TEXT_LIST = "_ss"; //_ss dynamic field for multi valued strings
270  
271  /* solr fields */
272  /** SOLR field declaration */
273  protected static final String SOLR_FIELD_BACKEND_ID = ELEMENT_BACKEND_ID+SOLR_INTEGER;
274  /** SOLR field declaration */
275  protected static final String SOLR_FIELD_CONFIDENCE = ELEMENT_CONFIDENCE+SOLR_DOUBLE;
276  /** SOLR field declaration */
277  protected static final String SOLR_FIELD_CREATOR_OBJECT_ID = ELEMENT_OBJECT_ID+SOLR_STRING;
278  /** SOLR field declaration */
279  protected static final String SOLR_FIELD_CREDITS = ELEMENT_CREDITS+SOLR_STRING;
280  /** SOLR field declaration */
281  protected static final String SOLR_FIELD_DESCRIPTION = ELEMENT_DESCRIPTION+SOLR_TEXT;
282  /** SOLR field declaration */
283  protected static final String SOLR_FIELD_MEDIA_OBJECT_TYPE = ELEMENT_MEDIA_OBJECT_TYPE+SOLR_INTEGER;
284  /** SOLR field declaration */
285  protected static final String SOLR_FIELD_MEDIA_TYPE = ELEMENT_MEDIA_TYPE+SOLR_INTEGER;
286  /** SOLR field declaration */
287  protected static final String SOLR_FIELD_NAME = ELEMENT_NAME+SOLR_STRING;
288  /** SOLR field declaration */
289  protected static final String SOLR_FIELD_RANK = ELEMENT_RANK+SOLR_INTEGER;
290  /** SOLR field declaration */
291  protected static final String SOLR_FIELD_SERVICE_ID = ELEMENT_SERVICE_ID+SOLR_INTEGER;
292  /** SOLR field declaration */
293  protected static final String SOLR_FIELD_STATUS = ELEMENT_STATUS+SOLR_INTEGER;
294  /** SOLR field declaration */
295  protected static final String SOLR_FIELD_TIMECODES = service.tut.pori.contentanalysis.video.Definitions.ELEMENT_TIMECODE+SOLR_TEXT_LIST;
296  /** SOLR field declaration */
297  protected static final String SOLR_FIELD_UPDATED = "updated"+SOLR_DATE;
298  /** SOLR field declaration */
299  protected static final String SOLR_FIELD_USER_ID = core.tut.pori.users.Definitions.ELEMENT_USER_ID+SOLR_LONG;
300  /** SOLR field declaration */
301  protected static final String SOLR_FIELD_VALUE = ELEMENT_VALUE+SOLR_TEXT;
302  /** SOLR field declaration */
303  protected static final String SOLR_FIELD_VALUE_SEARCH = ELEMENT_VALUE+SOLR_SEARCH_FIELD;
304  /** SOLR field declaration */
305  protected static final String SOLR_FIELD_VISIBILITY = ELEMENT_VISIBILITY+SOLR_INTEGER;
306  /** SOLR field declaration */
307  protected static final String SOLR_FIELD_VISUAL_SHAPE_TYPE = ELEMENT_VISUAL_SHAPE_TYPE+SOLR_INTEGER;
308  /** SOLR field declaration */
309  protected static final String SOLR_FIELD_VISUAL_SHAPE_VALUE = ELEMENT_VISUAL_SHAPE+SOLR_STRING;
310
311  /** property file for the service */
312  protected static final String PROPERTY_FILE = "ca.properties";
313  
314  /**
315   * 
316   */
317  private Definitions(){
318    // nothing needed
319  }
320}