How to call custom control template from share workflow form
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2015 05:15 AM
Hi
I have created a custom template which I want to call it from the share-config workflow form as below ,it is not calling the custom template .Please guide ?
custom template in share config as
workflow model has the property entry as
The template file as customControl.ftl is
I have created a custom template which I want to call it from the share-config workflow form as below ,it is not calling the custom template .Please guide ?
custom template in share config as
<show id="apwf:contentView" /><field id="apwf:contentView"> <control template="/org/alfresco/components/form/controls/customControl.ftl" /> </field>
workflow model has the property entry as
<property name="apwf:contentView"> <type>d:text</type></property>
The template file as customControl.ftl is
<@script type="text/javascript" src="${page.url.context}/res/components/form/custom-web-preview.js"></@script><@script type="text/javascript" src="${page.url.context}/res/components/preview/web-preview.js"></@script><@script src="${url.context}/res/components/preview/web-preview.js" /><@script src="${url.context}/res/components/preview/WebPreviewer.js" /><@script src="${url.context}/res/js/flash/extMouseWheel.js" /><@script src="${url.context}/res/components/preview/StrobeMediaPlayback.js" /><@script src="${url.context}/res/components/preview/Video.js" /><@script src="${url.context}/res/components/preview/Audio.js" /><@script src="${url.context}/res/components/preview/Flash.js" /><@script src="${url.context}/res/components/preview/Image.js" /><script type="text/javascript">//<![CDATA[(function(){ new Alfresco.customControl("${fieldHtmlId}").setMessages(${messages});})();//]]></script><div id="${fieldHtmlId}"> <div id="web-preview"> </div></div>
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2016 10:36 AM
I am also interesting in this. Do you have a solution on this ?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2016 05:26 PM
It's possible. You should add script to ftl template like this:
1)
<#assign el=args.htmlid?html>
<@markup id="widgets">
<@inlineScript group="connect-document">
new Alfresco.getConnectDocumentInstance("${el}", "${url.context}", "${page.url.args['taskId']}").setOptions(
{
});
</@>
</@>
2) in javascript you have to have function:
Alfresco.getConnectDocumentInstance = function(htmlId, urlContext, taskId)
{
var instanceId = "excelenza-connect-cocument-instance";
return Alfresco.util.ComponentManager.get(instanceId) || new Alfresco.ConnectDocument(instanceId, htmlId, urlContext, taskId);
};
and implementation of constuctor:
Alfresco.ConnectDocument = function (instanceId, htmlId, urlContext, taskId) {
var instance = Alfresco.util.ComponentManager.get(instanceId);
if (instance !== null)
{
return instance;
}
this.name = "ConnectDocument";
this.id = htmlId;
this.urlContext = urlContext;
this.taskId = taskId;
Alfresco.util.ComponentManager.register(this);
return this;
};
voilà.
1)
<#assign el=args.htmlid?html>
<@markup id="widgets">
<@inlineScript group="connect-document">
new Alfresco.getConnectDocumentInstance("${el}", "${url.context}", "${page.url.args['taskId']}").setOptions(
{
});
</@>
</@>
2) in javascript you have to have function:
Alfresco.getConnectDocumentInstance = function(htmlId, urlContext, taskId)
{
var instanceId = "excelenza-connect-cocument-instance";
return Alfresco.util.ComponentManager.get(instanceId) || new Alfresco.ConnectDocument(instanceId, htmlId, urlContext, taskId);
};
and implementation of constuctor:
Alfresco.ConnectDocument = function (instanceId, htmlId, urlContext, taskId) {
var instance = Alfresco.util.ComponentManager.get(instanceId);
if (instance !== null)
{
return instance;
}
this.name = "ConnectDocument";
this.id = htmlId;
this.urlContext = urlContext;
this.taskId = taskId;
Alfresco.util.ComponentManager.register(this);
return this;
};
voilà.
