cancel
Showing results for 
Search instead for 
Did you mean: 

Aikau custom page

tavvolley
Champ on-the-rise
Champ on-the-rise
hi, i have some problem with new aikau framework.

I must import some file so I have created a page and into the page i inserted:
-a picker that select a folder where import the file.
-a button that check some config file and split xml…
-a button to import the file (it is possible to import without check, the important is to select a folder where put the new file).

I have create a base page, I added three div and in each div I added one region. In the first region I added the code for the picker but this solution not work :-(.
when I import a region into the page, alfresco insert the script but he didn't refresce (draw to the screen) the picker, seem that alfresco does not compile the code into script tag.

this is the output of the page of the first div:

<div style="height:100px;background-color:red;" id="imp-select-folder-div">
         <script type="text/javascript">//&lt;![CDATA[
require(['surf/f1c5d90ba57a308c459f5e39ac094e07','dojo/domReady!'], function(Page) {
var p = new Page({services:["alfresco\/dialogs\/AlfDialogService", "alfresco\/services\/DocumentService", "alfresco\/services\/SiteService"],widgets:[{"name": "alfresco\/forms\/Form", "config": {"okButtonPublishTopic": "FORM_CONTENTS", "widgets": [{"name": "alfresco\/forms\/controls\/ContainerPicker", "config": {"name": "document", "label": "Choose a Folder"}}]}}],publishOnReady:[]
}, 'content');
});
//]]&gt;</script>
   </div>

i have the code but i don't see the widget.


I created an aikau page and into the model of the page I include the picker and it work fine.

Now I ask how can create the page?

-I must create the picker and push into the page all button?
-can I get the dom of the page (write html into ftl file) and with aikau insert the button where i want?
-how can handle the button event? I must create a wigets for all buttons and insert the code into js file that import into the dependency of the widget like this:


….
<web-framework>
            <dojo-pages>
              <packages>
                <package name="example" location="js/example"/>
              </packages>
            </dojo-pages>
          </web-framework>
….

thanks
3 REPLIES 3

ddraper
World-Class Innovator
World-Class Innovator

I would definitely recommend that you work your way through the Aikau tutorial on GitHub as this will give you a better understanding of how you should go about building pages using Aikau.

It looks like you're just trying to provide an option to upload and then allow the user to select the location to upload to?

There are a number of widgets and services available out of the box for this... the "alfresco/services/FileUploadService" or "alfresco/services/UploadService" is available to take care of your upload needs (I would recommend the latter). 

There is a container picker that can be used for selecting folders and a button widget (among many other options) for launching actions. There is also a file select form control for choosing files from your operating system

You might need to write a custom service to tie this altogether, but essentially it sounds like what you want to do is to have a button that publishes a request to the DialogService to show a dialog form with a container picker and a file select form controls... when that form is submitted it will want to publish a request to the FileUploadService to upload the selected file to the selected folder.

ddraper
World-Class Innovator
World-Class Innovator

I actually forgot that we more or less already have an Aikau widget that does exactly what you want... you should check out the UploadTarget widget. It is used in one of our unit test pages. If you clone the Aikau repository and follow the setup instructions you can test it out in the unit test application.

ddraper
World-Class Innovator
World-Class Innovator

FYI... I've written a blog post working through this use case as best I can from the description provided.