Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop: (32 commits)
  Fallback
  Added support for more ether pad server configurations
  Added support for more ether pad server configurations
  Added support for more ether pad server configurations
  Fixed issue with Feedback updating
  Wrapped Notification Signaling in Promises
  Hot fix for the mysterious issue of proposals not being added in resource space when done inside of a transaction.
  Consider that ballot configurations might be in the campaign and not the component
  Minor logging fix
  Minor logging fix
  Fixing ballot creation not including published proposals
  Added some logging into Ballot Creation Scheduler
  Fixed authorization on endpoints that are meant for members
  Schedulers getConfig method refactor
  Refactor scheduler get time method
  Schedulers timers from local.conf file
  Scheduler time in config file
  Fixes after test
  Set signal result for data
  Add docs
  ...
  • Loading branch information
cdparra committed Nov 6, 2017
2 parents adbbecc + ae10549 commit 6f8ca3a
Show file tree
Hide file tree
Showing 32 changed files with 1,275 additions and 367 deletions.
20 changes: 12 additions & 8 deletions app/controllers/Campaigns.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ public static Result updateCampaign(
Logger.debug("=> " + newCampaignForm.toString());
ResourceSpace rs = Assembly.read(aid).getResources();

Promise.promise(() -> {
/*Promise.promise(() -> {
return NotificationsDelegate.signalNotification(ResourceSpaceTypes.ASSEMBLY, NotificationEventName.UPDATED_CAMPAIGN, rs, campaignOld);
});
});*/

return ok(Json.toJson(campaignOld));
} catch (Exception e) {
Expand Down Expand Up @@ -380,9 +380,13 @@ public static Result createCampaignInAssembly(
CampaignTransfer newCampaign = CampaignDelegate.create(
campaignTransfer, campaignCreator, aid, templates);
Ebean.commitTransaction();
Assembly rs = Assembly.read(aid);
Campaign c = Campaign.read(newCampaign.getCampaignId());

System.out.println("=== AFTER PERSIST == " + c.getAssemblies().size() );

/*Assembly rs = Assembly.read(aid);
Promise.promise(() -> {
try {
NotificationsDelegate.createNotificationEventsByType(ResourceSpaceTypes.CAMPAIGN.toString(), newCampaign.getUuid());
Expand All @@ -392,7 +396,7 @@ public static Result createCampaignInAssembly(
Logger.error("Error when notification creating events for contribution: " + LogActions.exceptionStackTraceToString(e));
}
return NotificationsDelegate.signalNotification(ResourceSpaceTypes.ASSEMBLY, NotificationEventName.NEW_CAMPAIGN, rs, c);
});
});*/

return ok(Json.toJson(newCampaign));
}
Expand Down Expand Up @@ -898,7 +902,7 @@ public static Result createCampaignResource(
@ApiImplicitParams({
@ApiImplicitParam(name = "SESSION_KEY", value = "User's session authentication key", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "Resource Object", value = "The new Resource in JSON", dataType = "models.Resource", paramType = "body")})
@Dynamic(value = "CoordinatorOfAssembly", meta = SecurityModelConstants.ASSEMBLY_RESOURCE_PATH)
@Dynamic(value = "MemberOfAssembly", meta = SecurityModelConstants.ASSEMBLY_RESOURCE_PATH)
public static Result listCampaignResources(
@ApiParam(name = "aid", value = "Assembly ID") Long aid,
@ApiParam(name = "cid", value = "Campaign ID") Long campaignId,
Expand Down Expand Up @@ -984,7 +988,7 @@ public String contentType() {
@ApiImplicitParams({
@ApiImplicitParam(name = "SESSION_KEY", value = "User's session authentication key", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "Resource Object", value = "The new Resource in JSON", dataType = "models.Resource", paramType = "body")})
@Dynamic(value = "CoordinatorOfAssembly", meta = SecurityModelConstants.ASSEMBLY_RESOURCE_PATH)
@Dynamic(value = "MemberOfAssembly", meta = SecurityModelConstants.ASSEMBLY_RESOURCE_PATH)
public static Result listCampaignComponents(
@ApiParam(name = "aid", value = "Assembly ID") Long aid,
@ApiParam(name = "cid", value = "Campaign ID") Long campaignId,
Expand Down Expand Up @@ -1560,9 +1564,9 @@ public static Result updateCampaignDescription(
Logger.debug("=> " + newCampaignForm.toString());
Assembly rs = Assembly.read(aid);
Campaign c = Campaign.read(loadedCampaign.getCampaignId());
Promise.promise(() -> {
/*Promise.promise(() -> {
return NotificationsDelegate.signalNotification(ResourceSpaceTypes.ASSEMBLY, NotificationEventName.UPDATED_CAMPAIGN, rs, c);
});
});*/

return ok(Json.toJson(loadedCampaign));
}
Expand Down
223 changes: 157 additions & 66 deletions app/controllers/Contributions.java

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions app/controllers/Memberships.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import be.objectify.deadbolt.java.actions.Restrict;
import be.objectify.deadbolt.java.actions.SubjectPresent;

import com.amazonaws.services.simpleemail.model.NotificationType;
import com.avaje.ebean.Ebean;
import com.feth.play.module.pa.PlayAuthenticate;

Expand Down Expand Up @@ -109,13 +110,13 @@ public static Result createMemberShip(User requestor, String targetCollection,
if (targetCollection.toUpperCase().equals("GROUP")) {
WorkingGroup rs = WorkingGroup.read(targetCollectionId);
F.Promise.promise(() -> {
return NotificationsDelegate.signalNotification(ResourceSpaceTypes.WORKING_GROUP, NotificationEventName.MEMBER_JOINED, rs, m);
return NotificationsDelegate.signalNotification(ResourceSpaceTypes.WORKING_GROUP, NotificationEventName.MEMBER_JOINED, rs, m, SubscriptionTypes.REGULAR, null);
});
}
if (targetCollection.toUpperCase().equals("ASSEMBLY")) {
Assembly rs = Assembly.read(targetCollectionId);
F.Promise.promise(() -> {
return NotificationsDelegate.signalNotification(ResourceSpaceTypes.ASSEMBLY, NotificationEventName.MEMBER_JOINED, rs, m);
return NotificationsDelegate.signalNotification(ResourceSpaceTypes.ASSEMBLY, NotificationEventName.MEMBER_JOINED, rs, m, SubscriptionTypes.REGULAR, null);
});
}
Ebean.commitTransaction();
Expand Down
24 changes: 8 additions & 16 deletions app/controllers/Spaces.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@


import static play.data.Form.form;

import enums.*;
import http.Headers;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
Expand Down Expand Up @@ -78,16 +80,6 @@
import com.feth.play.module.pa.PlayAuthenticate;

import delegates.NotificationsDelegate;
import enums.BallotCandidateTypes;
import enums.BallotStatus;
import enums.ContributionStatus;
import enums.ContributionTypes;
import enums.EntityTypes;
import enums.NotificationEventName;
import enums.ResourceSpaceAssociationTypes;
import enums.ResourceSpaceTypes;
import enums.ResponseStatus;
import enums.ThemeTypes;

@Api(value = "09 space: resource space management", description = "Resource space management")
@With(Headers.class)
Expand Down Expand Up @@ -843,13 +835,13 @@ public static Result updateSpaceBallot(@ApiParam(name = "sid", value = "Space ID
return badRequest(Json.toJson(responseBody));
}
ballot.update();
F.Promise.promise(() -> {
/*F.Promise.promise(() -> {
return NotificationsDelegate.signalNotification(
resourceSpace.getType(),
NotificationEventName.UPDATED_VOTING_BALLOT,
resourceSpace,
resourceSpace);
});
});*/
return ok(Json.toJson(ballot));
}
}
Expand Down Expand Up @@ -1067,7 +1059,7 @@ public static Result createSpaceBallot(@ApiParam(name = "sid", value = "Space ID
}

F.Promise.promise(() -> {
return NotificationsDelegate.signalNotification(resourceSpace.getType(), NotificationEventName.NEW_VOTING_BALLOT, resourceSpace, resourceSpace);
return NotificationsDelegate.signalNotification(resourceSpace.getType(), NotificationEventName.NEW_VOTING_BALLOT, resourceSpace, resourceSpace, SubscriptionTypes.REGULAR, null);
});

return ok(Json.toJson(newBallot));
Expand Down Expand Up @@ -1916,12 +1908,12 @@ public static Result updateSpaceGroup(
responseBody.setNewResourceURL(GlobalData.GROUP_BASE_PATH + "/"
+ newWorkingGroup.getGroupId());

F.Promise.promise(() -> {
/* F.Promise.promise(() -> {
return NotificationsDelegate.signalNotification(
ResourceSpaceTypes.WORKING_GROUP,
NotificationEventName.UPDATED_WORKING_GROUP,
resourceSpace, newWorkingGroup);
});
});*/

return ok(Json.toJson(responseBody));
}
Expand Down Expand Up @@ -1985,7 +1977,7 @@ public static Result updateSpaceCampaign(
resourceSpace.getCampaigns().add(updatedCampaign);
resourceSpace.update();
F.Promise.promise(() -> {
return NotificationsDelegate.signalNotification(ResourceSpaceTypes.ASSEMBLY, NotificationEventName.UPDATED_CAMPAIGN, resourceSpace, updatedCampaign);
return NotificationsDelegate.signalNotification(ResourceSpaceTypes.ASSEMBLY, NotificationEventName.UPDATED_CAMPAIGN, resourceSpace, updatedCampaign, SubscriptionTypes.REGULAR, null);
});

return ok(Json.toJson(updatedCampaign));
Expand Down
Loading

0 comments on commit 6f8ca3a

Please sign in to comment.