WebGUI
      Click here to register.
      
irc://irc.freenode.net#webgui

iPhoneGuy: WebGUI is a pile of crap.
rizen: If WebGUI is such a pile of crap, why do you use it?
iPhoneGuy: Because it's the best pile of crap out there.

If this is what people who hate us are saying, imagine what people who love us will say. Come join us on IRC.

Asset Report

User: cap10morgan
Date: 4/18/2007 11:07 pm
Views: 2299
Rating: 14    Rate [
|
]

The configuration is very similar to the navigation asset, and indeed it is based on that (in fact, it probably has some code leftover from nav that could be gotten rid of).

This is a better, more generalized replacement for the RecentPosts macro I posted recently as well.

The zip file contains the asset module, the i18n file, the help file, two sample templates, and a template install script.

To install:

cd $webguiRoot/lib/WebGUI

unzip $path_to_AssetReport.zip/AssetReport.zip

. /data/wre/sbin/setenvironment (if not running in the WRE, skip that)

(sudo) perl install_templates.pl 

Add "WebGUI::Asset::Wobject::AssetReport" to your list of assets in your configuration file

Restart WebGUI

Update: This version now works with order by fields that aren't in the asset table (for example, you can order by a userDefinedX field in collab system posts).



Replies

Re: Asset Report
User: colink
Date: 4/18/2007 11:14 pm
Rating: 10    Rate [
|
]
Status: Approved

It needs a Help file.  You can find examples in Help/Asset_Navigation.pm, and you can always chat me up on IRC.  Be sure to make Help entries for each form and template type.

If it uses templates, you'll save yourself a lot of support time if you supply some basic, example templates.  If you look inside the upgrade scripts in /docs/upgrades, you'll see some code you can steal to create a template importing script.

I think it could also use a test script. 


Re: Asset Report
User: cap10morgan
Date: 4/20/2007 1:34 pm
Rating: 2    Rate [
|
]
Status: Approved
This has a help file, 2 sample templates, and a template install script now. I'll work on the test suite next. Please let me know if you see any other barriers to getting this included in the core.

Re: Asset Report
User: cap10morgan
Date: 4/20/2007 6:18 pm
Rating: 6    Rate [
|
]
Status: Approved

Does Navigation have a test suite? I couldn't find it.

I'm probably not up to the task of writing a whole test suite for nav + what I added on for Asset Reports. :) 


Re: Asset Report
User: cap10morgan
Date: 4/20/2007 4:59 pm
Rating: 7    Rate [
|
]
Status: Approved

Sample template that lists the asset titles, makes them links to the asset, and displays their synopses.

<tmpl_if displayTitle>
  <h2><tmpl_var title></h2>
</tmpl_if>
<tmpl_if description>
  <p><tmpl_var description></p>
</tmpl_if>
<tmpl_if session.var.adminOn>
  <tmpl_var controls>
</tmpl_if>
<div class="synopsis">
<tmpl_loop page_loop>
   <div class="synopsis_title">
      <a href="<tmpl_var page.url>"><tmpl_var page.menuTitle></a>
   </div>
   <tmpl_if page.indent>
      <div class="synopsis_sub">
         <tmpl_var page.synopsis>
      </div>
   <tmpl_else>
      <div class="synopsis_summary">
         <tmpl_var page.synopsis>
      </div>
   </tmpl_if>
</tmpl_loop>
</div>

Re: Asset Report
User: elnino
Date: 9/26/2007 10:00 pm
Rating: -2    Rate [
|
]
Status: Approved

I really want to use this, I think this will get me what I want, but after following your instructions, I'm getting a "Couldn't parse JSON in config file ''" error. I'm running 7.3.22.

It appears it's not picking up my config file?  Is there an environment variable I should be setting? I did not install webgui using WRE.

Thanks for your help!

LN


Re: Asset Report
User: cap10morgan
Date: 9/28/2007 11:56 am
Rating: 0    Rate [
|
]
Status: Approved

Usually that error means you're config file is not formatted correctly. Since you presumably just added AssetReport as a new asset type, you probably forgot to add a comment to the previous end of that list. Either that or you assumed JSON worked like Perl and you put a comma after the last element in the list too (I did this my first time editing a JSON config file). Neither will work.

JSON uses commas as field separators, so make sure you have one between each element, but not after the last element, in your lists.

Hope this helps!


Re: Asset Report
User: preaction
Date: 10/15/2007 8:21 am
Rating: -8    Rate [
|
]
Status: Approved

With your permission, I'm going to see what I can do about writing a test suite so we can get this added to WebGUI core for the next minor version.

I'll post the results here as warrants. I may add some additional features if I think they'd work well. 


Re: Asset Report
User: cap10morgan
Date: 10/15/2007 10:23 am
Rating: 0    Rate [
|
]
Status: Approved

Doug,

That would be great! Let me know if I can help!

I have a newer revision that I need to post, as well as writing up what I see as the most pressing missing features.

We should chat about this at the WUC. 


Re: Asset Report
User: elnino
Date: 10/19/2007 10:23 pm
Rating: -1    Rate [
|
]
Status: Approved

Hi. Thanks for your quick reply. I'm revisiting this project of mine again.

I guess I should have specified exactly what happened. It's when I run  perl install_templates.pl  that I'm getting the "Couldn't parse JSON in config file ''" error (read: config file doesn't seem to have a name in the error statement). So I guess I really am not aware of any config file - because your instructions say to modify the webgui config file AFTER running install_templates... So is there a JSON config file somewhere?

Thanks! I look forward to using this.

LN 


PreviousBackNext