10-16-2018 04:52 PM
Is there a way to bind the adf-webscript-get component into a button that is in a dropdown? Because right now the calling of the webscript is happening on page reload, and what I want to do is run that when the button is clicked. Cheers!
<adf-sidebar-action-menu>
<mat-icon sidebar-menu-title-icon>arrow_drop_down</mat-icon>
<div sidebar-menu-expand-icon>
<mat-icon>add</mat-icon>
<span>Create...</span>
</div>
<div sidebar-menu-options>
<button met-menu-item
[adf-create-folder]="getDocumentListCurrentFolderId()"
(success)="onFolderCreate($event)"
title="Create New Folder">
<mat-icon>folder</mat-icon>
<span>Folder</span>
</button>
<button mat-menu-item>
<adf-webscript-get
[contextRoot]="alfresco"
[servicePath]="service"
[scriptPath]="'googledocs/createContent?contenttype=document&parent=workspace://SpacesStore/8f2105b4-daaf-4874-9e8a-2152569d109b'"
[contentType]="HTML">
</adf-webscript-get>
<span>Google Docs Document...</span>
</button>
</div>
</adf-sidebar-action-menu>
10-17-2018 05:22 AM
Hi, what the webscript does :
you could associate the same call at on whatever onClick event of your app
10-17-2018 05:22 AM
Hi, what the webscript does :
you could associate the same call at on whatever onClick event of your app
10-23-2018 04:55 PM
one more question Eugenio Romano, because I'm using a webscript to create a Google Docs, is there a way to change/construct where the Google Docs is being created? Like for instance if I want to create it inside a folder? because right now it is by default getting created in the documentLibrary folder even if I try to create it somewhere else. Thanks!
10-24-2018 06:00 AM
I guess it depends from your webscript that actually I don't know wht it does inside. I guess I need more context
10-24-2018 11:02 PM
scriptPathDocs: string = 'googledocs/createContent?contenttype=document&parent=workspace://SpacesStore/8f2105b4-daaf-4874-9e8a-2152569d109b';
Ahh got it now, in my scriptPathDocs, it has the folder documentLibrary value by default in it. Now, how will I approach this if I want the document to be created in a specific location?
10-25-2018 05:00 AM
yes you need to change it
10-25-2018 05:01 AM
i guess you need to pass a parameter to it but for the webbscript the ECM part of the community portal can help you better
10-28-2018 06:39 PM
kinda solved it by doing this by changing the scriptPathDocs, from documentLibrary folder to repository/root/Company Home folder,
scriptPathDocs: string = 'googledocs/createContent?contenttype=document&parent=workspace://SpacesStore/cd49a7d6-8e38-487f-8af4-9fed5027c8c9';
onGoogleDocsCreate() {
this.scriptPathDocs = 'googledocs/createContent?contenttype=document&parent=workspace://SpacesStore/' + this.documentList.currentFolderId;
this.apiService.getInstance().webScript.executeWebScript('GET', this.scripPathDocs, this.scriptArgs, this.contextRoot, this.servicePath).then((webScriptdata) => {
this.data = webScriptdata;
this.documentList.reload();
});
}
I am able to create a google document in any folder except in the repository/root/Company Home location. and this is the error I'm getting.
> ERROR Error: "Uncaught (in promise): Error: {
"status" : {
"code" : 500,
"name" : "Internal Error",
"description" : "An error inside the HTTP server which prevented it from fulfilling the request."
},
"message" : "09280051 Node does not exist: workspace:\/\/SpacesStore\/-root- (status:null)",
"exception" : "",
"callstack" : [],
"server" : "Enterprise v5.2.3 (r852994b1-b12) schema 10,065",
"time" : "Oct 28, 2018 10:31:15 PM"
}
10-17-2018 09:23 AM
As Eugenio Romano said you can web script on an onClick event of your app.
You can call custom web script by executeWebScript() refer this for detail:- GitHub - Alfresco/alfresco-js-api at master
Explore our Alfresco products with the links below. Use labels to filter content by product module.