Commit 166676ad authored by Elias Englmeier's avatar Elias Englmeier
Browse files

service for projects and bugfixes

parent 62d456c1
......@@ -95,7 +95,7 @@ $(document).ready(function(){
title: data.title,
category: "mapIdea",
userId: themeDisplay.getUserId(),
icon: null,
titleImgRef: null,
shortDescription: data.shortdescription,
description: data.description,
latitude: e.latlng.lat ,
......
......@@ -95,7 +95,7 @@ $(document).ready(function(){
title: data.title,
category: "mapIdea",
userId: themeDisplay.getUserId(),
icon: null,
titleImgRef: null,
shortDescription: data.shortdescription,
description: data.description,
latitude: e.latlng.lat ,
......
......@@ -80,7 +80,7 @@ public class IdeaBoardPortlet extends MVCPortlet {
String description = ParamUtil.getString(actionRequest, "description");
String shortDescription = ParamUtil.getString(actionRequest, "short description");
Ideas nextIdea = IdeasLocalServiceUtil.creadeIdeasWithAutomatedDbId(title, serviceContext.getUserId(),serviceContext.getScopeGroupId(),
null, null, shortDescription, description, 0.0, 0.0, true, false,0,themeDisplay.getLayout().getPrimaryKey(),0L);
null, null, shortDescription, description, 0.0, 0.0, true, false,0,themeDisplay.getLayout().getPrimaryKey(),0L,"",0L);
IdeasLocalServiceUtil.persistIdeasAndPerformTypeChecks(nextIdea);
//Redirect to avoid duplicate submissions
......
......@@ -280,19 +280,19 @@ public interface IdeasModel extends BaseModel<Ideas>, GroupedModel, ShardedModel
public void setLongitude(double longitude);
/**
* Returns the icon of this ideas.
* Returns the title img ref of this ideas.
*
* @return the icon of this ideas
* @return the title img ref of this ideas
*/
@AutoEscape
public String getIcon();
public String getTitleImgRef();
/**
* Sets the icon of this ideas.
* Sets the title img ref of this ideas.
*
* @param icon the icon of this ideas
* @param titleImgRef the title img ref of this ideas
*/
public void setIcon(String icon);
public void setTitleImgRef(String titleImgRef);
/**
* Returns the published of this ideas.
......@@ -378,6 +378,35 @@ public interface IdeasModel extends BaseModel<Ideas>, GroupedModel, ShardedModel
*/
public void setTitleFileRef(long titleFileRef);
/**
* Returns the page url of this ideas.
*
* @return the page url of this ideas
*/
@AutoEscape
public String getPageUrl();
/**
* Sets the page url of this ideas.
*
* @param pageUrl the page url of this ideas
*/
public void setPageUrl(String pageUrl);
/**
* Returns the layout ref of this ideas.
*
* @return the layout ref of this ideas
*/
public long getLayoutRef();
/**
* Sets the layout ref of this ideas.
*
* @param layoutRef the layout ref of this ideas
*/
public void setLayoutRef(long layoutRef);
@Override
public boolean isNew();
......
......@@ -47,12 +47,14 @@ public class IdeasSoap implements Serializable {
soapModel.setCategory(model.getCategory());
soapModel.setLatitude(model.getLatitude());
soapModel.setLongitude(model.getLongitude());
soapModel.setIcon(model.getIcon());
soapModel.setTitleImgRef(model.getTitleImgRef());
soapModel.setPublished(model.getPublished());
soapModel.setIsVisibleOnMap(model.getIsVisibleOnMap());
soapModel.setRating(model.getRating());
soapModel.setProjectRef(model.getProjectRef());
soapModel.setTitleFileRef(model.getTitleFileRef());
soapModel.setPageUrl(model.getPageUrl());
soapModel.setLayoutRef(model.getLayoutRef());
return soapModel;
}
......@@ -209,12 +211,12 @@ public class IdeasSoap implements Serializable {
_longitude = longitude;
}
public String getIcon() {
return _icon;
public String getTitleImgRef() {
return _titleImgRef;
}
public void setIcon(String icon) {
_icon = icon;
public void setTitleImgRef(String titleImgRef) {
_titleImgRef = titleImgRef;
}
public boolean getPublished() {
......@@ -265,6 +267,22 @@ public class IdeasSoap implements Serializable {
_titleFileRef = titleFileRef;
}
public String getPageUrl() {
return _pageUrl;
}
public void setPageUrl(String pageUrl) {
_pageUrl = pageUrl;
}
public long getLayoutRef() {
return _layoutRef;
}
public void setLayoutRef(long layoutRef) {
_layoutRef = layoutRef;
}
private long _ideasId;
private long _companyId;
private long _userId;
......@@ -278,10 +296,12 @@ public class IdeasSoap implements Serializable {
private String _category;
private double _latitude;
private double _longitude;
private String _icon;
private String _titleImgRef;
private boolean _published;
private boolean _isVisibleOnMap;
private int _rating;
private long _projectRef;
private long _titleFileRef;
private String _pageUrl;
private long _layoutRef;
}
\ No newline at end of file
......@@ -70,12 +70,14 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
attributes.put("category", getCategory());
attributes.put("latitude", getLatitude());
attributes.put("longitude", getLongitude());
attributes.put("icon", getIcon());
attributes.put("titleImgRef", getTitleImgRef());
attributes.put("published", getPublished());
attributes.put("isVisibleOnMap", getIsVisibleOnMap());
attributes.put("rating", getRating());
attributes.put("projectRef", getProjectRef());
attributes.put("titleFileRef", getTitleFileRef());
attributes.put("pageUrl", getPageUrl());
attributes.put("layoutRef", getLayoutRef());
return attributes;
}
......@@ -160,10 +162,10 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
setLongitude(longitude);
}
String icon = (String)attributes.get("icon");
String titleImgRef = (String)attributes.get("titleImgRef");
if (icon != null) {
setIcon(icon);
if (titleImgRef != null) {
setTitleImgRef(titleImgRef);
}
Boolean published = (Boolean)attributes.get("published");
......@@ -195,6 +197,18 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
if (titleFileRef != null) {
setTitleFileRef(titleFileRef);
}
String pageUrl = (String)attributes.get("pageUrl");
if (pageUrl != null) {
setPageUrl(pageUrl);
}
Long layoutRef = (Long)attributes.get("layoutRef");
if (layoutRef != null) {
setLayoutRef(layoutRef);
}
}
/**
......@@ -343,13 +357,13 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
}
/**
* Returns the icon of this ideas.
* Returns the page url of this ideas.
*
* @return the icon of this ideas
* @return the page url of this ideas
*/
@Override
public java.lang.String getIcon() {
return _ideas.getIcon();
public java.lang.String getPageUrl() {
return _ideas.getPageUrl();
}
/**
......@@ -372,6 +386,16 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
return _ideas.getTitle();
}
/**
* Returns the title img ref of this ideas.
*
* @return the title img ref of this ideas
*/
@Override
public java.lang.String getTitleImgRef() {
return _ideas.getTitleImgRef();
}
/**
* Returns the user name of this ideas.
*
......@@ -452,6 +476,16 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
return _ideas.getIdeasId();
}
/**
* Returns the layout ref of this ideas.
*
* @return the layout ref of this ideas
*/
@Override
public long getLayoutRef() {
return _ideas.getLayoutRef();
}
/**
* Returns the primary key of this ideas.
*
......@@ -568,16 +602,6 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
_ideas.setGroupId(groupId);
}
/**
* Sets the icon of this ideas.
*
* @param icon the icon of this ideas
*/
@Override
public void setIcon(java.lang.String icon) {
_ideas.setIcon(icon);
}
/**
* Sets the ideas ID of this ideas.
*
......@@ -608,6 +632,16 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
_ideas.setLatitude(latitude);
}
/**
* Sets the layout ref of this ideas.
*
* @param layoutRef the layout ref of this ideas
*/
@Override
public void setLayoutRef(long layoutRef) {
_ideas.setLayoutRef(layoutRef);
}
/**
* Sets the longitude of this ideas.
*
......@@ -633,6 +667,16 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
_ideas.setNew(n);
}
/**
* Sets the page url of this ideas.
*
* @param pageUrl the page url of this ideas
*/
@Override
public void setPageUrl(java.lang.String pageUrl) {
_ideas.setPageUrl(pageUrl);
}
/**
* Sets the primary key of this ideas.
*
......@@ -708,6 +752,16 @@ public class IdeasWrapper implements Ideas, ModelWrapper<Ideas> {
_ideas.setTitleFileRef(titleFileRef);
}
/**
* Sets the title img ref of this ideas.
*
* @param titleImgRef the title img ref of this ideas
*/
@Override
public void setTitleImgRef(java.lang.String titleImgRef) {
_ideas.setTitleImgRef(titleImgRef);
}
/**
* Sets the user ID of this ideas.
*
......
......@@ -97,10 +97,10 @@ public interface IdeasLocalService extends BaseLocalService,
*/
public Ideas creadeIdeasWithAutomatedDbId(java.lang.String title,
long userId, long groupId, java.lang.String type,
java.lang.String icon, java.lang.String shortDescription,
java.lang.String titleImgRef, java.lang.String shortDescription,
java.lang.String description, double latitude, double longitude,
boolean published, boolean showOnMap, int rating, long projectIdRef,
long titleFileRef);
long titleFileRef, java.lang.String pageUrl, long layoutRef);
/**
* Creates a new ideas with the primary key. Does not add the ideas to the database.
......@@ -142,6 +142,9 @@ public interface IdeasLocalService extends BaseLocalService,
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public Ideas getIdeas(long ideasId) throws PortalException;
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public Ideas getIdeasByLayoutIdRef(long layoutRef);
/**
* Updates the ideas in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
*
......
......@@ -85,14 +85,16 @@ public class IdeasLocalServiceUtil {
*/
public static ideaService.model.Ideas creadeIdeasWithAutomatedDbId(
java.lang.String title, long userId, long groupId,
java.lang.String type, java.lang.String icon,
java.lang.String type, java.lang.String titleImgRef,
java.lang.String shortDescription, java.lang.String description,
double latitude, double longitude, boolean published,
boolean showOnMap, int rating, long projectIdRef, long titleFileRef) {
boolean showOnMap, int rating, long projectIdRef, long titleFileRef,
java.lang.String pageUrl, long layoutRef) {
return getService()
.creadeIdeasWithAutomatedDbId(title, userId, groupId, type,
icon, shortDescription, description, latitude, longitude,
published, showOnMap, rating, projectIdRef, titleFileRef);
titleImgRef, shortDescription, description, latitude, longitude,
published, showOnMap, rating, projectIdRef, titleFileRef, pageUrl,
layoutRef);
}
/**
......@@ -144,6 +146,10 @@ public class IdeasLocalServiceUtil {
return getService().getIdeas(ideasId);
}
public static ideaService.model.Ideas getIdeasByLayoutIdRef(long layoutRef) {
return getService().getIdeasByLayoutIdRef(layoutRef);
}
/**
* Updates the ideas in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
*
......
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