assignment = pm.makePersistent(assignment);
String description = assignment.getDescription();
String assignmentId = assignment.getId().toString();
Queue queue = QueueFactory.getDefaultQueue();
String namespace = NamespaceManager.get();
if (namespace == null) {
namespace = "";
}
queue.add(withUrl("/tasks/CreatePlaylist").method(Method.POST)
.param("assignmentId", assignmentId).param("title", title)
.param("description", description).param("channelId", channelId)
.param("ns", namespace));
picasaApiHelper.setAuthSubTokenFromConfig();
if (adminConfigDao.getAdminConfig().getPhotoSubmissionEnabled()
&& picasaApiHelper.isAuthenticated()) {
queue.add(withUrl("/tasks/CreateAlbum").method(Method.POST)
.param("assignmentId", assignmentId).param("title", title)
.param("description", description).param("status", ModerationStatus.APPROVED.toString())
.param("channelId", channelId).param("ns", namespace));
queue.add(withUrl("/tasks/CreateAlbum").method(Method.POST)
.param("assignmentId", assignmentId).param("title", title)
.param("description", description).param("status", ModerationStatus.UNREVIEWED.toString())
.param("channelId", channelId).param("ns", namespace));
queue.add(withUrl("/tasks/CreateAlbum").method(Method.POST)
.param("assignmentId", assignmentId).param("title", title)
.param("description", description).param("status", ModerationStatus.REJECTED.toString())
.param("channelId", channelId).param("ns", namespace));
} else {
log.info("Photo submissions are: " + (adminConfigDao.getAdminConfig().getPhotoSubmissionEnabled() ? "enabled" : "disabled"));