Commit 371373e2 authored by Elias Englmeier's avatar Elias Englmeier
Browse files

helper functions

parent 509f92ad
......@@ -407,6 +407,12 @@ public interface IdeasLocalService extends BaseLocalService,
public long dynamicQueryCount(DynamicQuery dynamicQuery,
Projection projection);
public void addTitlePictureToExistingIdea(long ideasId, long pictureId,
java.lang.String pictureRef);
public void addVideoToExistingIdea(long ideasId, long videoId,
java.lang.String videoRef);
public void approveIdea(long ideasId);
/**
......@@ -417,5 +423,5 @@ public interface IdeasLocalService extends BaseLocalService,
@Indexable(type = IndexableType.REINDEX)
public void persistIdeasAndPerformTypeChecks(Ideas idea);
public void rejectIdea(long IdeasId);
public void rejectIdea(long ideasId);
}
\ No newline at end of file
......@@ -478,6 +478,17 @@ public class IdeasLocalServiceUtil {
return getService().dynamicQueryCount(dynamicQuery, projection);
}
public static void addTitlePictureToExistingIdea(long ideasId,
long pictureId, java.lang.String pictureRef) {
getService()
.addTitlePictureToExistingIdea(ideasId, pictureId, pictureRef);
}
public static void addVideoToExistingIdea(long ideasId, long videoId,
java.lang.String videoRef) {
getService().addVideoToExistingIdea(ideasId, videoId, videoRef);
}
public static void approveIdea(long ideasId) {
getService().approveIdea(ideasId);
}
......@@ -492,8 +503,8 @@ public class IdeasLocalServiceUtil {
getService().persistIdeasAndPerformTypeChecks(idea);
}
public static void rejectIdea(long IdeasId) {
getService().rejectIdea(IdeasId);
public static void rejectIdea(long ideasId) {
getService().rejectIdea(ideasId);
}
public static IdeasLocalService getService() {
......
......@@ -505,6 +505,19 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
return _ideasLocalService.dynamicQueryCount(dynamicQuery, projection);
}
@Override
public void addTitlePictureToExistingIdea(long ideasId, long pictureId,
java.lang.String pictureRef) {
_ideasLocalService.addTitlePictureToExistingIdea(ideasId, pictureId,
pictureRef);
}
@Override
public void addVideoToExistingIdea(long ideasId, long videoId,
java.lang.String videoRef) {
_ideasLocalService.addVideoToExistingIdea(ideasId, videoId, videoRef);
}
@Override
public void approveIdea(long ideasId) {
_ideasLocalService.approveIdea(ideasId);
......@@ -521,8 +534,8 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
}
@Override
public void rejectIdea(long IdeasId) {
_ideasLocalService.rejectIdea(IdeasId);
public void rejectIdea(long ideasId) {
_ideasLocalService.rejectIdea(ideasId);
}
@Override
......
......@@ -101,9 +101,9 @@ public class IdeasLocalServiceImpl extends IdeasLocalServiceBaseImpl {
}
}
public void rejectIdea(long IdeasId){
public void rejectIdea(long ideasId){
try {
Ideas i = IdeasUtil.findByPrimaryKey(IdeasId);
Ideas i = IdeasUtil.findByPrimaryKey(ideasId);
i.setReviewStatus(ReviewStatus.REJECTED.getReviewStatusDescription());
i.persist();
} catch (NoSuchIdeasException e) {
......@@ -112,6 +112,31 @@ public class IdeasLocalServiceImpl extends IdeasLocalServiceBaseImpl {
}
}
public void addTitlePictureToExistingIdea(long ideasId, long pictureId, String pictureRef){
try {
Ideas i = IdeasUtil.findByPrimaryKey(ideasId);
i.setTitleImgRef(pictureRef);
i.setTitleFileRef(pictureId);
i.persist();
} catch (NoSuchIdeasException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void addVideoToExistingIdea(long ideasId, long videoId, String videoRef){
try {
Ideas i = IdeasUtil.findByPrimaryKey(ideasId);
i.setVideoFileRef(videoId);
i.setVideoUrl(videoRef);
i.persist();
} catch (NoSuchIdeasException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* Gets all Ideas that reference layoutRef
*/
......
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