Movatterモバイル変換


[0]ホーム

URL:


In: content-servicesIn: All docs
Close
Alfresco Content Services

Adding AMD packages (Aikau)

In this tutorial you will learn how to add AMD packages via Extension Modules, rather than having to editsurf.xml.

This tutorial assumes you have completed theCustomizing Share Header tutorials. In thissection you had to add thetutorials package by editingsurf.xml. As this is a system file it can only be done by administrators, and is therefore somewhat inconvenient for the deployment of third-party extensions. To get around this issue it is now possible (from 4.2.2 onwards) to add new packages via an extension module.

  1. Open theaio/aio-share-jar/src/main/resources/alfresco/web-extension/site-data/extensions/aio-share-jar-example-widgets.xml file.

  2. Add the following module:

    <module>  <id>Add a Custom Package</id>  <version>1.0</version>  <auto-deploy>true</auto-deploy>  <configurations>    <config evaluator="string-compare" condition="WebFramework" replace="false">      <web-framework>        <dojo-pages>             <packages>                 <package name="custompackage" location="js/custompackage"/>             </packages>        </dojo-pages>      </web-framework>    </config>  </configurations></module>
  3. Start the server:

    /all-in-one$ ./run.sh build_start
  4. Log in to Share. Use the View Source facility of your browser to view the source code for any page.

    You will see a list of loaded packages, such as the following:

    var dojoConfig = {   baseUrl: "/share/res/",   tlmSiblingOfDojo: false,   async: true,   parseOnLoad: false,   packages: [      { name: "alfresco", location: "js/alfresco" },      { name: "tutorials", location: "js/tutorials" },      { name: "custompackage", location: "js/custompackage" },      { name: "surf", location: "js/surf" },      { name: "dojo", location: "js/lib/dojo-1.9.0/dojo" },      { name: "dijit", location: "js/lib/dojo-1.9.0/dijit" },      { name: "dojox", location: "js/lib/dojo-1.9.0/dojox" }   ]};

    Ensure that the new package,custompackage is in the list.

Edit this page

Suggest an edit on GitHub
By clicking "Accept Cookies", you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.View Cookie Policy.

[8]ページ先頭

©2009-2025 Movatter.jp