14 package cz.vutbr.fit.knot.annotations.comet.protocolV2_0.P2Trix;
23 import java.util.ArrayList;
24 import java.util.Iterator;
25 import java.util.logging.Level;
26 import java.util.logging.Logger;
40 super(destinationUri);
159 ArrayList<BaseAttribute> atList =
new ArrayList<BaseAttribute>();
160 ArrayList<EntityAdditionalAttribute> additionalAttributes =
new ArrayList<EntityAdditionalAttribute>();
164 int langNum = requestInfo.getSession().getLanguageNum();
165 int lod = requestInfo.getSession().getProtocolLOD();
167 String info =
"<attribute annotationUri=\"" + annot.getURIV2();
172 info +=
"\" name=\"" +
name;
174 info +=
"\" invalidProperty=\"name\"/>";
178 Logger.getLogger(P2EntityTrix.class.getName()).log(Level.SEVERE, null);
186 newAtt.setName(
name);
188 newAtt.setRefAnnotation(annot);
198 Integer newPriority = null;
201 newPriority = Integer.parseInt(
priority);
202 }
catch(NumberFormatException ex){
203 int langNum = requestInfo.getSession().getLanguageNum();
204 int lod = requestInfo.getSession().getProtocolLOD();
206 String info =
"<attribute annotationUri=\"" + annot.getURIV2();
211 info +=
"\" name=\"" +
name;
213 info +=
"\" invalidProperty=\"priority\"/>";
217 Logger.getLogger(P2EntityTrix.class.getName()).log(Level.SEVERE, null, ex);
224 newAtt.setPriority(newPriority);
226 newAtt.setPriority(sparePriority);
229 Iterator<P2EntityAdditionalTrix> addAttIt = entityAdditionalTrixAL.iterator();
230 while(addAttIt.hasNext()){
232 additionalAttributes.add(tmpAtt);
235 newAtt.setEntityAdditionalAttributes(additionalAttributes);
250 newAtt.setName(trixAtt.getEntityAttributeName());
251 newAtt.setStringValue(trixAtt.getValue());
252 newAtt.setRefEntityAttribute(entity);
255 int typeIndex = Constants.SIMPLE_TYPES_URIS_FOR_ENT_AD_AT.indexOf(trixAtt.getTypeUri());
257 newAtt.setType(Constants.SIMPLE_TYPES_FOR_ENT_AD_AT.get(typeIndex));
260 String msg =
"Unknown type of entity additional attribute: " + trixAtt.getTypeUri();
261 Logger.getLogger(P2EntityTrix.class.getName()).log(Level.SEVERE, msg);
266 String msg =
"Type of entity additional attribute is missing.";
267 Logger.getLogger(P2EntityTrix.class.getName()).log(Level.SEVERE, msg);
275 Iterator<P2EntityAdditionalTrix> it = entityAdditionalTrixAL.iterator();
276 String tmpName = null;
280 tmpName = tmp.getValue();
281 entityAdditionalTrixAL.remove(tmp);
290 Iterator<P2EntityAdditionalTrix> it = entityAdditionalTrixAL.iterator();
291 String tmpImage = null;
295 tmpImage = tmp.getValue();
296 entityAdditionalTrixAL.remove(tmp);
305 Iterator<P2EntityAdditionalTrix> it = entityAdditionalTrixAL.iterator();
306 String tmpDesc = null;
310 tmpDesc = tmp.getValue();
311 entityAdditionalTrixAL.remove(tmp);
void setEntityUri(String entityUri)
Class that represents entity additional attribute trix triple.
static final int LOG_LEVEL_ALL_ERRORS
Class that represents entity trix triple.
String searchEntityDescription()
void setImageUri(String imageUri)
Additional attribute of entity in annotation attribute.
EntityAdditionalAttribute makeEntityAdditionalAttribute(P2EntityAdditionalTrix trixAtt, EntityAttribute entity)
void setDescription(String description)
static final int ERROR_26_ATTRIBUTE_MALFORMED
Class representing vocabulary entity attribute.
String searchEntityName()
P2EntityTrix(String destinationUri)
ArrayList< P2EntityAdditionalTrix > getEntityAdditionalTrixAL()
Base class representing attribute of annotation.
static final int LOG_LEVEL
void setEntityName(String entityName)
static final String DEFAULT_SIMPLE_TYPE_FOR_ENT_AD_AT
String searchEntityImage()
void setEntityType(String entityType)
static final ArrayList< String > SIMPLE_TYPES_FOR_ENT_AD_AT
ArrayList< BaseAttribute > trixToAnnotAtt(Annotation annot, RequestInfo requestInfo, Integer sparePriority)
ArrayList< P2EntityAdditionalTrix > entityAdditionalTrixAL
Processed informations about client request.
Class that represents base trix triple.
Class responsible for localised strings.
String getEntityAttributeName()
void setEntityAdditionalTrixAL(ArrayList< P2EntityAdditionalTrix > entityAdditionalTrixAL)
Class representing annotation.