MyTasks portlet improvements and fixes:

- Inner panel of MyTasks portlet now a separate webscript called 'mytaskspanel' and an ajax request is used to refresh or update the panel after an action occurs.
 - Generated task actions fixed to use ajax refresh rather than full window refresh (fixes issue with MyTasks portlet actions being used in JSF-168 or JSF runtime)
 - Generated task actions fixed to handle default (null) transition ID
Permission checking added to MySpaces portlet actions.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5808 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-05-30 09:35:20 +00:00
parent b2a11b9832
commit c05c6a253f
7 changed files with 154 additions and 81 deletions

View File

@@ -1,14 +1,43 @@
var MyTasks = {
ANIM_LENGTH: 300,
DETAIL_PANEL_HEIGHT: 132,
Filter: null,
start: function()
{
if ($('taskPanel'))
{
MyTasks.parseTaskPanels();
// fire off the ajax request to populate the task panel - the 'mytaskspanel' webscript
// is responsible for rendering just the contents of the main panel div
YAHOO.util.Connect.asyncRequest(
"GET",
getContextPath() + '/service/mytaskspanel?f='+MyTasks.Filter,
{
success: function(response)
{
// push the response into the task panel div
$('taskPanel').setHTML(response.responseText);
// extract the count value from a hidden div and display it
$('taskCount').setHTML($('taskCountValue').innerHTML);
// wire up all the events and animations
MyTasks.init();
},
failure: function(response)
{
$('taskPanel').setHTML("Sorry, data currently unavailable.");
}
}
);
}
},
init: function()
{
MyTasks.parseTaskPanels();
// hide the ajax wait panel and show the main task panel
$('taskPanelOverlay').setStyle('visibility', 'hidden');
$('taskPanel').setStyle('visibility', 'visible');
},
parseTaskPanels: function()
{
@@ -237,21 +266,20 @@ var MyTasks = {
});
},
transitionTask: function(tUrl, rUrl, successMessage)
transitionTask: function(commandUrl, successMessage)
{
YAHOO.util.Connect.asyncRequest(
"GET",
getContextPath() + tUrl,
getContextPath() + commandUrl,
{
success: function(response)
{
window.location.href = rUrl + "&_rand=" + Math.floor(Math.random()*99999) +
"&" + "m=" + successMessage;
MyTasks.displayMessage(successMessage);
MyTasks.refreshList();
},
failure: function(e)
{
alert(e.status + " : ERROR failed to transition task.");
window.location.href = rUrl + "&_rand=" + Math.floor(Math.random()*99999);
}
}
);
@@ -260,7 +288,26 @@ var MyTasks = {
displayMessage: function(message)
{
var footer = $('taskFooter');
footer.innerHTML = message + ' ' + footer.innerHTML
if (footer.oldMessage == undefined)
{
footer.oldMessage = footer.innerHTML;
}
footer.innerHTML = message + ' ' + footer.oldMessage;
},
/**
* Refresh the main data list contents within the taskPanel container
*/
refreshList: function()
{
// empty the main panel div and restart by reloading the panel contents
var taskPanel = $('taskPanel');
taskPanel.setStyle('visibility', 'hidden');
// show the ajax wait panel
$('taskPanelOverlay').setStyle('visibility', 'visible');
taskPanel.empty();
taskPanel.removeEvents('mouseleave');
MyTasks.start();
}
};