ValidationCycleRelation link = cycle.getContext();
aStudy.addRelation(link);
+ getValidationCycleDAO().flush();
aStudyDTO.getAllRelations().add(link); // RKV
validactor.put(cname, link.getTo()); // Replaces the cycle if exists as default,
* @return true if reindexing succeeded
*/
private boolean updateKnowledgeElementsIndex(final Study aStudy) {
- // boolean isOk = false;
- // try {
- // IndexService lucin = getIndex();
- //
- // for (Iterator<Scenario> i = aStudy.getScenariiList().iterator(); i
- // .hasNext();) {
- // Scenario scene = i.next();
- // for (Iterator<KnowledgeElement> j = scene
- // .getAllKnowledgeElements().iterator(); j.hasNext();) {
- // KnowledgeElement kelm = j.next();
- // lucin.update(kelm);
- // }
- // }
- // isOk = true;
- // } catch (Exception error) {
- // LOG.error("Unable to re-index Knowledge Elements, reason:",
- // error);
- // }
- // return isOk;
+// boolean isOk = false;
+// try {
+// IndexService lucin = getIndex();
+// for(Scenario scenario : aStudy.getScenariiList()) {
+// for (KnowledgeElement element : scenario.getAllKnowledgeElements()) {
+// lucin.update(element);
+// }
+// }
+// isOk = true;
+// } catch (Exception error) {
+// LOG.error("Unable to re-index Knowledge Elements, reason:",
+// error);
+// }
+// return isOk;
return true;
}
public List<UserDTO> getReaders(final long studyId) throws InvalidParameterException {
Study aStudy = selectStudy(studyId);
if(aStudy == null){
- throw new InvalidParameterException("studyId", String.valueOf(studyId));
+ throw new InvalidParameterException(PARAM_STUDY_ID, String.valueOf(studyId));
}
List<Relation> relations = aStudy.getRelations(ReaderRelation.class);
List<UserDTO> result = new ArrayList<UserDTO>();
public boolean addReader(final long studyId, final long userId) throws InvalidParameterException {
Study aStudy = selectStudy(studyId);
if(aStudy == null){
- throw new InvalidParameterException("studyId", String.valueOf(studyId));
+ throw new InvalidParameterException(PARAM_STUDY_ID, String.valueOf(studyId));
}
User user = _userService.selectUser(userId);
if(user == null){
public boolean removeReader(final long studyId, final long userId) throws InvalidParameterException {
Study aStudy = selectStudy(studyId);
if(aStudy == null){
- throw new InvalidParameterException("studyId", String.valueOf(studyId));
+ throw new InvalidParameterException(PARAM_STUDY_ID, String.valueOf(studyId));
}
User user = _userService.selectUser(userId);
if(user == null){