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>
Solved! Go to Solution.
Hi, what the webscript does :
you could associate the same call at on whatever onClick event of your app
Hi, what the webscript does :
you could associate the same call at on whatever onClick event of your app
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
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!
I guess it depends from your webscript that actually I don't know wht it does inside. I guess I need more context
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?
yes you need to change it
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
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"
}
Discussions, help and advice about the Alfresco Development Framework.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.