Commit 09b5901d authored by Elias Englmeier's avatar Elias Englmeier
Browse files

added functions to the categorieslocalimpl

parent 18bc4e43
......@@ -13,6 +13,6 @@
##
build.namespace=ANALYSIS
build.number=36
build.date=1512140389934
build.number=37
build.date=1512470059169
build.auto.upgrade=true
\ No newline at end of file
......@@ -13,6 +13,6 @@
##
build.namespace=GB
build.number=57
build.date=1512140394362
build.number=58
build.date=1512470063711
build.auto.upgrade=true
\ No newline at end of file
......@@ -226,6 +226,12 @@ public interface CategoryLocalService extends BaseLocalService,
public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
int end, OrderByComparator<T> orderByComparator);
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public List<Category> getAllCategories();
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public List<Category> getAllCategoriesByProjectId(long projectId);
/**
* Returns a range of all the categories.
*
......
......@@ -246,6 +246,15 @@ public class CategoryLocalServiceUtil {
.dynamicQuery(dynamicQuery, start, end, orderByComparator);
}
public static java.util.List<ideaService.model.Category> getAllCategories() {
return getService().getAllCategories();
}
public static java.util.List<ideaService.model.Category> getAllCategoriesByProjectId(
long projectId) {
return getService().getAllCategoriesByProjectId(projectId);
}
/**
* Returns a range of all the categories.
*
......
......@@ -258,6 +258,17 @@ public class CategoryLocalServiceWrapper implements CategoryLocalService,
orderByComparator);
}
@Override
public java.util.List<ideaService.model.Category> getAllCategories() {
return _categoryLocalService.getAllCategories();
}
@Override
public java.util.List<ideaService.model.Category> getAllCategoriesByProjectId(
long projectId) {
return _categoryLocalService.getAllCategoriesByProjectId(projectId);
}
/**
* Returns a range of all the categories.
*
......
......@@ -13,6 +13,6 @@
##
build.namespace=IDEA
build.number=190
build.date=1512140398566
build.number=191
build.date=1512470068037
build.auto.upgrade=true
\ No newline at end of file
......@@ -14,6 +14,9 @@
package ideaService.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.liferay.counter.kernel.service.CounterLocalServiceUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.model.User;
......@@ -22,6 +25,7 @@ import com.liferay.portal.kernel.service.UserLocalServiceUtil;
import ideaService.model.Category;
import ideaService.service.CategoryLocalServiceUtil;
import ideaService.service.base.CategoryLocalServiceBaseImpl;
import ideaService.service.persistence.CategoryUtil;
/**
* The implementation of the category local service.
......@@ -44,6 +48,23 @@ public class CategoryLocalServiceImpl extends CategoryLocalServiceBaseImpl {
* Never reference this class directly. Always use {@link ideaService.service.CategoryLocalServiceUtil} to access the category local service.
*/
public List<Category> getAllCategories(){
return CategoryUtil.findAll();
}
public List<Category> getAllCategoriesByProjectId(long projectId){
List<Category> allCategories = CategoryUtil.findAll();
List<Category> result = new ArrayList<Category>();
for(Category c : allCategories){
if(c.getProjectRef() == projectId){
result.add(c);
}
}
return result;
}
public Category createNewCategoryWithAutomatedDBId(long userId, long groupId, String description, String categoryTitle, long projectRef){
int nextDbId = (int)CounterLocalServiceUtil.increment(Category.class.getName());
Category nextCategory = CategoryLocalServiceUtil.createCategory(nextDbId);
......
......@@ -13,6 +13,6 @@
##
build.namespace=IDEA
build.number=190
build.date=1512140398566
build.number=191
build.date=1512470068037
build.auto.upgrade=true
\ No newline at end of file
......@@ -13,6 +13,6 @@
##
build.namespace=PROJECT
build.number=102
build.date=1512140401262
build.number=103
build.date=1512470070727
build.auto.upgrade=true
\ No newline at end of file
......@@ -13,6 +13,6 @@
##
build.namespace=SURVEY
build.number=201
build.date=1512140406237
build.number=202
build.date=1512470075844
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