Idea Delivered
over 1 year ago

XPP Web Services API: new XppGraphic method to determine graphics Library Path

It would be useful to be able to supply a graphics Library Name to an XppGraphic method that would then return the graphics Library Path.

The putGraphic and putGraphicAsAttachment methods are already placing files in the graphics Library Path folder when passed a graphics Library Name.

I think it would prove a useful addition to the API resources available to the developer, especially when a 'roll your own' solution might be required for very large files.

  • Thanks Steve, that's very helpful.

    I had come up with something similar using grinfo but thought a new XppGraphic method might neaten things up a bit ... but I'll look forward to learning about a more RESTful solution in 9.3!

  • Paul,

    The new RESTful Web Services API that is coming out with XPP 9.3 has a method to get the path of an image/library.

    In the meantime, you can use the "UserCommand" method. Write a PERL script and drop it in $XVY_EXECS/xppws and then call "UserCommand" with the name of the script. It will get the path to the Job/Division, so give it one as the first argument to UserCommand() (but it really wont matter since you are just going to call the script and not care about the division you are in).

    The first argument will be the document path. If you add additional arguments (like the library name), your PERL script can do:

    system("iq -l xxxxxxx -p") or any other PERL way to run a program and get the output returned to the caller.

    where xxxxxxxx is the argument you retrieved in your PERL script and passed in via UserCommand.

    The captured output from the return of the UserCommand() will be the path to the library and you can then build the path by adding in the image name.

    To see what you get, just do a "iq -l default -p" from command window  to see what is output.

    There is a $XYV_EXECS/xppws/ demo script that shows how to do a basic command. Additional arguments passed in can be retrieved using @ARGV