public AnnotationVO(String text, AnnotationService.EntityType type, String uuid) { this(); setAnnotation(text); setEntityType(type); setEntityUuid(uuid); }
public static AnnotationResponse createAnnotationResponse(AnnotationVO annotation) { AnnotationResponse response = new AnnotationResponse(); response.setUuid(annotation.getUuid()); response.setEntityType(annotation.getEntityType()); response.setEntityUuid(annotation.getEntityUuid()); response.setAnnotation(annotation.getAnnotation()); response.setUserUuid(annotation.getUserUuid()); response.setCreated(annotation.getCreated()); response.setRemoved(annotation.getRemoved()); response.setObjectName("annotation"); return response; }
public AnnotationDaoImpl() { super(); AnnotationSearchByType = createSearchBuilder(); AnnotationSearchByType.and("entityType", AnnotationSearchByType.entity().getEntityType(), SearchCriteria.Op.EQ); AnnotationSearchByType.done(); AnnotationSearchByTypeAndUuid = createSearchBuilder(); AnnotationSearchByTypeAndUuid.and("entityType", AnnotationSearchByTypeAndUuid.entity().getEntityType(), SearchCriteria.Op.EQ); AnnotationSearchByTypeAndUuid.and("entityUuid", AnnotationSearchByTypeAndUuid.entity().getEntityUuid(), SearchCriteria.Op.EQ); AnnotationSearchByTypeAndUuid.done(); }
public AnnotationResponse addAnnotation(String text, EntityType type, String uuid) { CallContext ctx = CallContext.current(); String userUuid = ctx.getCallingUserUuid(); AnnotationVO annotation = new AnnotationVO(text, type, uuid); annotation.setUserUuid(userUuid); annotation = annotationDao.persist(annotation); return createAnnotationResponse(annotation); }
@Override @ActionEvent(eventType = EventTypes.EVENT_ANNOTATION_REMOVE, eventDescription = "removing an annotation on an entity") public AnnotationResponse removeAnnotation(RemoveAnnotationCmd removeAnnotationCmd) { String uuid = removeAnnotationCmd.getUuid(); if(LOGGER.isDebugEnabled()) { LOGGER.debug("marking annotation removed: " + uuid); } AnnotationVO annotation = annotationDao.findByUuid(uuid); annotationDao.remove(annotation.getId()); return createAnnotationResponse(annotation); }
public AnnotationVO(String text, String type, String uuid) { this(); setAnnotation(text); setEntityType(type); setEntityUuid(uuid); } // access