Hey Matt, Is there currently an easy way to retrieve images over say the REST interface, assuming I know the filename as stored in skynet (images/N.png)? Thanks, Steve
The images are exposed via the rest interface but it's in byte array form so that might not be very helpful. Sample URL: http://localhost:8080/TopicIndex/seam/resource/rest/1/image/get/json/9?expand=%7B%22branches%22%3A%5B%7B%22trunk%22%3A%7B%22name%22%3A%22languageimages%22%7D%2C%22branches%22%3A%5B%7B%22trunk%22%3A%7B%22name%22%3A%22imageData%22%7D%7D%5D%7D%5D%7D There's also: http://localhost:8080/TopicIndex/ImageFileDisplay.seam?imageFileId=9 but for that URL you need to be logged in, so that's not likely to be much help. Matt might know of some thing else but that's all I can think of.
When you say you need to be logged in, can the authentication be provided via HTTP auth in the same way as for the REST API calls?
This is probably something that needs to be answered by Matt as he knows a lot more about Seam then I do. However the part that determines if you're logged in from my knowledge is the JSESSIONID cookie. You should be able to get the cookie from logging in using form auth through the login page, but I haven't tried it myself so I can't be sure. I'd say your best bet is to wait for Matt to respond. And just to add a bit more context: Seam is responsible for handling the login details for skynet, so we actually don't really deal with low level calls such as setting the HTTP headers up. Hence why I'm not very sure.
Looking at the parsing logic the main issue here is going to be that topic tool deals with hybrid books. As a result when it is parsing and looking at image tags it only parses those which are identified by a <topic_name>.images/ relative URL prefix. This isn't possible with skynet images which just use images/<ID>.png which is basically indistinguishable from any "normal" image in a hybrid book. I think the best way to deal with this when parsing is to do the following: - When encountering an image data check the relative URL / file name. - If it matches the legacy topic syntax, use the existing logic. - If the basename contains non-numeric characters skip and move on. - If the basename contains only numeric characters see if an image can be retrieved from skynet. In the event this fails assume the image is in fact a local one and just print a warning.
For an additional challenge, this probably has to be done without adding dependencies on json and json-simple. Adding dependencies on those libraries would break the packaging of topic tool on RHEL.
Committed revision 87563.
Committed revision 87564 to toolkit repo. The topic-tool-0.1.3-1 build is now available in the ecs-toolkit repository.