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

Access repository files from other things

SOLVED
Yoshihiko.N
Regular Member

Access repository files from other things

Hi All,

We'd like to access files in repository folder of ThingA from another things which are in the same project like ThingB.

Can we do that ?

 

img.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Access repository files from other things

Hi @Yoshihiko.N 

 

This is definitely possible to copy files from one Repository to another. Please refer to this  link for more details on how to achieve this use-case.

 

You can also make use of Copy Service of FileTransferSubsystem which gives an option to select source and target repository.

 

Do revert back for further query.

View solution in original post

5 REPLIES 5

Re: Access repository files from other things

Hi @Yoshihiko.N 

 

This is definitely possible to copy files from one Repository to another. Please refer to this  link for more details on how to achieve this use-case.

 

You can also make use of Copy Service of FileTransferSubsystem which gives an option to select source and target repository.

 

Do revert back for further query.

View solution in original post

Re: Access repository files from other things

@suverma 

Thank you for your quick response.

I confirmed we can use "copy" service in "FileTransferSubsystem".
and I have one more question.

 

How can we call the copy service from services in other things ?

if you provide me code example, I'd be happy.

img.PNG

Re: Access repository files from other things

Hi @Yoshihiko.N 

 

You can try something like below in your custom service where Thing A and Thing B can be your source and target repository: 

Spoiler

var params = {

async: false /* BOOLEAN */,

sourceRepo: "RepoThing" /* STRING */,

targetRepo: "TargetRepo" /* STRING */,

targetFile: "Openssl command.txt" /* STRING */,

targetPath: "/" /* STRING */,

sourceFile: "Openssl command.txt" /* STRING */,

sourcePath: "/" /* STRING */,

timeout: undefined /* INTEGER */

};

// result: INFOTABLE dataShape: FileTransferJob

var result = Subsystems["FileTransferSubsystem"].Copy(params);

Re: Access repository files from other things

@suverma 

Really appreciate for your super quick response !!!

 

I'll try it !!!

Re: Access repository files from other things

Hi @Yoshihiko.N 

 

If the last shared response has resolved our query, please mark the appropriate response as the Accepted Solution for the benefit of others with the same problem.

 

Regards,

Sudeepta

Announcements

Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.