plainblack.com
Username Password
search
Bookmark and Share

Asset Report

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).

System RequirementsPlease be advised: this contribution was tested with something older than WebGUI 7.5. When this contribution was uploaded there was no field for the author to fill out regarding it's requirements.
Comments
4colink: "
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. 
"
3cap10morgan: "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."
4cap10morgan: "
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. :) 
"
4cap10morgan: "
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>
"
2elnino: "
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
"
2cap10morgan: "
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!
"
2preaction: "
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. 
"
2cap10morgan: "
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. 
"
2elnino: "
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 
"
4ehab: "
I am having this exact same problem too. 

 /data/wre/prereqs/perl/bin/perl install_templates.pl
Couldn't parse JSON in config file '../../etc/'
 at ../../lib/WebGUI/Session.pm line 394

Ehab Heikal

 www.elmotaheda.com , www.mashy.com

Quote: An eye for an Eye only helps make the whole world blind

Gandhi
"
4ehab: "
After this error, I hardcoded the name of the configuration file of the site I want this on in the code where ../../etc is. The script ran fine but when i go to add the asset in the site the asset report template select box is empty although as far as i can see there is a version tag called Install Asset Report templates with list, sypnosis ( both are templates ) and Asset Report Templates as a Folder with list and sypnosis under it.

Ehab Heikal

 www.elmotaheda.com , www.mashy.com

Quote: An eye for an Eye only helps make the whole world blind

Gandhi
"
2elnino: "
hi ehab,

The only configuration file I need to modify is the
site's configuration file, right?
(/data/WebGUI/etc/www.site.com.conf)  Or is there a JSON file
somewhere. 

What did you hardcode? I'm still not able to get this to work. Thanks!

 
"
0Mallory28Nieves: "It is well known that cash can make people disembarrass. But how to act when somebody has no cash? The only one way is to try to get the mortgage loans or short term loan. "
DownloadAssetReport.zip AssetReport.zip
LinksNo Support Offered
Statistics Downloads: 471
Views: 5254
Rating: 3
Updated: 5/15/2007
Keywords Assets
NavigationBack to the Bazaar
© 2018 Plain Black Corporation | All Rights Reserved