AnsweredAssumed Answered

Need help on create a list of document (aikau dashlet)

Question asked by billydekid on Nov 6, 2016
Latest reply on Nov 7, 2016 by billydekid


I'm new on aikau development. My current small-project is to create a document list dashlet which the data come from my simple webscript that deployed to Repository (not to classpath). This webscript is return JSON data format and works normally (as single webscript page or application outside of Alfresco dashboard).

The simple dashlet I will build is as follow:


*It only shows part of current document properties.

The requirements for that dashlet are:

  1. Select a Department from drop down list will request a HTTP REST API, such as on simple select HTML code:
    <option value="/alfresco/service/suj/docnotify/deeds.json?usergroup=SUJ_HO_FINANCE">Finance (HO)</option>
  2. The default selection is select "All User Group" which will query all documents from whole departments, and the result will create a default table query result (all docs from all user groups).
  3. The "Download as CSV" button will request a HTTP REST API with similar URI above (#1) with only different on its extension (.csv). It will download document list in csv format for selected department.
  4. The content area (table view) is the result which parse JSON data and display as table.

Following are my study resources on aikau dashlet and widget development for this task:

  1. Adding Views to Filtered Search
  2. Aikau Widget Reference
  3. Aikau Dashlets
  4. How to Create an Aikau Dashlet for Share by Dave Draper

Until now I successfully created dashlet below:


*the logo is only for my demo of "alfresco/layout/VerticalWidgets".


With above conditions I achieved, I have some questions remaining of development to finish:

  1. How to populate the selections (options parameter) of drop down list? This DropDownButton documentation not made me clear on how to create the options. How we create the options like HTML code above? and return a JSON back. Or I got wrong component/module instead of DropDownButton?
  2. When the option is selected, then "Download as CSV" button will also update the link (change the usergroup parameter; make it the same with dropdown list on its left side). How to make this button link updated? I just think and create the simple HTML button with Javascript onclick action: onclick="location.href='/alfresco/service/suj/docnotify/deeds.csv?usergroup=IT_DEPT';" which will automatically download a CSV file.
  3. For the widget below the toolbar as the result area (table view). I just create only the HEADER (widgetsForHeader above of widgetsForBody block). This header is not shown, because I haven't created the right "table" which can capture the JSON data (CMIIW). But I already prepared it with development and documentations of: “alfresco/documentlibrary/views/layouts/Row”, “alfresco/documentlibrary/views/layouts/Cell”, “alfresco/renderers/SearchResultPropertyLink”,  “alfresco/renderers/Property”. It refer to my #1 study link above. Is it a right path to create this table widget result?


Thank you,