Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/controllers/CampaignController.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,18 @@ public static Result editCampaign(String id) throws ClassNotFoundException, Json
campaign.setIsPublic(json.get("isPublic").asBoolean());
}

if( json.has( "hideRating" )) {
campaign.setHideRating( json.get( "hideRating").asBoolean());
}
if( json.has( "hideComments" )) {
campaign.setHideComments( json.get( "hideComments").asBoolean());
}
if( json.has( "hasPublicResults" )) {
campaign.setHasPublicResults( json.get( "hasPublicResults").asBoolean());
}



if (json.has("vocabularyMapping")) {
campaign.setVocabularyMapping(newCampaign.getVocabularyMapping());
}
Expand Down
8 changes: 4 additions & 4 deletions app/db/RecordResourceDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ public List<RecordResource> getByCollectionNoContribution(List<ContextData<Conte
List<ObjectId> recordIds = (List<ObjectId>) CollectionUtils.collect(collectedResources,
new BeanToPropertyValueTransformer("target.recordId"));
q.field("_id").in(recordIds);
q.or(q.criteria("administrative.annotators." + userId).doesNotExist(),
q.criteria("administrative.annotators." + userId).lessThan(1));
q.or(q.criteria("annotationIds").doesNotExist(),
q.criteria("annotationIds").sizeEq(0));
return this.find(q).asList();
} catch (Exception e) {
return new ArrayList<RecordResource>();
Expand All @@ -312,8 +312,8 @@ public List<RecordResource> getByCollectionFilterOnlyContributedItems(List<Conte
List<ObjectId> recordIds = (List<ObjectId>) CollectionUtils.collect(collectedResources,
new BeanToPropertyValueTransformer("target.recordId"));
q.field("_id").in(recordIds);
q.or(q.criteria("administrative.annotators." + userId).exists(),
q.criteria("administrative.annotators." + userId).greaterThan(0));
q.and(q.criteria("annotationIds").exists(),
q.criteria("annotationIds").not().sizeEq(0));
return this.find(q).asList();
} catch (Exception e) {
return new ArrayList<RecordResource>();
Expand Down
29 changes: 28 additions & 1 deletion app/model/Campaign.java
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,11 @@ public void setLongDescription(String longDescription) {
private Literal disclaimer;

private boolean isPublic;


private boolean hasPublicResults;
private boolean hideComments;
private boolean hideRating;

@JsonSerialize(using = Serializer.ObjectIdArraySerializer.class)
// @JsonDeserialize(using = Deserializer.ObjectIdArraySerializer.class)
private Set<ObjectId> creators = new HashSet<ObjectId>();
Expand Down Expand Up @@ -546,6 +550,29 @@ public void setIsPublic(boolean aPublic) {
isPublic = aPublic;
}

public boolean getHideComments() {
return this.hideComments;
}

public void setHideComments( boolean hideComments ) {
this.hideComments = hideComments;
}

public boolean getHasPublicResults( ) {
return this.hasPublicResults;
}

public void setHasPublicResults( boolean hasPublicResults ) {
this.hasPublicResults = hasPublicResults;
}

public boolean getHideRating() {
return this.hideRating;
}
public void setHideRating( boolean hideRating ) {
this.hideRating = hideRating;
}

public Boolean getActive() {
Date today = new Date();
return ( (today.compareTo(this.startDate)>0) && (today.compareTo(this.endDate)<0) );
Expand Down
Loading