2013-06-10 3 views
3

나는 야외 활동을하는 초보자입니다. 야외에서 다음 작업을 수행하고 야외 공유의 수정을 반영하려고합니다. 내가하려고하는 것은 복사 기능과 동일한 XCopy라는 새로운 규칙 동작을 만드는 것입니다. 이름 만 다릅니다. 주어진 폴더에 대해 정의 된 규칙으로 첨부 할 수 있어야하며 복사 할 파일 위치를 받아 들여야합니다.Alfresco 4에 사용자 정의 작업 - 규칙을 추가하십시오.

alfresco 모듈의 스프링 구성은 정상입니다. 하지만 공유 모듈 구성과 혼동 스럽습니다. 아무도 내 사용자 지정 작업을 공유에 추가 할 수있는 방법을 제안 할 수 있습니까? 감사합니다. .

답변

3

site-webscripts \ org \ alfresco \ components \ rules \ config에있는 rule-config-action.get.config.xml은 동일한 파일 구조를 사용하여 동일한 파일을 web-extension에 복사하여 사용자 정의해야합니다. < 메뉴> < 그룹>에 맞춤 작업을 추가 한 다음 < 맞춤>에 추가하십시오. 는

<!--Custom javascript file include for detail mode --> 
<@script type="text/javascript" src="${page.url.context}/test/components/rules/config/rule-config-action-custom.js"></@script> 

하는 규칙 설정 - 액션 정의를 만들

<group> 
    <action name="copy"/> 
    <action name="move"/> 
    <action name="xcopy"/> 
</group> 
<customise> 
     <item id="select">Select</item> 
     ...... 
     <action name="copy">Copy</action> 
     <action name="move">Move</action> 
     <action name="xcopy">CreateLinkToDocument</action> <!--xcopy should be id of spring bean configured as action-executer --> 
</customise> 

이 규칙 details.get.head.ftl 및 규칙 edit.get.head.ftl 사용자 지정 자바 스크립트 JS 추가를 말한다. 주 루트 폴더에 테스트/구성 요소/규칙/config 폴더에있는 JS는

, 공유에서 파일 선택을 여는 경우에 코드 아래에있는 추가

if (typeof SomeCo == "undefined" || !SomeCo) 
{ 
    var SomeCo = {}; 
} 

/** 
* RuleConfigActionCustom. 
* 
* @namespace SomeCo 
* @class SomeCo.RuleConfigActionCustom 
*/ 
(function() 
{ 

    /** 
    * YUI Library aliases 
    */ 
    var Dom = YAHOO.util.Dom, 
     Selector = YAHOO.util.Selector, 
     Event = YAHOO.util.Event; 

    /** 
    * Alfresco Slingshot aliases 
    */ 
    var $html = Alfresco.util.encodeHTML, 
     $hasEventInterest = Alfresco.util.hasEventInterest; 

    SomeCo.RuleConfigActionCustom = function(htmlId) 
    { 
     SomeCo.RuleConfigActionCustom.superclass.constructor.call(this, htmlId); 

     // Re-register with our own name 
     this.name = "SomeCo.RuleConfigActionCustom"; 
     Alfresco.util.ComponentManager.reregister(this); 

     // Instance variables 
     this.customisations = YAHOO.lang.merge(this.customisations, SomeCo.RuleConfigActionCustom.superclass.customisations); 
     this.renderers = YAHOO.lang.merge(this.renderers, SomeCo.RuleConfigActionCustom.superclass.renderers); 

     return this; 
    }; 

    YAHOO.extend(SomeCo.RuleConfigActionCustom, Alfresco.RuleConfigAction, 
    { 

     /** 
     * CUSTOMISATIONS 
     */ 

     customisations: 
     {   
      CreateLinkToDocument: 
     { 
      text: function(configDef, ruleConfig, configEl) 
      { 
       // Display as path 
       this._getParamDef(configDef, "destination-folder")._type = "path"; 
       return configDef; 
      }, 
      edit: function(configDef, ruleConfig, configEl) 
      { 
       // Hide all parameters since we are using a cusotm ui but set default values 
       this._hideParameters(configDef.parameterDefinitions); 

       // Make parameter renderer create a "Destination" button that displays an destination folder browser 
       configDef.parameterDefinitions.push({ 
        type: "arca:destination-dialog-button", 
        displayLabel: this.msg("label.to"), 
        _buttonLabel: this.msg("button.select-folder"), 
        _destinationParam: "destination-folder" 
       }); 
       return configDef; 
      } 
     }, 
     }, 

    }); 

})(); 
참조

확인이 : http://ecmarchitect.com/images/articles/alfresco-actions/actions-article-2ed.pdf

날 당신이 필요한 모든 단계를 설명하는 좋은 예와 같은

+0

우수 답변을 더 이상 도움을 필요로하는 경우에 알려 주시기 바랍니다. – Zlatko

관련 문제