Integration and security

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
abowsher
Propeller Head
Posts: 10
Joined: Thu Feb 18, 2016 8:53 am

Integration and security

Post by abowsher »

So... I'm hoping this is just a stupid question and others have solved this... let's say we have a share drive where business users can publish their output whenever they want. This output is used for online help of a web application.

The web app is served by Tomcat. Tomcat can serve static files, but not in a secure fashion (that I can find). So instead, we put access to the docs from the file system behind some code (several layers deep in a controller but you can think of it just like a Java servlet) in the web application so that we can apply application security, pull up the help content from the file system and serve it back to the browser on each request for help.

The initial file in a quick test project, Default.htm, comes back correctly. As that page fires browser requests to pull back the javascript, they are returned correctly to the browser, and also /Data/HelpSystem.xml is retrieved. But in the browser console we get the following error:

MadCapAll.js:22 Uncaught TypeError: Cannot read property 'IsAbsolute' of null

If I load this help sample into the browser (Chrome) directly from the file system, everything works properly.

Any suggestions? Is there something obvious we're missing? Or is there a better or more standard approach to securing the content?

Thanks!
abowsher
Propeller Head
Posts: 10
Joined: Thu Feb 18, 2016 8:53 am

Re: Integration and security

Post by abowsher »

Hmmm... in the meanwhile, I tested serving up the output as Tomcat static files (no app-level security), and it worked. My guess was that the content-type on the return was different. Sure enough, fiddling with those in the app got me a bit closer - I'm getting a lot better output now, it is failing in the browser console with this error:

Uncaught Error: Syntax error, unrecognized expression: [data-'Times New Roman'-offcanvas]
MattyQ
Sr. Propeller Head
Posts: 136
Joined: Tue Sep 30, 2014 7:10 am
Location: Roanoke, VA

Re: Integration and security

Post by MattyQ »

Edit: Sorry, I think I dropped mine in as you were posting your second. Sounds like this is probably not super relevant now.

In your Target, on the Performance tab, there is an option to Condense JavaScript Files.
condenseJS.png
MadCapAll is basically a minified collection of other MadCap Javascript files. If you clear the check box, when you generate the output, there will be a number of JavaScript files included with your project, as opposed to just the MadCapAll.js file. If you try serving this version through the web app, and encounter the error again, it should give you a more direct file and line reference, so someone could debug what the issue was in the script. Just a suggestion as a possible way to investigate.
You do not have the required permissions to view the files attached to this post.
abowsher
Propeller Head
Posts: 10
Joined: Thu Feb 18, 2016 8:53 am

Re: Integration and security

Post by abowsher »

I appreciate the suggestion, I may use that at some point.

What I ended up doing was using all the mime-types defined by Tomcat. Then I handle files different if the mime type is text/ or not - processing the file essentially as text vs binary and setting the response headers accordingly... everything is working now. Just need to sort out how to handle caching... but wanted to post back that this ultimately worked.
Post Reply