Encryption causes Custom Map Creating script to fail?
Jul 23, 2012 1:51 PM(1372 views)
I'm writing a program in JMP 10 where an integral component is the automatic generation of the three files *-XY.jmp, *-Name.jmp, and *-Data.jmp that are necessary to define map shapes in Graphbuilder using the Custom Map Creator Addin. The "Shape Name Use" Map Role in the *-Data.jmp file seems to want an absolute file path location for the *-Name.jmp file, so I have it save that datatable in the "$TEMP\" directory and then refer to its location as such in Map Role property of the *-Data.jmp file. It's been working perfectly for weeks now with no issues.
Now that the rest of the program is ready for its first beta distribution I encrypted the code in preparation to send it out to the test group members. Now that the program is encrypted however, it can't locate the *-Name.jmp file I saved, and thus displays a bunch of blank white graph builder windows, and the message "Map shapes not found: <list of all shapes>" under each one. I've verified that the file is still being created in the right location exactly as it was before, and that if I open the datatable for one of the empty graphs and look at the map role property of the Name column, it does list the correct location of the file there. But for some reason I can't get it to actually display the map shapes without decrypting the script file.
If anyone has any speculations as to why this is happening, how it can be fixed, or if there is any other way to point the *-Data.jmp file to the *-Name.jmp file without an absolute path, please let me know.
Not sure it will work, but have you tried using an addin for your application? You can put your datasets into the addin directory and refer to them by the addin "logical" name. For example, if your addin is defined by (com.abc.def.myapp), then you can use it like this:
Okay, I found a step in the right direction. There are two main scripts: one's a GUI, and that calls the main "make stuff happen" function that creates the custom maps. I made an addin that includes the two main files, and altered the code so that any other files are created in the program's addin folder. The GUI script file can be encrypted just fine, and still read and write to other files normally. The code in the main function script however, can't be encrypted without the missing map shapes problem described in the original post.
What I then noticed was that with the encrypted script only, the *-Name.jmp file was assigning the "Name" column the "map role" property, but /was not/ specifying it as "Shape Name Definition," it just left it blank. That would explain why changing the location doesn't seem to help, even though the map role "Shape Name Use" is seeing the correct file path and the file is generated in the right place. The un-encrypted script specifies the role just fine. Any ideas on how to make this work? The program makes a bunch of maps, so it needs to be done in sequence, not after the fact. Maybe make a custom function or just take out a line of code and stick it in a separate unencrypted file and include it at the right spot? This is kind of bizarre, if the decryption is changing the code.
As a side note, is the$ADDIN_HOME designation available in JMP 9? I believe addins were introduced in JMP 8, but I'd like to be sure that JMP 9 JSL interpreters will be able to understand that.