03-05-2016 07:05 AM
<div style="height:100px;background-color:red;" id="imp-select-folder-div">
<script type="text/javascript">//<![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');
});
//]]></script>
</div>
….
<web-framework>
<dojo-pages>
<packages>
<package name="example" location="js/example"/>
</packages>
</dojo-pages>
</web-framework>
….
09-15-2016 06:26 AM
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.
09-16-2016 06:15 AM
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.
09-20-2016 05:21 AM
FYI... I've written a blog post working through this use case as best I can from the description provided.
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.