As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<alfresco-config> … <config evaluator="string-compare" condition="DocLibActions"> <actions> <action id="set-bill-type" type="javascript" label="label.action_setBillType"> <param name="function">onActionSetBillType</param> <evaluator>evaluator.doclib.action.isContentType</evaluator> </action> </actions> <actionGroups> <actionGroup id="document-browse"> <action index="500" id="set-bill-type" /> </actionGroup> </actionGroups> </config> …
<config evaluator="string-compare" condition="DocLibActions"> <actions> <action id="change-type" type="javascript" label="label.my_action_changeType"> <param name="function">onActionChangeType</param> <permissions> <permission allow="true">Write</permission> </permissions> <evaluator>evaluator.doclib.action.isContentType</evaluator> </action> </actions> <actionGroups> <actionGroup id="document-browse"> <action index="400" id="change-type" /> </actionGroup> </actionGroups> </config> <config evaluator="string-compare" condition="DocLibCustom" replace="true"> <dependencies> <js src="/js/custom-documentlibrary-actions.js" /> </dependencies> </config>
YAHOO.Bubbling.fire("registerAction", { actionName: "onActionChangeType", fn: function my_onActionChangeType(record) { var jsNode = record.jsNode; var currentType = jsNode.type; var displayName = record.displayName; var actionUrl = Alfresco.constants.PROXY_URI + "slingshot/doclib/type/node/" + jsNode.nodeRef.uri; this.modules.changeType = new Alfresco.module.SimpleDialog(this.id + "-changeType").setOptions({ width: "30em", templateUrl: Alfresco.constants.URL_SERVICECONTEXT + "modules/documentlibrary/change-type?currentType=" + encodeURIComponent(currentType), actionUrl: actionUrl, firstFocus: this.id + "-changeType-type", onSuccess: { fn: function my_onActionChangeType_success(response) { YAHOO.Bubbling.fire("metadataRefresh", { highlightFile: displayName }); Alfresco.util.PopupManager.displayMessage({ text: "El tipus del document " + displayName + " s'ha canviat correctament" }); }, scope: this }, onFailure: { fn: function my_onActionChangeType_failure(response) { Alfresco.util.PopupManager.displayMessage({ text: "Error en canviar el tipus del document " + displayName }); }, scope: this } }); this.modules.changeType.show(); } });
<bean id="evaluator.doclib.action.isContentType" parent="evaluator.doclib.action.nodeType"> <property name="allowSubtypes"> <value>false</value> </property> <property name="types"> <list> <value>cm:content</value> </list> </property> </bean>