2017-01-20 11 views
1

나는 지금 며칠 동안 google을 검색해 왔으며 내 문제에 대한 해결책을 찾을 수 없습니다.알 프레스코 대시 렛 게시물 양식

나는 정의 프레스코 Aukai의 대시 렛창를 작성하여 거기에 양식을 배치 한 :

define(["dojo/_base/declare", 
    "dijit/_WidgetBase", 
    "alfresco/core/Core", 
    "alfresco/core/I18nUtils", 
    "alfresco/dashlets/Dashlet"], 
function(declare, AlfCore, I18nUtils, Dashlet) { 
    // First define a form... 
    var form = { 
     name: "alfresco/forms/Form", 
     config: { 
      showOkButton: true, 
      okButtonLabel: "Save", 
      showCancelButton: false, 
      cancelButtonLabel: "Doesn't Matter", 
      okButtonPublishTopic: "PUBLISH_TOPIC", 
      okButtonPublishGlobal: true, 
      widgets: [] 
     } 
    }; 
// Define a text box... 
    var textBox = { 
     name: "alfresco/forms/controls/DojoValidationTextBox", 
     config: { 
      fieldId: "EMAIL", 
      name: "email", 
      label: "Contact", 
      description: "Your e-mail address", 
      placeHolder: "[email protected]", 
      validationConfig: [ 
       { 
        validation: "regex", 
        regex: "^([0-9a-zA-Z]([-.w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-w]*[0-9a-zA-Z].)+[a-zA-Z]{2,9})$", 
        errorMessage: "Valid E-mail Address Required" 
       } 
      ] 
     } 
    }; 
    form.config.widgets.push(textBox); 
// Define a checkbox... 
    var checkbox = { 
     name: "alfresco/forms/controls/DojoCheckBox", 
     config: { 
      fieldId: "SHOW", 
      name: "showEmail", 
      label: "Show E-mail", 
      description: "Uncheck to hide the e-mail field", 
      value: true 
     } 
    }; 
    form.config.widgets.push(checkbox); 
// Update the textbox to respond to checkbox changes... 
    textBox.config.visibilityConfig = { 
     initialValue: true, 
     rules: [ 
      { 
       targetId: "SHOW", 
       is: [true] 
      } 
     ] 
    }; 
    return declare([Dashlet], { 
     /* 
     * Add padding to the body. 
     * smallpad (4px padding), mediumpad (10px padding - recommended) and largepad (16px padding) 
     */ 
     additionalCssClasses: "mediumpad", 
     /** 
     * Explicit height in pixels of the Dashlet body. 
     */ 
     bodyHeight: 200, 
     /** 
     * Id that will be used to store properties for this Dashlet. 
     * i.e. the Dashlet height when using the resizer. 
     */ 
     componentId: "component.messaging-dashlet", 
     /** 
     * The i18n scope to use for this Dashlet. 
     */ 
     i18nScope: "dashlets.MessagingDashlet", 
     /** 
     * An array of the i18n files to use with this Dashlet. 
     */ 
     i18nRequirements: [{i18nFile: "./i18n/MessagingDashlet.properties"}], 
     /** 
     * The widgets to be acting as title bar actions. 
     */ 
     widgetsForTitleBarActions: [ 
      { 
       id: "MESSAGING_DASHLET_ACTIONS", 
       name: "alfresco/html/Label", 
       config: { 
        label: "Title-bar actions" 
       } 
      } 
     ], 
     /** 
     * The widgets to be placed in the top toolbar. 
     */ 
     widgetsForToolbar: [ 
      { 
       id: "MESSAGING_DASHLET_TOOLBAR", 
       name: "alfresco/html/Label", 
       config: { 
        label: "Toolbar" 
       } 
      } 
     ], 
     /** 
     * The widgets to be placed in the body of the dashlet. 
     */ 
     widgetsForBody: [ 
      { 
       id: "HELLO_DASHLET_VERTICAL_LAYOUT", 
       name: "alfresco/layout/VerticalWidgets", 
       config: { 
        widgetWidth: 50, 
        widgets: [ 
         form 
        ] 
       } 
      } 
     ] 
    }); 
}); 

양식이 표시되지만 저장 버튼이 비활성화됩니다.

불의 버그로 확인하면 페이지에 자바 스크립트가 없음을 알립니다!

유효하지 않은 이메일 주소를 입력하면 오류 메시지가 표시됩니다.

제안 사항? 또는 대시 렛 게시의 양식에 대한 작업 예제가 유용 할 것입니다.

OptionsService를 사용하여 선택 상자를 채우는 동안이 문제를 조사했습니다.

optionsConfig: { 
    publishTopic: "ALF_GET_FORM_CONTROL_OPTIONS", 
    publishPayload: { 
     url: url.context + "/proxy/alfresco/api/people", 
     itemsAttribute: "people", 
     labelAttribute: "firstName", 
     valueAttribute: "userName" 
    } 

디버그에서 나는 이것을 볼 수는 있지만 아무런 변화가 없으며 서버에 전송 된 해당 요청이 없습니다!

이것은 내 코드에서보다 근본적인 문제를 제안하므로이 게시물과 관련하여 동일한 문제입니다.

답변

0

양식에 위젯/컨트롤이 정의되어 있지 않습니다. aikau를 사용하여 간단한 CRUD 예제를 참조하십시오

okButtonPublishGlobal: true, 
      widgets: [] 

, http://www.codingfreaks.net/2015/03/aikau-form-example-for-simple-student.html

https://github.com/Alfresco/Aikau/blob/develop/aikau/src/main/resources/alfresco/reports/TopSiteContributorReport.js

enter image description here

은이 링크에서 볼시겠습니까?

Alfresco 공유는 을 사용하고 있습니다. 사이트 기여자 Breakdown Dashlet, 입력 양식 컨트롤은 aikau를 사용합니다.

+0

그 외 여러 가지 옵션을 시도했습니다. 완전히 rearanged 코드! 위젯 추가 및 위젯 유형 변경! 모든 종류의 서비스에 서비스를 추가했습니다. 오류로 인해로드되지 않는 모든 대시 렛 또는 게시되지 않은 예상 양식이있는 대시 렛에서! Firefox와 Chrome 디버그를 모두 사용하면 버튼을 클릭 할 때 아무 것도 발생하지 않습니다. ( – user2120275

+0

나는 근본적인 것을 놓치고 있어야합니다! 가이드로 주어진 예제를 시도했지만 어디에도 없습니다. 제 문제는 예제와 관련이 있다고 생각합니다. 보고서를 작성하고 원형 차트의 이벤트에서 제출하여 대시 렛의 양식에있는 단추에서 제출을 원하는 위치로 이동합니다. 양식이 매우 혼란스럽고 예제가 매우 제한적이라는 것을 알고 있습니다. Alfresco를 Java 시스템의 대체를위한 기반으로 사용하여 개념 증명을 작성하십시오. Java 시스템의 주요 문제점은 Alfresco가 확실히 제공하는 문서 관리이므로 문제가 없습니다. – user2120275

+0

Alfresco 방식으로 기존 기능을 제공하고자합니다. 그렇게 새로운 시스템은 유능한 Alfresco 개발자가 관리 할 수 ​​있습니다. 따라서 POC 계획은 메시징 시스템을 Alfresco로 마이그레이션하는 것입니다. 이것은 편집 할 수없고 보내고받는 사람 만 볼 수있는 MESSAGE 유형의 문서를 만드는 대시 렛입니다. 문서를 첨부 할 수있는 시스템 SMS와 같은 종류입니다. 그것보다 더 복잡하지만 그 일반적인 생각. – user2120275