AnsweredAssumed Answered

Page creation with Aikau

Question asked by mario.fliegner on Jul 22, 2015
Latest reply on Sep 1, 2015 by ddraper
Servus folks,

I appreaciate some help about an Aikau customization to solve my first example with this framework.
I'm trying to create a new page (by using Aikau) that does a simple search and return the result. In addition, I want to invoke the page (the webscript) already with some parameter.

1) How can I pass request parameter via the webscript to my page that includes my own widget?
Example call of my new page: http://localhost:8080/share/page/dp/ws/myModuleWebscript?id=1234&like=donuts
How do I get the "id" and the "like" and how can I pass it to my widget I've created for my page? These are my webscript files:

myModuleWebscript.get.desc

<webscript>
   <shortname>My Module Webscript</shortname>
   <description>Fancy test of first Aikau module</description>
   <family>Share</family>
   <url>/myModuleWebscript?id={anyId}&amp;like={whatever}</url>
</webscript>


myModuleWebscript.get.html.ftl

<@processJsonModel group="share"/>


myModuleWebscript.get.js

var pageTitle = {
    id: "SET_PAGE_TITLE",
    name: "alfresco/header/SetTitle",
    config: {
        title: "myModule Title"
    }
};

var columnAlfrescoLogo = {
   name : "alfresco/logo/Logo",
   widthPx : "80",
   config : {
       logoClasses: "alfresco-logo-only"
   }
};

var columnSearch = {
    id: "CON_SEARCH_COLUMN",
    name: "myModule/MyModuleWidget",
    widthPc : "50",
};

var columnResult = {
    id: "CON_SEARCH_RESULT",
    name: "alfresco/documentlibrary/views/AlfTableView",
    widthPc : "50",
};

model.jsonModel = {
    widgets : [ {
        name : "alfresco/layout/HorizontalWidgets",
        config : {
            widgetMarginLeft : "5",
            widgetMarginRight : "5",
            widgets : [ pageTitle, columnAlfrescoLogo, columnSearch, columnResult ]
        }
    } ]
};



2) In addition I've created the mapping xml in site-data/extension and finally all required files for my own widget (like mentioned here: http://ohej.github.io/alfresco-tutorials/tutorial/aikau/tutorial.html#part-one-creating-a-page). The page will be displayed fine so far (see attached screenshot).
Now, what I want to know is: How can I submit the textbox to another webscript that does the search and how I can receive the results of this instantly on the right in the table?
Maybe the JS file of the widget is interesting at this point? I've attached it…

Thanks for any hints, proposals and approaches to solve that!

BR,
Mario

Attachments

Outcomes