Dynamic iframe urls through redirection

In my Jobs Management app built on Community Server I needed to display job documents.  Another in-house Document Management application already had a page that displayed documents based on jobs, so instead of designing original Chameleon controls as usual, why not iframe in an existing document management application page with some slight editing and styling.  There were security rules that could be easily handled by going with an iframe as well.  The result was that we could add job document support in less than a day. 

The screenpic below was the end result.  It looks and functions like any other Chamelon-based Jobs Management application we’ve seen thus far.

 

Creating the dynamic iframe url was interesting to me.  Perhaps still not blog-worthy, but I had to think about it a bit and was happy with the simple solution.  If you search through the Community Server Web source files you’ll find very sophisticated uses of iFrames, mostly with javascript.  This ain’t that.

The docs.aspx page holds the frame and is what you see above. A RedirectUrl property is generated with the help of base pages that are derived from CS’s context-sensitive theme page architecture.

Now on the redirection page making the hand-off to the Document Management application, I thought it was interesting how to access to the Community Server context while avoiding frame-within-page null reference exceptions.  The docsredirect.aspx page is located in the site root and inherits from CSThemePage rather than an application-specific theme page with its normal inheritance stack.  At that point you can get really groovy with dynamic url construction.

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.