Adding a Please wait right on starting custom action
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2015 01:44 AM
Hi ,
I want to display a "Please wait loading" message just on starting custom action and message should stay there untill action is completed .I know about Alfresco.util.PopupManager.Displaymessage but dont know how to implement it. PLease someone guide me to acomplish this task.
cheers
Raghav Bhardwaj
I want to display a "Please wait loading" message just on starting custom action and message should stay there untill action is completed .I know about Alfresco.util.PopupManager.Displaymessage but dont know how to implement it. PLease someone guide me to acomplish this task.
cheers
Raghav Bhardwaj
Labels:
- Labels:
-
Archive
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2015 05:22 PM
Try with this: https://github.com/ntmcminn/glacier-archive-action/blob/master/glacier-archive/glacier-archive-share...
Hyland Developer Evangelist
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2015 06:12 AM
Hi thanks for your reply,
I tried above solution but still not seeing any wait message. No errors on logs as well. Is it even possible with version 5.0.d. Please help
I tried above solution but still not seeing any wait message. No errors on logs as well. Is it even possible with version 5.0.d. Please help
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2015 07:22 AM
Thanks It Worked!!!!!!!!!
cheers
Raghav Bhardwaj
cheers
Raghav Bhardwaj
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2015 10:10 AM
Can you please try the below one,
If possible, can you please share your code as well?
Alfresco.util.PopupManager.displayMessage({ text : "Please wait, while loading your data", spanClass : "wait", displayTime : 0});
If possible, can you please share your code as well?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2015 03:03 AM
Hi i extended actions.js and edited the existing function onActionSimpleRepoAction
This is the code from actions.js
onActionSimpleRepoAction: function dlA_onActionSimpleRepoAction(record, owner)
{
YAHOO.Bubbling.fire("registerAction", {
actionName : "someco-web-enable",
fn: function onGlacierArchiveAction(record, owner) {
this.widgets.waitDialog = Alfresco.util.PopupManager.displayMessage({
text : "testtttttttttttttttttttttttttttttttttttt",
spanClass : "wait",
displayTime : 100000
});
// Get action params
var params = this.getAction(record, owner).params,
displayName = record.displayName,
namedParams = ["function", "action", "success", "successMessage", "failure", "failureMessage"],
repoActionParams = {};
for (var name in params)
{
if (params.hasOwnProperty(name) && !Alfresco.util.arrayContains(namedParams, name))
{
repoActionParams[name] = params[name];
}
}
// Deactivate action
var ownerTitle = owner.title;
owner.title = owner.title + "_deactivated";
// Prepare genericAction config
var config =
{
success:
{
event:
{
name: "metadataRefresh",
obj: record
}
},
failure:
{
message: this.msg(params.failureMessage, displayName),
fn: function showAction()
{
owner.title = ownerTitle;
},
scope: this
},
webscript:
{
method: Alfresco.util.Ajax.POST,
stem: Alfresco.constants.PROXY_URI + "api/",
name: "actionQueue"
},
config:
{
requestContentType: Alfresco.util.Ajax.JSON,
dataObj:
{
actionedUponNode: record.nodeRef,
actionDefinitionName: params.action,
parameterValues: repoActionParams
}
}
};
This is the code from share-custom-config.xml
<alfresco-config>
<!– Actions –>
<config evaluator="string-compare" condition="DocLibActions">
<actions>
<action id="someco-web-site" type="link" label="actions.someco.web-site" icon="someco-website">
<param name="href">http://ecmarchitect.com</param>
<param name="target">_blank</param>
</action>
<action id="someco-web-enable" type="javascript" label="actions.someco.web-enable" icon="someco-create-website">
<param name="function">onActionSimpleRepoAction</param>
<permissions>
<permission allow="true">Write</permission>
</permissions>
<param name="action">enable-web-flag</param>
<param name="successMessage">message.web-flag.enabled</param>
<param name="failureMessage">message.web-flag.failure</param>
<evaluator negate="true">someco.evaluator.doclib.action.isActive</evaluator>
</action>
<action id="someco-web-disable" type="javascript" label="actions.someco.web-disable" icon="someco-delete-website">
<param name="function">onActionSimpleRepoAction</param>
<permissions>
<permission allow="true">Write</permission>
</permissions>
<param name="action">disable-web-flag</param>
<param name="successMessage">message.web-flag.disabled</param>
<param name="failureMessage">message.web-flag.failure</param>
<evaluator>someco.evaluator.doclib.action.isActive</evaluator>
</action>
</actions>
<actionGroups>
<actionGroup id="document-browse">
<action index="500" id="someco-web-site" />
<action index="510" id="someco-web-enable" />
<action index="520" id="someco-web-disable" />
</actionGroup>
<actionGroup id="document-details">
<action index="500" id="someco-web-site" />
<action index="510" id="someco-web-enable" />
<action index="520" id="someco-web-disable" />
</actionGroup>
</actionGroups>
</config>
</alfresco-config>
This is the code from actions.js
onActionSimpleRepoAction: function dlA_onActionSimpleRepoAction(record, owner)
{
YAHOO.Bubbling.fire("registerAction", {
actionName : "someco-web-enable",
fn: function onGlacierArchiveAction(record, owner) {
this.widgets.waitDialog = Alfresco.util.PopupManager.displayMessage({
text : "testtttttttttttttttttttttttttttttttttttt",
spanClass : "wait",
displayTime : 100000
});
// Get action params
var params = this.getAction(record, owner).params,
displayName = record.displayName,
namedParams = ["function", "action", "success", "successMessage", "failure", "failureMessage"],
repoActionParams = {};
for (var name in params)
{
if (params.hasOwnProperty(name) && !Alfresco.util.arrayContains(namedParams, name))
{
repoActionParams[name] = params[name];
}
}
// Deactivate action
var ownerTitle = owner.title;
owner.title = owner.title + "_deactivated";
// Prepare genericAction config
var config =
{
success:
{
event:
{
name: "metadataRefresh",
obj: record
}
},
failure:
{
message: this.msg(params.failureMessage, displayName),
fn: function showAction()
{
owner.title = ownerTitle;
},
scope: this
},
webscript:
{
method: Alfresco.util.Ajax.POST,
stem: Alfresco.constants.PROXY_URI + "api/",
name: "actionQueue"
},
config:
{
requestContentType: Alfresco.util.Ajax.JSON,
dataObj:
{
actionedUponNode: record.nodeRef,
actionDefinitionName: params.action,
parameterValues: repoActionParams
}
}
};
This is the code from share-custom-config.xml
<alfresco-config>
<!– Actions –>
<config evaluator="string-compare" condition="DocLibActions">
<actions>
<action id="someco-web-site" type="link" label="actions.someco.web-site" icon="someco-website">
<param name="href">http://ecmarchitect.com</param>
<param name="target">_blank</param>
</action>
<action id="someco-web-enable" type="javascript" label="actions.someco.web-enable" icon="someco-create-website">
<param name="function">onActionSimpleRepoAction</param>
<permissions>
<permission allow="true">Write</permission>
</permissions>
<param name="action">enable-web-flag</param>
<param name="successMessage">message.web-flag.enabled</param>
<param name="failureMessage">message.web-flag.failure</param>
<evaluator negate="true">someco.evaluator.doclib.action.isActive</evaluator>
</action>
<action id="someco-web-disable" type="javascript" label="actions.someco.web-disable" icon="someco-delete-website">
<param name="function">onActionSimpleRepoAction</param>
<permissions>
<permission allow="true">Write</permission>
</permissions>
<param name="action">disable-web-flag</param>
<param name="successMessage">message.web-flag.disabled</param>
<param name="failureMessage">message.web-flag.failure</param>
<evaluator>someco.evaluator.doclib.action.isActive</evaluator>
</action>
</actions>
<actionGroups>
<actionGroup id="document-browse">
<action index="500" id="someco-web-site" />
<action index="510" id="someco-web-enable" />
<action index="520" id="someco-web-disable" />
</actionGroup>
<actionGroup id="document-details">
<action index="500" id="someco-web-site" />
<action index="510" id="someco-web-enable" />
<action index="520" id="someco-web-disable" />
</actionGroup>
</actionGroups>
</config>
</alfresco-config>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2015 03:23 AM
Hi,
Can you please post your code inside the code block (< code > …… < / code >)?
Thanks
Murali.
Can you please post your code inside the code block (< code > …… < / code >)?
Thanks
Murali.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2015 04:57 AM
Hi iam attaching you screenshots of both files ie actions.js and share-config-custom.xml. In actions.js i have added your code in existing function onActionSimpleRepoAction and calling this function when the action is invoked. Please help me solving this issue.