Commit 18bc4e43 authored by Elias Englmeier's avatar Elias Englmeier
Browse files

some bugfixes and like-functionality

parent 9971f67a
......@@ -13,6 +13,6 @@
##
build.namespace=ANALYSIS
build.number=23
build.date=1511964638794
build.number=36
build.date=1512140389934
build.auto.upgrade=true
\ No newline at end of file
......@@ -13,6 +13,6 @@
##
build.namespace=GB
build.number=44
build.date=1511964643116
build.number=57
build.date=1512140394362
build.auto.upgrade=true
\ No newline at end of file
......@@ -6,4 +6,5 @@ Export-Package:\
ideaService.model,\
ideaService.service,\
ideaService.service.persistence
-includeresource: META-INF/service.xml=../ideaService-service/service.xml
\ No newline at end of file
......@@ -360,14 +360,15 @@ public interface IdeasModel extends BaseModel<Ideas>, GroupedModel, ShardedModel
*
* @return the rating of this ideas
*/
public int getRating();
@AutoEscape
public String getRating();
/**
* Sets the rating of this ideas.
*
* @param rating the rating of this ideas
*/
public void setRating(int rating);
public void setRating(String rating);
/**
* Returns the project ref of this ideas.
......@@ -426,6 +427,21 @@ public interface IdeasModel extends BaseModel<Ideas>, GroupedModel, ShardedModel
*/
public void setLayoutRef(long layoutRef);
/**
* Returns the additional picture urls of this ideas.
*
* @return the additional picture urls of this ideas
*/
@AutoEscape
public String getAdditionalPictureUrls();
/**
* Sets the additional picture urls of this ideas.
*
* @param additionalPictureUrls the additional picture urls of this ideas
*/
public void setAdditionalPictureUrls(String additionalPictureUrls);
/**
* Returns the status of this ideas.
*
......
......@@ -56,6 +56,7 @@ public class IdeasSoap implements Serializable {
soapModel.setTitleFileRef(model.getTitleFileRef());
soapModel.setPageUrl(model.getPageUrl());
soapModel.setLayoutRef(model.getLayoutRef());
soapModel.setAdditionalPictureUrls(model.getAdditionalPictureUrls());
soapModel.setStatus(model.getStatus());
soapModel.setStatusByUserId(model.getStatusByUserId());
soapModel.setStatusByUserName(model.getStatusByUserName());
......@@ -256,11 +257,11 @@ public class IdeasSoap implements Serializable {
_isVisibleOnMap = isVisibleOnMap;
}
public int getRating() {
public String getRating() {
return _rating;
}
public void setRating(int rating) {
public void setRating(String rating) {
_rating = rating;
}
......@@ -296,6 +297,14 @@ public class IdeasSoap implements Serializable {
_layoutRef = layoutRef;
}
public String getAdditionalPictureUrls() {
return _additionalPictureUrls;
}
public void setAdditionalPictureUrls(String additionalPictureUrls) {
_additionalPictureUrls = additionalPictureUrls;
}
public int getStatus() {
return _status;
}
......@@ -345,11 +354,12 @@ public class IdeasSoap implements Serializable {
private String _titleImgRef;
private boolean _published;
private boolean _isVisibleOnMap;
private int _rating;
private String _rating;
private long _projectRef;
private long _titleFileRef;
private String _pageUrl;
private long _layoutRef;
private String _additionalPictureUrls;
private int _status;
private long _statusByUserId;
private String _statusByUserName;
......
......@@ -81,6 +81,7 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
attributes.put("titleFileRef", getTitleFileRef());
attributes.put("pageUrl", getPageUrl());
attributes.put("layoutRef", getLayoutRef());
attributes.put("additionalPictureUrls", getAdditionalPictureUrls());
attributes.put("status", getStatus());
attributes.put("statusByUserId", getStatusByUserId());
attributes.put("statusByUserName", getStatusByUserName());
......@@ -193,7 +194,7 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
setIsVisibleOnMap(isVisibleOnMap);
}
Integer rating = (Integer)attributes.get("rating");
String rating = (String)attributes.get("rating");
if (rating != null) {
setRating(rating);
......@@ -223,6 +224,13 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
setLayoutRef(layoutRef);
}
String additionalPictureUrls = (String)attributes.get(
"additionalPictureUrls");
if (additionalPictureUrls != null) {
setAdditionalPictureUrls(additionalPictureUrls);
}
Integer status = (Integer)attributes.get("status");
if (status != null) {
......@@ -428,16 +436,6 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
return _ideas.compareTo(ideas);
}
/**
* Returns the rating of this ideas.
*
* @return the rating of this ideas
*/
@Override
public int getRating() {
return _ideas.getRating();
}
/**
* Returns the status of this ideas.
*
......@@ -463,6 +461,16 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
return new IdeasWrapper((Ideas)_ideas.clone());
}
/**
* Returns the additional picture urls of this ideas.
*
* @return the additional picture urls of this ideas
*/
@Override
public java.lang.String getAdditionalPictureUrls() {
return _ideas.getAdditionalPictureUrls();
}
/**
* Returns the description of this ideas.
*
......@@ -483,6 +491,16 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
return _ideas.getPageUrl();
}
/**
* Returns the rating of this ideas.
*
* @return the rating of this ideas
*/
@Override
public java.lang.String getRating() {
return _ideas.getRating();
}
/**
* Returns the shortdescription of this ideas.
*
......@@ -708,6 +726,16 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
_ideas.persist();
}
/**
* Sets the additional picture urls of this ideas.
*
* @param additionalPictureUrls the additional picture urls of this ideas
*/
@Override
public void setAdditionalPictureUrls(java.lang.String additionalPictureUrls) {
_ideas.setAdditionalPictureUrls(additionalPictureUrls);
}
@Override
public void setCachedModel(boolean cachedModel) {
_ideas.setCachedModel(cachedModel);
......@@ -895,7 +923,7 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
* @param rating the rating of this ideas
*/
@Override
public void setRating(int rating) {
public void setRating(java.lang.String rating) {
_ideas.setRating(rating);
}
......
......@@ -26,6 +26,7 @@ import com.liferay.portal.kernel.dao.orm.Projection;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.model.PersistedModel;
import com.liferay.portal.kernel.model.User;
import com.liferay.portal.kernel.search.Indexable;
import com.liferay.portal.kernel.search.IndexableType;
import com.liferay.portal.kernel.service.BaseLocalService;
......@@ -63,6 +64,10 @@ public interface IdeasLocalService extends BaseLocalService,
*
* Never modify or reference this interface directly. Always use {@link IdeasLocalServiceUtil} to access the ideas local service. Add custom service methods to {@link ideaService.service.impl.IdeasLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
*/
public boolean addUserToRating(User u, long ideasId);
public boolean removeUserFromRating(User u, long ideasId);
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public ActionableDynamicQuery getActionableDynamicQuery();
......@@ -187,6 +192,15 @@ public interface IdeasLocalService extends BaseLocalService,
@Indexable(type = IndexableType.REINDEX)
public Ideas updateIdeas(Ideas ideas);
/**
* Find all ideas with Rating rating.
*
* @param rating the exact rating
* @return a list with all ideas that have rating equal to param
*/
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public int getIdeasRatingCount(long ideasId);
/**
* Returns the number of ideases.
*
......@@ -202,6 +216,8 @@ public interface IdeasLocalService extends BaseLocalService,
*/
public java.lang.String getOSGiServiceIdentifier();
public java.lang.String ratingListToString(List<java.lang.String> list);
/**
* Performs a dynamic query on the database and returns the matching rows.
*
......@@ -275,24 +291,6 @@ public interface IdeasLocalService extends BaseLocalService,
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public List<Ideas> getIdeasByIsVisibleOnMap(boolean visible);
/**
* Find all ideas with Rating rating.
*
* @param rating the exact rating
* @return a list with all ideas that have rating equal to param
*/
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public List<Ideas> getIdeasByRating(int rating);
/**
* @param ratingRangeStart the start of the rating range.
* @param ratingRangeEnd the end of the rating range.
* @return a list with all ideas that are within the given range.
*/
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public List<Ideas> getIdeasByRatingRange(int ratingRangeStart,
int ratingRangeEnd);
/**
* Returns a range of all the ideases.
*
......@@ -333,6 +331,8 @@ public interface IdeasLocalService extends BaseLocalService,
long companyId, int start, int end,
OrderByComparator<Ideas> orderByComparator);
public List<java.lang.String> ratingStringToList(java.lang.String s);
/**
* Searches the DB for the given idea with a field that contains the query.
* Only returns a result if the query is found in all given fields.
......@@ -398,12 +398,4 @@ public interface IdeasLocalService extends BaseLocalService,
*/
@Indexable(type = IndexableType.REINDEX)
public void persistIdeasAndPerformTypeChecks(Ideas idea);
/**
* sets the rating of the idea with primaryKey pk
*
* @param pk the primary key
* @param rating the rating to set
*/
public void setRating(long pk, int rating);
}
\ No newline at end of file
......@@ -41,6 +41,16 @@ public class IdeasLocalServiceUtil {
*
* Never modify this class directly. Add custom service methods to {@link ideaService.service.impl.IdeasLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
*/
public static boolean addUserToRating(
com.liferay.portal.kernel.model.User u, long ideasId) {
return getService().addUserToRating(u, ideasId);
}
public static boolean removeUserFromRating(
com.liferay.portal.kernel.model.User u, long ideasId) {
return getService().removeUserFromRating(u, ideasId);
}
public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
return getService().getActionableDynamicQuery();
}
......@@ -198,6 +208,16 @@ public class IdeasLocalServiceUtil {
return getService().updateIdeas(ideas);
}
/**
* Find all ideas with Rating rating.
*
* @param rating the exact rating
* @return a list with all ideas that have rating equal to param
*/
public static int getIdeasRatingCount(long ideasId) {
return getService().getIdeasRatingCount(ideasId);
}
/**
* Returns the number of ideases.
*
......@@ -216,6 +236,11 @@ public class IdeasLocalServiceUtil {
return getService().getOSGiServiceIdentifier();
}
public static java.lang.String ratingListToString(
java.util.List<java.lang.String> list) {
return getService().ratingListToString(list);
}
/**
* Performs a dynamic query on the database and returns the matching rows.
*
......@@ -309,28 +334,6 @@ public class IdeasLocalServiceUtil {
return getService().getIdeasByIsVisibleOnMap(visible);
}
/**
* Find all ideas with Rating rating.
*
* @param rating the exact rating
* @return a list with all ideas that have rating equal to param
*/
public static java.util.List<ideaService.model.Ideas> getIdeasByRating(
int rating) {
return getService().getIdeasByRating(rating);
}
/**
* @param ratingRangeStart the start of the rating range.
* @param ratingRangeEnd the end of the rating range.
* @return a list with all ideas that are within the given range.
*/
public static java.util.List<ideaService.model.Ideas> getIdeasByRatingRange(
int ratingRangeStart, int ratingRangeEnd) {
return getService()
.getIdeasByRatingRange(ratingRangeStart, ratingRangeEnd);
}
/**
* Returns a range of all the ideases.
*
......@@ -377,6 +380,11 @@ public class IdeasLocalServiceUtil {
orderByComparator);
}
public static java.util.List<java.lang.String> ratingStringToList(
java.lang.String s) {
return getService().ratingStringToList(s);
}
/**
* Searches the DB for the given idea with a field that contains the query.
* Only returns a result if the query is found in all given fields.
......@@ -457,16 +465,6 @@ public class IdeasLocalServiceUtil {
getService().persistIdeasAndPerformTypeChecks(idea);
}
/**
* sets the rating of the idea with primaryKey pk
*
* @param pk the primary key
* @param rating the rating to set
*/
public static void setRating(long pk, int rating) {
getService().setRating(pk, rating);
}
public static IdeasLocalService getService() {
return _serviceTracker.getService();
}
......
......@@ -32,6 +32,18 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
_ideasLocalService = ideasLocalService;
}
@Override
public boolean addUserToRating(com.liferay.portal.kernel.model.User u,
long ideasId) {
return _ideasLocalService.addUserToRating(u, ideasId);
}
@Override
public boolean removeUserFromRating(
com.liferay.portal.kernel.model.User u, long ideasId) {
return _ideasLocalService.removeUserFromRating(u, ideasId);
}
@Override
public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
return _ideasLocalService.getActionableDynamicQuery();
......@@ -203,6 +215,17 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
return _ideasLocalService.updateIdeas(ideas);
}
/**
* Find all ideas with Rating rating.
*
* @param rating the exact rating
* @return a list with all ideas that have rating equal to param
*/
@Override
public int getIdeasRatingCount(long ideasId) {
return _ideasLocalService.getIdeasRatingCount(ideasId);
}
/**
* Returns the number of ideases.
*
......@@ -223,6 +246,12 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
return _ideasLocalService.getOSGiServiceIdentifier();
}
@Override
public java.lang.String ratingListToString(
java.util.List<java.lang.String> list) {
return _ideasLocalService.ratingListToString(list);
}
/**
* Performs a dynamic query on the database and returns the matching rows.
*
......@@ -324,29 +353,6 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
return _ideasLocalService.getIdeasByIsVisibleOnMap(visible);
}
/**
* Find all ideas with Rating rating.
*
* @param rating the exact rating
* @return a list with all ideas that have rating equal to param
*/
@Override
public java.util.List<ideaService.model.Ideas> getIdeasByRating(int rating) {
return _ideasLocalService.getIdeasByRating(rating);
}
/**
* @param ratingRangeStart the start of the rating range.
* @param ratingRangeEnd the end of the rating range.
* @return a list with all ideas that are within the given range.
*/
@Override
public java.util.List<ideaService.model.Ideas> getIdeasByRatingRange(
int ratingRangeStart, int ratingRangeEnd) {
return _ideasLocalService.getIdeasByRatingRange(ratingRangeStart,
ratingRangeEnd);
}
/**
* Returns a range of all the ideases.
*
......@@ -394,6 +400,12 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
start, end, orderByComparator);
}
@Override
public java.util.List<java.lang.String> ratingStringToList(
java.lang.String s) {
return _ideasLocalService.ratingStringToList(s);
}
/**
* Searches the DB for the given idea with a field that contains the query.
* Only returns a result if the query is found in all given fields.
......@@ -479,17 +491,6 @@ public class IdeasLocalServiceWrapper implements IdeasLocalService,
_ideasLocalService.persistIdeasAndPerformTypeChecks(idea);
}
/**
* sets the rating of the idea with primaryKey pk
*
* @param pk the primary key
* @param rating the rating to set
*/
@Override
public void setRating(long pk, int rating) {
_ideasLocalService.setRating(pk, rating);
}
@Override
public IdeasLocalService getWrappedService() {
return _ideasLocalService;
......
......@@ -83,24 +83,6 @@ public interface IdeasService extends BaseService {
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public java.lang.String getIdeasByIsVisibleOnMap(boolean visible);
/**
* @param rating
* @return
*/
@JSONWebService(method = "GET")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public java.lang.String getIdeasByRating(int rating);
/**
* @param ratingRangeStart
* @param ratingRangeEnd
* @return all ideas with the given range.
*/
@JSONWebService(method = "GET")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public java.lang.String getIdeasByRatingRange(int ratingRangeStart,
int ratingRangeEnd);
/**
* Returns the OSGi service identifier.
*
......@@ -108,6 +90,11 @@ public interface IdeasService extends BaseService {
*/
public java.lang.String getOSGiServiceIdentifier();
/**
* @param pk the primaryKey
* @param rating the rating to set
* @return reponse json
*/
@JSONWebService(method = "POST")
public java.lang.String insertNewIdea(java.lang.String title,
long category, long userId, java.lang.String titleImgRef,
......@@ -120,6 +107,11 @@ public interface IdeasService extends BaseService {
public java.lang.String seachIdeasByFieldArray(
java.lang.String[] fieldNames, java.lang.String query, long[] groupIds);
/**