Make file appear before folder in a directory in iHub

ActBirtUser
edited February 11, 2022 in Analytics #1
<p>Hi, I have been following this forum since past few months and it is a great place to exchange ideas.</p>
<p>Recently I have a scenario where I was asked by a user to keep the report design file at the very top level( in his home folder) so he could run the report on demand soon after he visits his home folder.</p>
<p>There are some files and folders in his home folder.</p>
<p>I tried '1TestReport'(number and also some special characters before the file name) but no matter what the folder appears first.</p>
<p>Is there a way to make the file appear at top level?</p>

Comments

  • <p>Hi, I would appreciate if anyone has any inputs/suggestions.</p>
  • <p>This would require a customization in the Information Console JSP.  What version of commercial BIRT are you using?</p>
    <p> </p>
    <p>After you have replied to this thread, I will move it to the iHub Forums.</p>
    Warning No formatter is installed for the format ipb
  • <p>Hi Clement, below are the iHub and Designer client commercial BIRT versions I'm using.</p>
    <div>iHub: BIRT iHub 3.1.1</div>
    <div>Actuate BIRT Designer Professional Version: 4.2.3</div>
    <div> </div>
    <div>Thank you.</div>
  • <p>The JSP file, <strong>details.jsp</strong>, under <em>...Actuate3\BIRTiHubVisualization\modules\BIRTiHub\iHub\web\iportal\iportal\activePortal\private\filesfolders\views</em> can be modified so that files are displayed before folders.</p>
    <p> </p>
    <p>You can even add in logic to determine to detect if it's a specific user by getting the username via userinfobean.getUserid();</p>
    <p> </p>
    <p>Backup <strong>details.jsp</strong> before making any changes.</p>
    <p> </p>
    <p>One option is to use the <strong>categories.jsp</strong> as a base.  You'll find the folders section block and then move that to the after the "Items You Can Run" section.  After moving the block of code, <em>save as</em> details.jsp to replace the existing details.jsp file.</p>
    <p> </p>
    <p>A second option is to edit <strong>details.jsp</strong>, and then iterate over the Files collection and re-sort it.  Currently, the list of files and folders returned is an alphabetical folders first, then an alphabetical files list.</p>
    <p> </p>
    <p>A third option is to edit details.jsp (less efficient), and then duplicate the block where it iterates over the entire list:</p>
    <pre class="_prettyXprint">
        <logic:iterate id="item" collection="<%= files %>" type="com.actuate.schemas.File" indexId="currentIndex" >
         ...
        </logic:iterate></pre>
    <p>And then check in the first block if each item.getFileType().equalsIgnoreCase("directory") is false.  That will list the files.  Then the next block will check if item.getFileType().equalsIgnoreCase("directory") is true, which will be the list of folders.</p>
    Warning No formatter is installed for the format ipb
  • <p>Hi Clement, thank you so much for providing multiple solutions.</p>
    <p>I will look into those and try to test on uat before I make changes to prod.</p>
    <p>I will let you know if I have any issues.</p>
    <p>Thanks again.</p>
  • <p>Hi Clement, I have a question on the 2nd option(edit details.jsp).</p>
    <p>If I re-sort it to make files appear first, then will that effect all the directories in iHub?(all folders under documents).</p>
    <p>If yes, then is there a way we can do customization to make files appear first for only one directory?(a particular folder under documents directory).</p>
    <p>I see you mentioned "<span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">You can even add in logic to determine to detect if it's a specific user by getting the username via userinfobean.getUserid();", so this will only effect that particular user's home directory.</span></p>