Embedding Virtual Folder Component
Define global variable virtualfolderbaseurl to point to the instance of VF.
<head>
<script>
var virtualfolderbaseurl="https://portal.west-life.eu/";
</script>
</head>Then you can include some of the components of West-Life Virtual Folder in your application, e.g. using <div> tag:
<div aurelia-app="[componentname]">
<script type="text/javascript" src="https://portal.west-life.eu/virtualfolder/app.bundle.js"></script>
<script type="text/javascript" src="https://portal.west-life.eu/virtualfolder/vendor.bundle.js"></script>
Loading ...
</div>The [componentname] could be one of the following:
filepicker/main- File picker - allows to pick the file from Virtual Folder and it's WEBDAV URI is returned to managing page. See the demo at filepicker.html and filepickercomponent.html.filemanager/main- File manager - allows to browse files in defined file providers (demo view of PDB ). See the demo at filemanager.html.dataset/main- Dataset definition page - allows to define list of entries - PDB and Uniprot entries can be refined withvirtualfoldersettings/main- Virtual Folder Settings page - allows to manage file providers (B2DROP,Dropbox,Filesystem,...)
The complete example of embedded component in your web may look:
<html>
<head>
<script>
var virtualfolderbaseurl="https://portal.west-life.eu/";
</script>
</head>
<body>
<p>filemanager from West-Life VF</p>
<div aurelia-app="filemanager/main">
<script type="text/javascript" src="https://portal.west-life.eu/virtualfolder/app.bundle.js"></script>
<script type="text/javascript" src="https://portal.west-life.eu/virtualfolder/vendor.bundle.js"></script>
Loading ...
</div>
</body>
</html>Flask integration example
Several web services provided within West-Life relies on Flask python microframework. Below are few lines allowing to handle the URL sent by the VF component. In this implementation, we assume that the Flask-wtf form, instead of taking a file as input, will deal with a str that is the URL sent by the VF component. The implementation example can be found at this URL (only for DEVELOPMENT purposes, do not advertise it!!!) -> https://milou.science.uu.nl/cgi/servicesdevel/DISVIS/disvis/submit The field is declared in the forms.py:
And in submit.html:
JavaScript
HTML
Upon successful validation, we want to download the file to process them afterwards, in views.py:
Last updated