Skip to content

Instantly share code, notes, and snippets.

View avasyukov's full-sized avatar

Alexey Vasyukov avasyukov

View GitHub Profile
model.actionSet.push(
{
className: "onActionComplete",
type: "action-link",
permission: "edit",
href: "",
func: "MyCustomAction",
label: "actions.document.simple-approve"
});
model.actionSet.push(
{
className: "onActionPermissions",
type: "action-link",
permission: "edit",
href: "manage-permissions?nodeRef=",
func: "",
label: "actions.document.manage-permissions"
});
<extension>
<modules>
<module>
<id>My Datagrid Actions</id>
<customizations>
<customization>
<targetPackageRoot>documents-registers</targetPackageRoot>
<sourcePackageRoot>custom.documents-registers</sourcePackageRoot>
</customization>
</customizations>
<form id="datagrid">
...
<appearance>
<field id="alvexcoursedocs:partnerDiscount" isSortKey="true">
<control template="MyCustomRenderer"/>
</field>
</appearance>
</form>
<config>
<forms>
<dependencies>
<js src="/components/custom/custom-datagrid-renderers.js" />
</dependencies>
</forms>
</config>
MyCustomRenderer = function (elCell, oRecord, oColumn, oData)
{
oData = oRecord.getData("itemData")[oColumn.field];
if( !oData )
return;
if( oData.value >= 10 )
elCell.innerHTML = "<strong>" + oData.displayValue + "</strong>";
else
elCell.innerHTML = oData.displayValue;
<form id="datagrid">
.....
<appearance>
<field id="alvexcoursedocs:partnerDiscount">
<control template="MyCustomRenderer"/>
</field>
</appearance>
</form>
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
var documents = execution.getVariable('alvexdocreg20_documents');
logger.log("Documents count: " + documents.size());
for(var i = 0; i &lt; documents.size(); i++)
{
var node = documents.get(i);
logger.log( "Processing document ID: " + node.properties["alvexdt:id"] );
var choice = task.getVariableLocal('example_my-long-outcome-property-name');
var choice = task.getVariableLocal('example_myLongOutcomePropertyName');