Forum OpenACS Q&A: Project manager 1.05 released

Collapse
Posted by Jade Rubick on
I just committed project-manager, version 1.05.

Here are the changes:

Project manager

  • Improves integration with logger (Added parameters for logger integration, added in admin UI pages for logger integration, add link to logger in navbar, add in proc to get logger url)
  • Renamed the pm::task::dependency_options proc pm::task::options_list (I won't change public procs in the future, promise! Next time I'll deprecate them and so on..)
  • Moved some code from add-edit pages to procs.
  • Added ad_returnredirect messages after most form pages.
  • Allow you to edit logger variables when editing projects.
  • Took out most code from log.tcl, log.adp, etc pages (moved to logger)
  • Added parameter to hide subprojects
  • Improves appearance of admin pages.
  • Added a dependency on kernel 5.1, and newer logger and organizations.
  • Italicize the current location in the navbar
  • Fixed the function in project-manager-functions-create that creates the root folder for project manager. Upgrade script included. This allows new installs to create projects!
  • Added in pages that show the differences between versions of tasks and projects. Uses a word_diff to give you a nice looking difference between versions.
  • Fixes issues described in posts the last couple of days, and a couple of other bugs as well.
Logger
  • Added in ability to log against project-manager projects and tasks.
  • Untabify: entries-postgresql.xql (sorry won't do it again!)
  • Fixed scalability issue with one one function call per project being shown. Added in a dependency on new categories proc, which has a new proc that greatly speed up display of logger entries.
  • Italicize the current location in the navbar
  • Added in links to project-manager in the navbar, when project-manager is integrated with that instance of logger.
  • optimized the variable::get_default_variable_id proc for postgres (much faster)
  • sped up the select_users query by using persons instead of cc_users
  • sped up entries select query by using persons instead of cc_users
Organizations
  • Added a proc to return the name from an organization_id
Upgrade issues

Logger now requires a proc that is in cvs in 1.0d3, but if you already have categories 1.0d3, you may not have that proc. I can't bump categories to 1.0d4, because it's already there on HEAD, and it requires kernel 5.2.

If you notice this message when you view the project-manager or logger pages:

Error in include template "/var/lib/aolserver/intra-up/packages/logger/lib/entries": invalid command name "category_tree::get_mapped_trees_from_object_list"
then you're having this issue.

What do you need to do? You have to get the category_tree::get_mapped_trees_from_object_list proc from HEAD and copy it into your /packages/logger/lib/entries.tcl file.

Sorry for the inconvenience. I'm not sure how I could have done this differently. Perhaps I could have committed the code on the oacs-5-1 branch, and then tagged it openacs-5-1-compat, and then changed the file names in HEAD and version numbers too. Perhaps this is a lesson to me and others to leave gaps in your version numbers if you're not committing immediately?

Testing and code maturity

I've tested this install on HEAD, and on my local 5.1 install, and I'm using it in production, but I would appreciate any bug-reports, patches, etc.. Certainly there are bugs, although I think it's getting usable enough for production use.

Collapse
Posted by Richard Hamilton on
Just tried the Upgrade from OpenACS repository method to upgrade to version 1.05.

The system offers me the logger upgrade and the project manager upgrade however it reports that the upgrade is dependent on Organizations 0.3d but does not offer an upgrade for that package. This means that the other upgrades are dead in the water.

I will download 0.3d from CVS, install it and then do the upgrade but I thought I should flag it up.

Regards
Richard

Collapse
Posted by Richard Hamilton on
The proc is to be found in this file:

http://cvs.openacs.org/cvs/openacs-4/packages/categories/tcl/category-trees-procs.tcl

and copied into logger as described by Jade above.

Collapse
Posted by Jade Rubick on
Hi Richard,

I tagged the organizations package to be compatible with OpenACS 5.1, so it should appear in the remote repository list from tomorrow. Thanks for letting me know!

Collapse
Posted by Chris Davies on
currently it does show up, but has a dependency on categories 0.3d which it claims cannot be found.
Collapse
Posted by Chris Davies on
haha, I mean organizations 0.3d

doing two things at once

Collapse
Posted by Richard Hamilton on
After making this change the logger is accessible.

If I link in a project and then set the parameter to integrate the logger instance with the project manager when I next browse to the logger page I get the error again as follows:

Error in include template "/web/tradeadev/packages/logger/lib/entries": invalid command name "category_tree::get_mapped_trees_from_object_list"

Any ideas?

Collapse
Posted by Jade Rubick on
Hi Richard,

If you look at the description above, I describe how to work around this problem. Please let me know if that doesn't work.

Collapse
Posted by Richard Hamilton on
Jade,

Sorry - that post was not very clear. I had read your instructions and posted the location of the proc after I found it to help others. However although following your instructions eliminated the error on initial browsing after mounting the package, as soon as I either create a new project in the logger or link a project that already exists in the project manager, I get the error again.

Just to double check, is this the correct proc to be putting into /lib/entries.tcl

ad_proc -public get_mapped_trees_from_object_list { object_id_list } {
    Get the category trees mapped to a list of objects.

    @param object_id_list list of object to get the mapped category trees.
    @return tcl list of lists: tree_id tree_name subtree_category_id
                assign_single_p require_category_p
    @author Jade Rubick (mailto:jader@bread.com)
} {
    set result [list]

    db_foreach get_mapped_trees_from_object_list "" {
        lappend result [list $tree_id [get_name $tree_id] $subtree_category_id $assign_single_p $require_category_p]
    }

    return $result
}

Regards
Richard

Collapse
Posted by Richard Hamilton on
Ooops - just to clarify - I mean MY post was not very clear!😊
Collapse
Posted by Jade Rubick on
Hi Richard,

You need to put the following at the end of this file:

/packages/categories/tcl/category-trees-procs.tcl

----------------------

ad_proc -public get_mapped_trees_from_object_list { object_id_list } {
    Get the category trees mapped to a list of objects.

    @param object_id_list list of object to get the mapped category trees.
    @return tcl list of lists: tree_id tree_name subtree_category_id
                assign_single_p require_category_p
    @author Jade Rubick (mailto:jader@bread.com)
} {
    set result [list]

    db_foreach get_mapped_trees_from_object_list "" {
        lappend result [list $tree_id [get_name $tree_id] $subtree_category_id $assign_single_p $require_category_p]
    }

    return $result
}

---------------------------

and in /packages/categories/tcl/category-trees-procs.xql, below this section:

<fullquery name="category_tree::get_mapped_trees.get_mapped_trees">
      <querytext>

            select tree_id, subtree_category_id, assign_single_p,
                  require_category_p
            from category_tree_map
            where object_id = :object_id

      </querytext>
</fullquery>

----------------------
add this:
----------------------

<fullquery name="category_tree::get_mapped_trees_from_object_list.get_mapped_trees_from_object_list">
      <querytext>

            select tree_id, subtree_category_id, assign_single_p,
                  require_category_p
            from category_tree_map
            where object_id in ([join $object_id_list ", "])

      </querytext>
</fullquery>

---------------------

Hope that helps, and thank you for posting bug reports, and for providing all this feedback. Unfortunately, project-manager is a very complex piece of software, and I try to have it work perfectly, but it just doesn't cooperate!

Collapse
Posted by Richard Hamilton on
Jade,

I can see for myself how complex it is, and it is one of the first examples of a package that fully integrates with the whole range of OpenACS API functionality.

No-one expects it to have no bugs in it!

I think that it is a fantastic piece of work, and something that you should be very proud of.

Thank YOU for all your help. A few bug reports is the least I can do!

Regards
Richard

Collapse
Posted by Richard Hamilton on
Actually I had been eyeballing that query definition in the .xql file and wondering which version of the file needed which one, but the dotted notation of the the name threw me a bit.

I really need to learn plpgsql.

I have just tested the fix and it works.

I will keep testing and feeding back.

Regards
Richard

Collapse
Posted by Richard Hamilton on
I have done the upgrade to 1.06 but there is a problem that is preventing most functions from working.

My config file is the same for several server instances and I have not seen this problem before.

This post seems to be related and suggests that the issue may relate to a blank parameter accessed through ad_parameter but I am not clear exactly how this differs in OpenACS 5.1 (https://openacs.org/forums/message-view?message_id=16190)

Any attempt to add a task to a project or an item to a logger project results in this:

[05/Jun/2004:21:34:09][6650.49156][-conn0-] Error: GET http://63.246.8.13:8447/project-management/logger/log?project%5fid=1022
referred by "https://63.246.8.13:8447/project-management/logger/project-select"
can't use non-numeric string as operand of "!"
    while executing
"if {!$edit_p} {
        # now set up dependency options

        for {set j 1} {$j <= $number} {incr j} {
            if {![string equal $current_numb..."
    (procedure "pm::task::options_list" line 38)
    invoked from within
"pm::task::options_list  -project_item_id $pm_project_id"
    invoked from within
"if {[logger::util::project_manager_linked_p]} {

    set task_options [list]

    set task_options [pm::task::options_list  -project_item_id $pm_proje..."
    ("uplevel" body line 177)
    invoked from within
"uplevel {
          ad_page_contract {
    Add/edit/display a log entry.

    @author Peter Marklund (mailto:peter@collaboraid.biz)
    @author Jade Rubick ..."
    (procedure "code::tcl::/web/tradeadev/packages/logger/www/log" line 2)
    invoked from within
"code::tcl::$__adp_stub"
    invoked from within
"if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init tcl $__adp_stub
..."
    ("uplevel" body line 3)
    invoked from within
"uplevel {

    if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init t..."
    (procedure "adp_prepare" line 2)
    invoked from within
"adp_prepare "
    (procedure "template::adp_parse" line 30)
    invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
    (procedure "adp_parse_ad_conn_file" line 5)
    invoked from within
"$handler"
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
                $handler
            } ad_script_abort val {
                # do nothing
            }"
    invoked from within
"rp_serve_concrete_file [ad_conn file]"
    (procedure "rp_serve_abstract_file" line 60)
    invoked from within
"rp_serve_abstract_file "$root/$path""
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
            rp_serve_abstract_file "$root/$path"
            set tcl_url2file([ad_conn url]) [ad_conn file]
            set tcl_url2path_info..."

Collapse
Posted by Richard Hamilton on
OK, have tied this down - please see bug report #1891
Collapse
Posted by Jade Rubick on
This error seems to be related to the version of Tcl you are using (according to what I've read). It works on my installation.

I'll be happy to fix this. Could you send me a patch for logger and project-manager?

From what I've read this morning, we can't assume that ! will work with boolean values such as t and f, because older version of Tcl don't support it.

Collapse
Posted by Richard Hamilton on
Jade,

I haven't put the test installation into CVS so I'll just post the modified entries.tcl on the bug tracker.

There may be some other variables tested with that syntax in the application but if so I have not yet seen an error because of them.

Regards
Richard