cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
drew_baumgartel
Level III

How to open .addin stored on sharepoint site using JSL?

I've built an auto-update feature into an add-in. The new version of the add-in is stored on a sharepoint. I am able to open jmp tables from the sharepoint just fine, but am unable to open the addin file.

 

Works:

Open("https://sharepoint.xxx/jmp_table.jmp")

 

Does not work:

Open("https://sharepoint.xxx/addin_try.addin")

Open("https://sharepoint.xxx/addin_try.zip")

 

I thought maybe I could copy the add-in from the sharepoint to a local directory and then open the add-in, but that didn't work either:

Copy File("https://sharepoint.xxx/addin_try.addin", "C:\temp\addin_try.addin")

Copy File("https://sharepoint.xxx/addin_try.zip", "C:\temp\addin_try.zip")

 

The Copy File command gives a "Path is invalid" error, and the invalid path identified is a concatentation of the default directory and the URL (why?), with the URL mangled a bit:

C:\my_default_directory\C--https---sharepoint

 

Suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions
drew_baumgartel
Level III

Re: How to open .addin stored on sharepoint site using JSL?

Thank you GZ for your offline help -- I was able to solve the problem with your good advice! For any other users who have this problem, the key is to specify the location of the file differently as shown below:

 

Works

\\sharepoint.xxx.com@SSL\DavWWWRoot\(folder on sharepoint)

 

Does not work

https://sharepoint.xxx.com/(folder on sharepoint)

 

View solution in original post

3 REPLIES 3
gzmorgan0
Super User (Alumni)

Re: How to open .addin stored on sharepoint site using JSL?

@drew_baumgartel,

 

Hi Drew! If you are using JMP 14 you might want to look up in the Scripting Index > Objects > HttpRequest.

 

Here is a JMP example:

Names Default To Here( 1 );
request = New HTTP Request(
	URL(
		"https://community.jmp.com/kvoqx44227/attachments/kvoqx44227/sample-data/49/1/BlueBirds.jmp"
	),
	Method( "Get" )
);
file = request << Download( "$TEMP/BlueBirds.jmp", replace );
If( !Is Empty( file ),
	Open( file )
);
drew_baumgartel
Level III

Re: How to open .addin stored on sharepoint site using JSL?

@gzmorgan0 

GZ -- great to hear from you!

 

Thank you for the example from the scripting index. I think it's probably the right JSL, but may not work here due to security "features". When I tried the example directly from the scripting index, I got an error message similar to the one below (I tried a few other sites besides community.jmp.com to make sure it wasn't an issue with one particular website) 

 

Failed to connect to nhl.bamcontent.com port 443: Timed out

 

When I tried the same with the sharepoint location, I got a different error, even when attempting to download a jmp table:

 

HTTP/1.1 401 Unauthorized

 

Thanks for the help. I will see if I can find another location where all add-in users will have access.

drew_baumgartel
Level III

Re: How to open .addin stored on sharepoint site using JSL?

Thank you GZ for your offline help -- I was able to solve the problem with your good advice! For any other users who have this problem, the key is to specify the location of the file differently as shown below:

 

Works

\\sharepoint.xxx.com@SSL\DavWWWRoot\(folder on sharepoint)

 

Does not work

https://sharepoint.xxx.com/(folder on sharepoint)