cancel
Showing results for 
Search instead for 
Did you mean: 

Page creation with Aikau

mario_fliegner
Confirmed Champ
Confirmed Champ
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
2 REPLIES 2

mario_fliegner
Confirmed Champ
Confirmed Champ
Ok, I figured out that the existing "alfresco/header/SearchBox" widget does already 90% of my desired ideas. Unfortunately, as already statet in the module path it only seems to be working in a header or at least if the header is present? Nothing happens after hitting enter or choosing a result of the live search if I run it just as "dynamic page". It works only if I run it as "hybrid dynamic page". But this comes up with the full Share menu overhead that I dont need.
Is there a change to get it working if I call it via
http://localhost:8080/share/page/dp/ws/myModuleWebscript?id=1234&like=donuts
instead
http://localhost:8080/share/page/hdp/ws/myModuleWebscript?id=1234&like=donuts


http://dev.alfresco.com/resource/docs/aikau-jsdoc/SearchBox.html

Any ideas? Even still for my question with the resquest parameter?

Thanks.

ddraper
World-Class Innovator
World-Class Innovator
You should be able to use the alfresco/header/SearchBox outside of the header if you want to. We've also made a number of updates in recent versions of Aikau to make this widget much more customizable. What version of Aikau are you using? Were you aware that you could use newer versions easily from 5.0.1 onwards (see http://blogs.alfresco.com/wp/developer/2015/03/24/why-alfresco-5-0-d-will-be-a-game-changer-for-ui-d...). You might also want to take a look at some of the recent work we've done on search in general in making the AlfSearchList more customizable and to work without browser URL hashing and regular pagination.

Also, if you haven't already you should take the time to work through the tutorial on GitHub which covers a lot of the basics: https://github.com/Alfresco/Aikau/blob/master/tutorial/chapters/Contents.md
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.