Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Is it possible to read an attached file from a javascript?

  Hi,
I'd like to create a calculated value script attribute customization. This script needs to read a file (a txt configuration file). Is it possible to attach this file to the process (in the process links) and read it from javascript?
Which url I can use to access it?

Thanks,
Michele.

0 votes


Accepted answer

Permanent link
JavaScript provides a way to configure the attribute customization. This data is provided from the process configuration source by the framework. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Configuring_additional_script_pa
This should be used to configure the scripts, as it is the built in fastest method to do so.

Since JavaScript is run on the Client as well as on the server, you would need to use some mechanism based on html to access external data. It would likely have to be published by some Web Server similar to how the http filtered value provider uses such data.

Doing excessive customization using JavaScript, especially with accessing remote data, can crate performance issues and ruin it for the users.

Michele Pegoraro selected this answer as the correct answer

0 votes

Comments

 The problem is that this configuration is too big to being included in process configuration (it is like a catalog) and we don't have external web server to publish it. I was supposing that having process attachments they could be accessed in some way, like a public url (as, I imagine, the icons)

The icons are packaged in the Java Bundles.
I don't believe you can access a file, especially as you would need do be able to do that from the client as well as the server. I might be wrong, but it would likely a huge security breach, if you could.

Should I add that, if the file is that big, it is probably a bad idea to try to load it every time the script is run?

1 vote

Yes, you're definitely right. The best thing would be to create a provider service as you suggest but unfortunately we cannot do it. We'll resolve reading the file with a server side advisor, which is not what the user wants but it will be sufficient.

Thanks,
Michele.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937
× 152

Question asked: Apr 16 '15, 6:53 a.m.

Question was seen: 5,062 times

Last updated: Apr 21 '15, 5:23 a.m.

Confirmation Cancel Confirm