Fixes to Open InfoManager Task list module: Pagination

Hello Everybody, The following is all about some fix requests for the Task List Manager module.

First Request: Pagination out of order.

Solution: I decided to go back to old Action, TasksCollector, TaskHolder classes from tempo ui-fw. As I explained in other post I use JsonUpdate Servlet before because I started inspired in the portlet view. Now as this Open InfoManager is just another face of Tempo UI-FW the best choice is to do things as they planned.

Key points of change for back-end:

1. org.intalio.tempo.uiframework.actions.TaskCollector class

ParameterMap -> Substitution of page parameters by start and limit.

Ext js Paging Bar makes use of start and limit for pagination.

Method collectTasks -> meaning of taskPerPage is now limit, page corresponds   to start.

Add two lines for task type PATask ->

hasAttachments= (myTask.getAttachments().size()>0);
tasksHolder.add(new TaskHolder<Task>(task, URIUtils.getResolvedTaskURLAsString(_request, fmanager, task, token, user),hasAttachments));

That was in order to have a new attribute for the view model hasAttachments which is used by UI implementation.

Add getter -> getTotalRows

In order to feed back the view with the total amount of rows available.

2. org.intalio.tempo.uiframework.model.TaskHolder

Member Field addition -> hasAttachments along set and get.

Constructor overload -> to include hasAttachments for PATasks.

3. org.intalio.tempo.uiframework.actions.TasksAction

Add another param to model -> totalRows

model.put(“totalRows”, collector.getTotalRows());

Key points of change to updates.jsp view:

A key design element for Open InfoManager is to use the majority of views for data formating and exchange only.

updates.jsp view was very suitable to use without affecting the overall behavior of Tempo UI-FW and ease reusability.

I just substitute table buildings for json array, objects and properties. The only thing which is exchange here is Data not UI building blocks.

ie: for PATasks

<json:array name=”tasks” var=”taskHolder” items=”${tasks}”>
<json:object>
<json:property name=”taskId” value=”${taskHolder.task.ID}” />
<json:property name=”taskUrl” value=”${taskHolder.formManagerURL}” />
<json:property name=”description” value=”${taskHolder.task.description}” />
<json:property name=”creationDate” >
<fmt:formatDate pattern=”yyyy-MM-dd hh:mm:ss”  value=”${taskHolder.task.creationDate}” />
</json:property>
<json:property name=”deadline” >
<fmt:formatDate pattern=”yyyy-MM-dd hh:mm:ss” value=”${taskHolder.task.deadline}” />
</json:property>
<json:property name=”state” value=”${taskHolder.task.state}” />
<c:choose>
<c:when test=”${taskHolder.task.priority != ’0′}”>
<json:property name=”priority” value=”${taskHolder.task.priority}” />
</c:when>
</c:choose>
<json:property name=”hasattachments” value=”${taskHolder.hasAttachments}” />
</json:object>
</json:array>

Key points of change to UI presentation:

1. taskboard.DataLayer.js

Change proxy instantiation for each task type -> now type and update params are added to url , ie:

this.proxy = new Ext.data.HttpProxy({url:updateUrl+”&type=PIPATask&update=true”});

2. tasks.jsp view

Change updateUrl definition -> now it points to tasks.htm as old good UI-FW does.

var updateUrl  =”tasks.htm”+”?user=”+currentUser+”&token=”+participantToken;

Change serverDateFormat Format definition -> Now it matches with expected by client code.

var serverDateFormat = ‘Y-m-d H:i:s’;

Well, that’s enough for a post, next one will deal with Search Solution.

Best Regards.

Advertisement
Explore posts in the same categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.