Skip to content

Commit

Permalink
LPS-31852 As an user I should be able to categorize a calendar resources
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardolundgren authored and brianchandotcom committed Dec 20, 2012
1 parent cfd6a81 commit e982992
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ public void updateAsset(
calendarResource.getModifiedDate(),
CalendarResource.class.getName(),
calendarResource.getCalendarResourceId(),
calendarResource.getUuid(), 0, assetCategoryIds,
assetTagNames, true, null, null, null, ContentTypes.TEXT,
calendarResource.getUuid(), 0, assetCategoryIds, assetTagNames,
true, null, null, null, ContentTypes.TEXT,
calendarResource.getName(), calendarResource.getDescription(), null,
null, null, 0, 0, null, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,6 @@ public class CalendarResourceFinderImpl
public static final String FIND_BY_C_G_C_C_N_D_A =
CalendarResourceFinder.class.getName() + ".findByC_G_C_C_N_D_A";

public int countByKeywords(
long companyId, long[] groupIds, long[] classNameIds,
String keywords, boolean active)
throws SystemException {

String[] codes = null;
String[] names = null;
String[] descriptions = null;
boolean andOperator = false;

if (Validator.isNotNull(keywords)) {
codes = CustomSQLUtil.keywords(keywords);
names = CustomSQLUtil.keywords(keywords);
descriptions = CustomSQLUtil.keywords(keywords, false);
}
else {
andOperator = true;
}

return countByC_G_C_C_N_D_A(
companyId, groupIds, classNameIds, codes, names, descriptions,
active, andOperator);
}

public int countByC_G_C_C_N_D_A(
long companyId, long[] groupIds, long[] classNameIds, String code,
String name, String description, boolean active,
Expand All @@ -98,7 +74,7 @@ public int countByC_G_C_C_N_D_A(
active, andOperator, false);
}

public int filterCountByKeywords(
public int countByKeywords(
long companyId, long[] groupIds, long[] classNameIds,
String keywords, boolean active)
throws SystemException {
Expand All @@ -117,14 +93,15 @@ public int filterCountByKeywords(
andOperator = true;
}

return filterCountByC_G_C_C_N_D_A(
return countByC_G_C_C_N_D_A(
companyId, groupIds, classNameIds, codes, names, descriptions,
active, andOperator);
}

public int filterCountByC_G_C_C_N_D_A(
long companyId, long[] groupIds, long[] classNameIds, String code,
String name, String description,boolean active, boolean andOperator)
String name, String description, boolean active,
boolean andOperator)
throws SystemException {

String[] codes = CustomSQLUtil.keywords(code);
Expand All @@ -147,10 +124,9 @@ public int filterCountByC_G_C_C_N_D_A(
active, andOperator, true);
}

public List<CalendarResource> filterFindByKeywords(
public int filterCountByKeywords(
long companyId, long[] groupIds, long[] classNameIds,
String keywords, boolean active, int start, int end,
OrderByComparator orderByComparator)
String keywords, boolean active)
throws SystemException {

String[] codes = null;
Expand All @@ -167,9 +143,9 @@ public List<CalendarResource> filterFindByKeywords(
andOperator = true;
}

return filterFindByC_G_C_C_N_D_A(
return filterCountByC_G_C_C_N_D_A(
companyId, groupIds, classNameIds, codes, names, descriptions,
active, andOperator, start, end, orderByComparator);
active, andOperator);
}

public List<CalendarResource> filterFindByC_G_C_C_N_D_A(
Expand All @@ -191,16 +167,16 @@ public List<CalendarResource> filterFindByC_G_C_C_N_D_A(
public List<CalendarResource> filterFindByC_G_C_C_N_D_A(
long companyId, long[] groupIds, long[] classNameIds,
String[] codes, String[] names, String[] descriptions,
boolean active, boolean andOperator, int start,
int end, OrderByComparator orderByComparator)
boolean active, boolean andOperator, int start, int end,
OrderByComparator orderByComparator)
throws SystemException {

return doFindByC_G_C_C_N_D_A(
companyId, groupIds, classNameIds, codes, names, descriptions,
active, andOperator, start, end, orderByComparator, true);
}

public List<CalendarResource> findByKeywords(
public List<CalendarResource> filterFindByKeywords(
long companyId, long[] groupIds, long[] classNameIds,
String keywords, boolean active, int start, int end,
OrderByComparator orderByComparator)
Expand All @@ -220,7 +196,7 @@ public List<CalendarResource> findByKeywords(
andOperator = true;
}

return findByC_G_C_C_N_D_A(
return filterFindByC_G_C_C_N_D_A(
companyId, groupIds, classNameIds, codes, names, descriptions,
active, andOperator, start, end, orderByComparator);
}
Expand Down Expand Up @@ -253,6 +229,31 @@ public List<CalendarResource> findByC_G_C_C_N_D_A(
active, andOperator, start, end, orderByComparator, false);
}

public List<CalendarResource> findByKeywords(
long companyId, long[] groupIds, long[] classNameIds,
String keywords, boolean active, int start, int end,
OrderByComparator orderByComparator)
throws SystemException {

String[] codes = null;
String[] names = null;
String[] descriptions = null;
boolean andOperator = false;

if (Validator.isNotNull(keywords)) {
codes = CustomSQLUtil.keywords(keywords);
names = CustomSQLUtil.keywords(keywords);
descriptions = CustomSQLUtil.keywords(keywords, false);
}
else {
andOperator = true;
}

return findByC_G_C_C_N_D_A(
companyId, groupIds, classNameIds, codes, names, descriptions,
active, andOperator, start, end, orderByComparator);
}

protected int doCountByC_G_C_C_N_D_A(
long companyId, long[] groupIds, long[] classNameIds,
String[] codes, String[] names, String[] descriptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

build.namespace=Calendar
build.number=1
build.date=1355506601814
build.date=1338929369971
build.auto.upgrade=true

##
Expand Down
75 changes: 39 additions & 36 deletions portlets/calendar-portlet/docroot/edit_calendar_resource.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -56,46 +56,49 @@ String code = BeanParamUtil.getString(calendarResource, request, "code");
<aui:model-context bean="<%= calendarResource %>" model="<%= CalendarResource.class %>" />

<aui:fieldset>
<c:choose>
<c:when test="<%= calendarResource == null %>">
<c:if test="<%= !PortletPropsValues.CALENDAR_RESOURCE_FORCE_AUTOGENERATE_CODE %>">
<aui:input name="code" />
</c:if>
</c:when>
<c:otherwise>
<aui:field-wrapper label="code">
<%= code %>
</aui:field-wrapper>
</c:otherwise>
</c:choose>

<aui:input name="name" />

<aui:input name="description" />

<c:if test="<%= calendars != null %>">
<aui:select label="default-calendar" name="defaultCalendarId" value="<%= calendarResource.getDefaultCalendarId() %>">

<%
for (Calendar calendar : calendars) {
%>

<aui:option label="<%= calendar.getName(locale) %>" value="<%= calendar.getCalendarId() %>" />

<%
}
%>

</aui:select>
</c:if>

<aui:input inlineLabel="left" name="active" type="checkbox" value="<%= (calendarResource == null) ? true : calendarResource.isActive() %>" />
<liferay-ui:panel-container extended="<%= true %>" id="calendarResourceDetailsPanelContainer" persistState="<%= true %>">
<liferay-ui:panel defaultState="closed" extended="<%= false %>" id="calendarResourceDetailsPanel" persistState="<%= true %>" title="details">
<c:choose>
<c:when test="<%= calendarResource == null %>">
<c:if test="<%= !PortletPropsValues.CALENDAR_RESOURCE_FORCE_AUTOGENERATE_CODE %>">
<aui:input name="code" />
</c:if>
</c:when>
<c:otherwise>
<aui:field-wrapper label="code">
<%= code %>
</aui:field-wrapper>
</c:otherwise>
</c:choose>

<aui:input name="description" />

<c:if test="<%= calendars != null %>">
<aui:select label="default-calendar" name="defaultCalendarId" value="<%= calendarResource.getDefaultCalendarId() %>">

<%
for (Calendar calendar : calendars) {
%>

<aui:option label="<%= calendar.getName(locale) %>" value="<%= calendar.getCalendarId() %>" />

<%
}
%>

</aui:select>
</c:if>

<liferay-ui:panel defaultState="closed" extended="<%= false %>" id="calendarResourceCategorizationPanel" persistState="<%= true %>" title="categorization">
<aui:input classPK="<%= calendarResourceId %>" name="categories" type="assetCategories" />
<aui:input inlineLabel="left" name="active" type="checkbox" value="<%= (calendarResource == null) ? true : calendarResource.isActive() %>" />
</liferay-ui:panel>
<liferay-ui:panel defaultState="closed" extended="<%= false %>" id="calendarResourceCategorizationPanel" persistState="<%= true %>" title="categorization">
<aui:input classPK="<%= calendarResourceId %>" name="categories" type="assetCategories" />

<aui:input classPK="<%= calendarResourceId %>" name="tags" type="assetTags" />
</liferay-ui:panel>
<aui:input classPK="<%= calendarResourceId %>" name="tags" type="assetTags" />
</liferay-ui:panel>
</liferay-ui:panel-container>

<c:if test="<%= calendarResource == null %>">
<aui:field-wrapper label="permissions">
Expand Down

0 comments on commit e982992

Please sign in to comment.