Commit 509f92ad authored by Elias Englmeier's avatar Elias Englmeier
Browse files

more workflow

parent f24ab260
......@@ -113,10 +113,6 @@ public interface IdeasLocalService extends BaseLocalService,
/**
* Creates a new Idea using the supplied parameters.
* created date, modified date and user name are set automatically.
*
* @param videoFileRef
* @param videoUrl
*/
public Ideas createIdeasWithAutomatedDbId(java.lang.String title,
long userId, long groupId, long category, java.lang.String titleImgRef,
......@@ -126,6 +122,22 @@ public interface IdeasLocalService extends BaseLocalService,
java.lang.String pageUrl, long layoutRef, long videoFileRef,
java.lang.String videoUrl, ReviewStatus reviewStatus);
/**
* This method is used to create a intermediate Idea with less information in the first step of the input process.
*
* @param userId
* @param groupId
* @param title
* @return
*/
public Ideas createIdeasWithAutomatedDbId(long userId, long projectRef,
long groupId, long layoutRef, java.lang.String title,
java.lang.String solution, java.lang.String description,
java.lang.String importance, java.lang.String targetAudience,
java.lang.String tags, java.lang.String goal, java.lang.String pageUrl,
double latitude, double longitude, ReviewStatus reviewStatus,
boolean isVisibleOnMap);
/**
* Deletes the ideas from the database. Also notifies the appropriate model listeners.
*
......@@ -395,6 +407,8 @@ public interface IdeasLocalService extends BaseLocalService,
public long dynamicQueryCount(DynamicQuery dynamicQuery,
Projection projection);
public void approveIdea(long ideasId);
/**
* persists the new Idea and performs some checks e.g. if the entry is a duplicate it won't be inserted.
*
......@@ -402,4 +416,6 @@ public interface IdeasLocalService extends BaseLocalService,
*/
@Indexable(type = IndexableType.REINDEX)
public void persistIdeasAndPerformTypeChecks(Ideas idea);
public void rejectIdea(long IdeasId);
}
\ No newline at end of file
......@@ -106,10 +106,6 @@ public class IdeasLocalServiceUtil {
/**
* Creates a new Idea using the supplied parameters.
* created date, modified date and user name are set automatically.
*
* @param videoFileRef
* @param videoUrl
*/
public static ideaService.model.Ideas createIdeasWithAutomatedDbId(
java.lang.String title, long userId, long groupId, long category,
......@@ -127,6 +123,29 @@ public class IdeasLocalServiceUtil {
reviewStatus);
}
/**
* This method is used to create a intermediate Idea with less information in the first step of the input process.
*
* @param userId
* @param groupId
* @param title
* @return
*/
public static ideaService.model.Ideas createIdeasWithAutomatedDbId(
long userId, long projectRef, long groupId, long layoutRef,
java.lang.String title, java.lang.String solution,
java.lang.String description, java.lang.String importance,
java.lang.String targetAudience, java.lang.String tags,
java.lang.String goal, java.lang.String pageUrl, double latitude,
double longitude, ideasService.service.enums.ReviewStatus reviewStatus,
boolean isVisibleOnMap) {
return getService()
.createIdeasWithAutomatedDbId(userId, projectRef, groupId,
layoutRef, title, solution, description, importance,
targetAudience, tags, goal, pageUrl, latitude, longitude,
reviewStatus, isVisibleOnMap);
}
/**
* Deletes the ideas from the database. Also notifies the appropriate model listeners.
*
......@@ -459,6 +478,10 @@ public class IdeasLocalServiceUtil {
return getService().dynamicQueryCount(dynamicQuery, projection);
}
public static void approveIdea(long ideasId) {
getService().approveIdea(ideasId);
}
/**
* persists the new Idea and performs some checks e.g. if the entry is a duplicate it won't be inserted.
*
......@@ -469,6 +492,10 @@ public class IdeasLocalServiceUtil {
getService().persistIdeasAndPerformTypeChecks(idea);
}
public static void rejectIdea(long IdeasId) {
getService().rejectIdea(IdeasId);
}
public static IdeasLocalService getService() {
return _serviceTracker.getService();
}
......
......@@ -106,10 +106,6 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
/**
* Creates a new Idea using the supplied parameters.
* created date, modified date and user name are set automatically.
*
* @param videoFileRef
* @param videoUrl
*/
@Override
public ideaService.model.Ideas createIdeasWithAutomatedDbId(
......@@ -127,6 +123,29 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
reviewStatus);
}
/**
* This method is used to create a intermediate Idea with less information in the first step of the input process.
*
* @param userId
* @param groupId
* @param title
* @return
*/
@Override
public ideaService.model.Ideas createIdeasWithAutomatedDbId(long userId,
long projectRef, long groupId, long layoutRef, java.lang.String title,
java.lang.String solution, java.lang.String description,
java.lang.String importance, java.lang.String targetAudience,
java.lang.String tags, java.lang.String goal, java.lang.String pageUrl,
double latitude, double longitude,
ideasService.service.enums.ReviewStatus reviewStatus,
boolean isVisibleOnMap) {
return _ideasLocalService.createIdeasWithAutomatedDbId(userId,
projectRef, groupId, layoutRef, title, solution, description,
importance, targetAudience, tags, goal, pageUrl, latitude,
longitude, reviewStatus, isVisibleOnMap);
}
/**
* Deletes the ideas from the database. Also notifies the appropriate model listeners.
*
......@@ -486,6 +505,11 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
return _ideasLocalService.dynamicQueryCount(dynamicQuery, projection);
}
@Override
public void approveIdea(long ideasId) {
_ideasLocalService.approveIdea(ideasId);
}
/**
* persists the new Idea and performs some checks e.g. if the entry is a duplicate it won't be inserted.
*
......@@ -496,6 +520,11 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
_ideasLocalService.persistIdeasAndPerformTypeChecks(idea);
}
@Override
public void rejectIdea(long IdeasId) {
_ideasLocalService.rejectIdea(IdeasId);
}
@Override
public IdeasLocalService getWrappedService() {
return _ideasLocalService;
......
......@@ -80,18 +80,38 @@ public class IdeasLocalServiceImpl extends IdeasLocalServiceBaseImpl {
if(role.equals(RoleConstants.ADMINISTRATOR) || role.equals(RoleConstants.PORTAL_CONTENT_REVIEWER)){
result.add(i);
}
}
else if((role.equals(RoleConstants.USER) && i.getUserId() == userId) || i.getReviewStatus().equals(ReviewStatus.ACCEPTED.getReviewStatusDescription())){
else if(role.equals(RoleConstants.USER) && i.getUserId() == userId){
result.add(i);
}
else if (i.getReviewStatus().equals(ReviewStatus.ACCEPTED.getReviewStatusDescription())){
result.add(i);
}
}
}
return result;
}
public void approveIdea(long ideasId){
try {
Ideas i = IdeasUtil.findByPrimaryKey(ideasId);
i.setReviewStatus(ReviewStatus.ACCEPTED.getReviewStatusDescription());
i.persist();
} catch (NoSuchIdeasException e) {
e.printStackTrace();
}
}
public void rejectIdea(long IdeasId){
try {
Ideas i = IdeasUtil.findByPrimaryKey(IdeasId);
i.setReviewStatus(ReviewStatus.REJECTED.getReviewStatusDescription());
i.persist();
} catch (NoSuchIdeasException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* Gets all Ideas that reference layoutRef
*/
......@@ -144,9 +164,6 @@ public class IdeasLocalServiceImpl extends IdeasLocalServiceBaseImpl {
/**
* Creates a new Idea using the supplied parameters.
* created date, modified date and user name are set automatically.
* @param videoFileRef
* @param videoUrl
*/
public Ideas createIdeasWithAutomatedDbId(String title,long userId,long groupId,long category, String titleImgRef,String shortDescription,
String description,double latitude, double longitude, boolean published, boolean showOnMap,
......@@ -181,6 +198,49 @@ public class IdeasLocalServiceImpl extends IdeasLocalServiceBaseImpl {
return nextIdea;
}
/**
* This method is used to create a intermediate Idea with less information in the first step of the input process.
* @param userId
* @param groupId
* @param title
* @return
*/
public Ideas createIdeasWithAutomatedDbId(long userId,long projectRef, long groupId,long layoutRef, String title,String solution, String description, String importance,
String targetAudience, String tags, String goal,String pageUrl, double latitude, double longitude, ReviewStatus reviewStatus, boolean isVisibleOnMap){
int nextDbId = (int)CounterLocalServiceUtil.increment(Ideas.class.getName());
Ideas nextIdea = IdeasLocalServiceUtil.createIdeas(nextDbId);
nextIdea.setUserId(userId);
nextIdea.setProjectRef(projectRef);
nextIdea.setGroupId(groupId);
nextIdea.setPageUrl(pageUrl);
nextIdea.setLayoutRef(layoutRef);
nextIdea.setTitle(title);
nextIdea.setDescription(description);
nextIdea.setImportance(importance);
nextIdea.setTargetAudience(targetAudience);
nextIdea.setSolution(solution);
nextIdea.setTags(tags);
nextIdea.setGoal(goal);
nextIdea.setPageUrl(pageUrl);
nextIdea.setLatitude(latitude);
nextIdea.setLongitude(longitude);
nextIdea.setReviewStatus(reviewStatus.getReviewStatusDescription());
nextIdea.setIsVisibleOnMap(isVisibleOnMap);
try {
User user = UserLocalServiceUtil.getUser(userId);
nextIdea.setUserName(user.getScreenName());
} catch (PortalException e) {
e.printStackTrace();
}
return nextIdea;
}
/**
* persists the new Idea and performs some checks e.g. if the entry is a duplicate it won't be inserted.
* @param idea
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment