<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Days of ... (filenet)</title><link>http://blog.yellowbluebus.com</link><description>Useful technology stuff</description><lastBuildDate>Wed, 03 Jul 2013 12:02:59 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Filenet does XSLT</title><link>http://blog.yellowbluebus.com/posts/wordpress20060412filenet-does-xslt.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;When some developer sees the XSLT first time she tries to use it the "normal" way - she builds procedural code. Resulting XSLT template will have horrendous memory footprint and will performs really slow. This is exactly what happens with Filenet Workplace.&lt;/p&gt;
&lt;p&gt;If you have been on Filenet Fundamentals or Filenet Web Framework course, you have heard that Workplace starts so slow because "the JSPs are being compiled". This is, of course, not true because Filenet Web Framework's JSPs are really small ones. Real reason lies in XSLT transformation. It uses procedural XSLT and most of the time just wastes CPU time and server memory.&lt;/p&gt;
&lt;p&gt;Of course nobody bothers to cache the results of the transformations, so the same pieces of content are compiled and transformed by XSLT processor again and and again.&lt;/p&gt;
&lt;!--adsense#links--&gt;

&lt;p&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20060412filenet-does-xslt.html</guid><pubDate>Wed, 12 Apr 2006 11:26:49 GMT</pubDate></item><item><title>This is how exceptions are handled</title><link>http://blog.yellowbluebus.com/posts/wordpress20060207this-is-how-exceptions-are-handled.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;This is how WcmController.java, the "Controller" part of FileNet Workplace's implementation of MVC pattern, handles exceptions:
&lt;p&gt;First, declare this:&lt;/p&gt;
&lt;p&gt;[java]
  private Exception            configureWindowIdException = null;
[/java]&lt;/p&gt;
&lt;p&gt;Then, in ConfigurePage function, do this:&lt;/p&gt;
&lt;p&gt;[java]
  public void configurePage(ServletContext applicationValue, HttpServletRequest request, long windowIdMode)
      throws Exception
{
          ... skipped ...
      configureWindowId(request);&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre&gt;  &lt;span class="c1"&gt;//  If configureWindowId constructed an exception, throw it.&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;configureWindowIdException&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;null&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;sp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isSignedIn&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
       &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="c1"&gt;// We attempted to propogate a window Id when not signed in&lt;/span&gt;
           &lt;span class="c1"&gt;// probably the result of signing out of an info page.&lt;/span&gt;
           &lt;span class="c1"&gt;// Don't throw.  Fix the windowId to mainWindow instead.&lt;/span&gt;
           &lt;span class="c1"&gt;//&lt;/span&gt;
           &lt;span class="n"&gt;WindowID&lt;/span&gt; &lt;span class="n"&gt;assignedId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;WindowID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
           &lt;span class="n"&gt;WindowID&lt;/span&gt; &lt;span class="n"&gt;currentId&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;WindowID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

           &lt;span class="n"&gt;assignWindowId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;assignedId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;currentId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
           &lt;span class="n"&gt;configureWindowState&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
           &lt;span class="n"&gt;postProcessWindowId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;assignedId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;currentId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;currentId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                               &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
       &lt;span class="k"&gt;else&lt;/span&gt;
           &lt;span class="n"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;configureWindowIdException&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="n"&gt;skipped&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;[/java]&lt;/p&gt;
&lt;p&gt;What about good old try-catch?&lt;/p&gt;
&lt;p&gt;There is no proper exception handling in Workplace. Should I send this piece to &lt;a href="http://thedailywtf.com/"&gt;The Daily WTF&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Technorati Tags: &lt;a href="http://technorati.com/tag/Filenet" rel="tag"&gt;Filenet&lt;/a&gt;, &lt;a href="http://technorati.com/tag/code" rel="tag"&gt;code&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20060207this-is-how-exceptions-are-handled.html</guid><pubDate>Tue, 07 Feb 2006 15:22:00 GMT</pubDate></item><item><title>Filenet Workplace inheritance</title><link>http://blog.yellowbluebus.com/posts/wordpress20060207filenet-workplace-inheritance.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;While discovering internals of Filenet Workplace I decided to create a class diagram.&lt;/p&gt;
&lt;p&gt;Here is the starting diagram:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://photos1.blogger.com/blogger/2658/494/1600/classdiagram.gif"&gt;&lt;img src="http://photos1.blogger.com/blogger/2658/494/320/classdiagram.jpg" alt="" border="0"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Apparently there is something wrong with the inheritance and everything use everything else and share the data. This is not OOP, it's good old VB style of programming done by somebody, who was converted to a java programmer by management decision.&lt;/p&gt;
&lt;p&gt;More to go...&lt;/p&gt;
&lt;p&gt;Technorati Tags: &lt;a href="http://technorati.com/tag/filenet" rel="tag"&gt;filenet&lt;/a&gt;, &lt;a href="http://technorati.com/tag/architecture" rel="tag"&gt;architecture&lt;/a&gt;, &lt;a href="http://technorati.com/tag/software+design" rel="tag"&gt;software design&lt;/a&gt;, &lt;a href="http://technorati.com/tag/uml" rel="tag"&gt;uml&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20060207filenet-workplace-inheritance.html</guid><pubDate>Tue, 07 Feb 2006 13:32:00 GMT</pubDate></item><item><title>Filenet Workplace oddities</title><link>http://blog.yellowbluebus.com/posts/wordpress20060201filenet-workplace-oddities.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;Now starting to investigate how Filenet Workplace works and how to integrate and extend it with Java Server Faces (JSF).
&lt;p&gt;Created a new web project project in Rational Software Architect and imported Workplace into it. Right after the start discovered that it fails to run on localhost. "Huh? This is strange". Looked up the source code and found that marvelous piece of code:&lt;/p&gt;
&lt;p&gt;[java]
    /&lt;em&gt;&lt;em&gt;
     * Validates HostName
     &lt;/em&gt;
     * @param hostName The host nema to validate
     * @return true, if valid.
     &lt;/em&gt;/
    public static boolean validateHostName( String hostName )
    {
        return !hostName.equalsIgnoreCase("localhost")  !validateIP(hostName);
    }
[/java]&lt;/p&gt;
&lt;p&gt;What?! It just checks for localhost and validates IP of a host name. Ok, let's look into validateIP function:&lt;/p&gt;
&lt;p&gt;[java]
    /&lt;em&gt;&lt;em&gt;
     *  Validates a String as a valid IP address.  Checks for four parts, and that
     *  each part represents a numeric value between 0 and 255.
     &lt;/em&gt;
     *  @param ipAddress
     *  @return
     &lt;/em&gt;/
    public static boolean validateIP( String ipAddress )
    {
        boolean isValid = false;&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre&gt;    &lt;span class="n"&gt;StringTokenizer&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;StringTokenizer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ipAddress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;countTokens&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;isValid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;isValid&lt;/span&gt;  &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hasMoreTokens&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;isValid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;validateUnsignedByte&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nextToken&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;isValid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;[/java]&lt;/p&gt;
&lt;p&gt;Apparently there is no validation of correct IP address and Workplace should work normally if it would be started using &lt;/p&gt;&lt;pre&gt;127.0.0.1&lt;/pre&gt;
&lt;p&gt;So I commented out first part of the code and Workspace now works on my localhost with no problems.&lt;/p&gt;
&lt;p&gt;Technorati Tags: &lt;a href="http://technorati.com/tag/filenet" rel="tag"&gt;filenet&lt;/a&gt;, &lt;a href="http://technorati.com/tag/java" rel="tag"&gt;java&lt;/a&gt;, &lt;a href="http://technorati.com/tag/code" rel="tag"&gt;code&lt;/a&gt;, &lt;a href="http://technorati.com/tag/tip" rel="tag"&gt;tip&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20060201filenet-workplace-oddities.html</guid><pubDate>Wed, 01 Feb 2006 10:08:40 GMT</pubDate></item></channel></rss>