cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Loading image file in thingworx repository to image widget in mashup

Highlighted
Newbie

Loading image file in thingworx repository to image widget in mashup

Hi,

Anyone please help me. I am uploading images to thingworx repository. But, i don't know how to access the image file and display in mashup using service. Please any one suggest, is there any way?

14 REPLIES 14
Highlighted

Re: Loading image file in thingworx repository to image widget in mashup

Hello,

In order to load the image in a mashup, you need to use the value display widget and the LoadImage service from the file repository. Here are some steps for a very basic version:

  1. Create a new mashup with a vertical layout that has one row and a header
  2. In the header, put a text box and a button
  3. Import the LoadImage service from your file repository
  4. Bind the text box "Text" field to the "path" parameter
  5. Bind the click event of the button to call that service
  6. In the row, drag and drop a value display widget
  7. Drag "Content" from "AllData" of the LoadImage service to the value display widget
  8. View the mashup and type the path to the image file and click the button.

Here is what mine looks like:

I hope this helps!

Tori

Highlighted

Re: Loading image file in thingworx repository to image widget in mashup

Hi Tori,

I have a image file Flag.jpg at location. C:\ThingworxStorage\repository (I assume its Thingworx repository)

repository.PNG

I followed the steps mentioned in above post & created Mashup. But when type /Flag.jpg in as image path and click button, image did not get displayed.

This my connections in composer.

Am I missing something?

Highlighted

Re: Loading image file in thingworx repository to image widget in mashup

Mithun, I believe it's not working in your case because you've chosen a dynamic service from the FileRepository Template itself (it doesn't know which repository to go to). You would need to either give it your repository name or select your repository directly (for example SystemRepository).

Try moving your image into SystemRepository (ThingworxStorage\repository\SystemRepository) and then use the LoadImage service on SystemRepository.

Highlighted

Re: Loading image file in thingworx repository to image widget in mashup

Thanks Ravi, it works

I have a question here

Is this SystemRepository path (C:\ThingworxStorage\repository\SystemRepository) is fixed?

What I am trying to achieve here is

1. I am using .Net SDK

2. I am create Thing there and one of its service create an image from xps doc & saved at certain location.

3. This service also returns the saved image path.

4. I have to display this image in Thingworx mashup by connecting to thing created in .Net code.

5. I could able to connect the Thing (by creating remote thing in TWX and binding it) but from from image path i could not able to display image on Mashup.

6. What I am planning here is, if this SystemRepository path is fixed then will saved the image at SystemRepository location & display it on mashup using LoadImage service on SystemRepository.

I am new to Thingworx and I am not sure I am doing it in right way or not.

Highlighted

Re: Loading image file in thingworx repository to image widget in mashup

The path is always fixed. You can create your own Repository Thing as well, instead of using the SystemRepository. Just create a new Thing based on the FileRepository Template, and the path would now be C:\ThingworxStorage\repository\Your_RepoThing

Highlighted

Re: Loading image file in thingworx repository to image widget in mashup

Thanks a lot Aanjan Ravi, will create my own repository.

Highlighted

Re: Loading image file in thingworx repository to image widget in mashup

Hi guys,

Does this solution worked? I've been trying it with no success. Can you give me some further advice?

Thanks on advance.

Highlighted

Re: Loading image  file in thingworx repository to image widget in mashup

Hello Jousue,

Yes this solution works for me.

Re: Loading image  file in thingworx repository to image widget in mashup

Can you mark the solution as correct if it works for you so others can more easily find this solution in the future? Thanks!

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________