Commit 0689cf89 authored by Elias Englmeier's avatar Elias Englmeier
Browse files

added helper function to get all accepted ideas

parent faf959e5
......@@ -22,7 +22,6 @@ import com.liferay.portal.kernel.util.WebKeys;
import MapModule.constants.MapModulePortletKeys;
import ideaService.model.Ideas;
import ideaService.service.IdeasLocalServiceUtil;
import ideaService.service.persistence.IdeasUtil;
import projectService.service.ProjectLocalServiceUtil;
/**
......@@ -81,7 +80,7 @@ public class MapModulePortlet extends MVCPortlet {
JSONFactoryUtil.looseSerializeDeep(tmp));
}
else{
renderRequest.setAttribute("allIdeas",JSONFactoryUtil.looseSerializeDeep(IdeasUtil.findAll()));
renderRequest.setAttribute("allIdeas",JSONFactoryUtil.looseSerializeDeep(IdeasLocalServiceUtil.getAllAccpetedIdeas()));
}
super.render(renderRequest, renderResponse);
......
......@@ -13,6 +13,6 @@
##
build.namespace=ANALYSIS
build.number=78
build.date=1516194244914
build.number=79
build.date=1516699209154
build.auto.upgrade=true
\ No newline at end of file
......@@ -13,6 +13,6 @@
##
build.namespace=GB
build.number=99
build.date=1516194249453
build.number=100
build.date=1516699213602
build.auto.upgrade=true
\ No newline at end of file
......@@ -275,6 +275,9 @@ public interface IdeasLocalService extends BaseLocalService,
public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
int end, OrderByComparator<T> orderByComparator);
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public List<Ideas> getAllAccpetedIdeas();
/**
* @param projectId the project id
* @return all Ideas with projectRef == projectId
......@@ -294,6 +297,7 @@ public interface IdeasLocalService extends BaseLocalService,
/**
* gets all ideas with published true
*/
@java.lang.Deprecated
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public List<Ideas> getIdeasByIsPublished(boolean published);
......
......@@ -316,6 +316,10 @@ public class IdeasLocalServiceUtil {
.dynamicQuery(dynamicQuery, start, end, orderByComparator);
}
public static java.util.List<ideaService.model.Ideas> getAllAccpetedIdeas() {
return getService().getAllAccpetedIdeas();
}
/**
* @param projectId the project id
* @return all Ideas with projectRef == projectId
......@@ -339,6 +343,7 @@ public class IdeasLocalServiceUtil {
/**
* gets all ideas with published true
*/
@Deprecated
public static java.util.List<ideaService.model.Ideas> getIdeasByIsPublished(
boolean published) {
return getService().getIdeasByIsPublished(published);
......
......@@ -330,6 +330,11 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
orderByComparator);
}
@Override
public java.util.List<ideaService.model.Ideas> getAllAccpetedIdeas() {
return _ideasLocalService.getAllAccpetedIdeas();
}
/**
* @param projectId the project id
* @return all Ideas with projectRef == projectId
......@@ -355,6 +360,7 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
/**
* gets all ideas with published true
*/
@Deprecated
@Override
public java.util.List<ideaService.model.Ideas> getIdeasByIsPublished(
boolean published) {
......
......@@ -181,6 +181,18 @@ public class IdeasLocalServiceImpl extends IdeasLocalServiceBaseImpl {
return result;
}
public List<Ideas> getAllAccpetedIdeas(){
List<Ideas> allIdeas = IdeasUtil.findAll();
ArrayList<Ideas> result = new ArrayList<Ideas>();
for(Ideas i : allIdeas){
if(i.getReviewStatus().equals(ReviewStatus.ACCEPTED.getReviewStatusDescription())){
result.add(i);
}
}
return result;
}
@Indexable(type = IndexableType.DELETE)
public Ideas deleteIdeasAndLayoutOnCascade(long id){
try {
......@@ -521,6 +533,8 @@ public class IdeasLocalServiceImpl extends IdeasLocalServiceBaseImpl {
/**
* gets all ideas with published true
*/
@Deprecated
//TODO remove published from service xml
public List<Ideas> getIdeasByIsPublished(boolean published){
ArrayList<Ideas> result = new ArrayList<Ideas>();
for(Ideas i: IdeasUtil.findAll()){
......
......@@ -13,6 +13,6 @@
##
build.namespace=IDEA
build.number=232
build.date=1516194254360
build.number=233
build.date=1516699218468
build.auto.upgrade=true
\ No newline at end of file
......@@ -111,7 +111,7 @@ public class ProjectModelImpl extends BaseModelImpl<Project>
TABLE_COLUMNS_MAP.put("titleFileRef", Types.BIGINT);
}
public static final String TABLE_SQL_CREATE = "create table PROJECT_Project (uuid_ VARCHAR(75) null,projectId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,titleImgRef VARCHAR(500) null,projectToken VARCHAR(75) null,title VARCHAR(50) null,description VARCHAR(300) null,isPublished BOOLEAN,pageUrl VARCHAR(75) null,layoutRef LONG,titleFileRef LONG)";
public static final String TABLE_SQL_CREATE = "create table PROJECT_Project (uuid_ VARCHAR(75) null,projectId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,titleImgRef VARCHAR(500) null,projectToken STRING null,title VARCHAR(50) null,description VARCHAR(300) null,isPublished BOOLEAN,pageUrl VARCHAR(75) null,layoutRef LONG,titleFileRef LONG)";
public static final String TABLE_SQL_DROP = "drop table PROJECT_Project";
public static final String ORDER_BY_JPQL = " ORDER BY project.projectId ASC";
public static final String ORDER_BY_SQL = " ORDER BY PROJECT_Project.projectId ASC";
......
......@@ -13,7 +13,7 @@
<field name="titleImgRef" type="String">
<hint name="max-length">500</hint>
</field>
<field name="projectToken" type="String" >
<field name="projectToken" type="String">
<hint name="max-length">4000</hint>
</field>
<field name="title" type="String">
......
......@@ -2,7 +2,7 @@ create index IX_4C2E3BF7 on PROJECT_Project (createDate);
create index IX_7F902F13 on PROJECT_Project (description[$COLUMN_LENGTH:300$]);
create index IX_E50534FB on PROJECT_Project (isPublished);
create index IX_B9960E20 on PROJECT_Project (layoutRef);
create index IX_44665B4D on PROJECT_Project (projectToken[$COLUMN_LENGTH:75$]);
create index IX_44665B4D on PROJECT_Project (projectToken[$COLUMN_LENGTH:4000$]);
create index IX_544F762F on PROJECT_Project (title[$COLUMN_LENGTH:50$]);
create index IX_952EC9F3 on PROJECT_Project (userId);
create index IX_1ED7E06D on PROJECT_Project (uuid_[$COLUMN_LENGTH:75$], companyId);
......
......@@ -8,7 +8,7 @@ create table PROJECT_Project (
createDate DATE null,
modifiedDate DATE null,
titleImgRef VARCHAR(500) null,
projectToken VARCHAR(75) null,
projectToken STRING null,
title VARCHAR(50) null,
description VARCHAR(300) null,
isPublished BOOLEAN,
......
......@@ -13,6 +13,6 @@
##
build.namespace=PROJECT
build.number=144
build.date=1516194257074
build.number=145
build.date=1516699221538
build.auto.upgrade=true
\ No newline at end of file
......@@ -13,6 +13,6 @@
##
build.namespace=SURVEY
build.number=243
build.date=1516194262123
build.number=244
build.date=1516699226534
build.auto.upgrade=true
\ No newline at end of file
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