Jump to content
Changes to the Jaspersoft community edition download ×

resourcesSearch in typescript

Recommended Posts

i have the below method to validate user and then retrieve the resources from jasper server. the user credentials are validated correctly. However,  the "v" varialble is always null. please advise. kindly refer me to any typscript documentation for visualizejs.

public validateUser(userName: string, password: string, organization: string): Promise<any> {    return new Promise(function(resolve, reject) {        visualize({            auth: {                name: userName,                password: password,                organization: organization            }        },        function() { resolve(); }, // successful validation        function() { reject(); },        function (v) {            console.log(v);            v.resourcesSearch({                folderUri: "/public",                recursive: true,                types: ["reportUnit","dashboard"],            }),            //utility function            function renderResults(results) {                this.resourceDetails = results;                console.log( this.resourceDetails);            }        });     });[/code]


Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

fixed as below. i guess i had to read more the typescript and angularjs framework:

public getressources(): Promise<any> {    return new Promise(function(renderResults) {        visualize({            // already authenticated, so proceed with resource rendering        }, function(v) {            v.resourcesSearch({                folderUri: "/public",                recursive: true,                types: ["reportUnit","dashboard"],                success: renderResults,                error: handleError            });            function renderResults(results) {                this.resourceDetails = results;                //console.log( this.resourceDetails);            };            function handleError(err){                console.log(err.message);                this.messageService.log(err.message);            }        });    })}[/code]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...