Forum .LRN Q&A: Re: Importing, Managing and Delivering Courses Using IMS Specifications out for Testing!

Olá para todos!

Congratulations for your work Ernie...

I try the follow steps(in postgresql 7.3.4):

-installation of dotlrn 2.0.3;
-create a class;
-upgrade file-storage to 5.1.0;
-installation of packages: lors, lorsm, lorsm-portlet, dotlrn-lorsm;

when i tryed to upload a zipped file (photoshop course),i received this error:

wrong # args: should be "lsearch ?mode? list pattern"
    while executing
"lsearch -all -exact $i_identref [lindex $resource 1"
    ("foreach" body line 3)
    invoked from within
"foreach resource $res_list {

    set find_item_id [lsearch -all -exact $i_identref [lindex $resource 1]]

    if {$find_item_id != -1} {

        foreach item..."
    ("uplevel" body line 328)
    invoked from within
"uplevel 1 $transaction_code "
    (procedure "db_transaction" line 1)
    invoked from within
"db_transaction {

    ## adds folder to the CR
    set parent_id $folder_id
    set fs_dir $tmp_dir

    # checks for write permission on the parent f..."
    ("uplevel" body line 35)
    invoked from within
"uplevel {
          ad_page_contract {
    Upload an IMS Content Package 3

    Scope:

    Add files to the CR
    Process imsmanifest.xml

    @author ..."
    (procedure "code::tcl::/web/service0/packages/lorsm/www/course-add-3" 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 7)
    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([ad_conn url]) [ad_conn path_inf..."

and this is the list of columns:

Table "public.ims_cp_manifests"
    Column    |          Type          | Modifiers
---------------+-------------------------+-----------
man_id        | integer                | not null
course_name  | character varying(1000) |
identifier    | character varying(1000) |
version      | character varying(100)  |
orgs_default  | character varying(100)  |
hasmetadata  | boolean                |
parent_man_id | integer                |
isscorm      | boolean                |
folder_id    | integer                |
fs_package_id | integer                |
Indexes: ims_cp_man_id_pk primary key btree (man_id)
Foreign Key constraints: ims_cp_man_id_fk FOREIGN KEY (man_id) REFERENCES acs_objects(object_id) ON UPDATE NO ACTION ON DELETE CASCADE

TIA
[ ]'s

Hi Felipe,

I think the reason you are getting this error is because you are using TCL 8.3. The lsearch command in 8.3 doesn't support some of the -all flag (http://www.tcl.tk/man/tcl8.3/TclCmd/lsearch.htm).

The part that in which the code is breaking is when is trying to find the correspondent resource and match it to item's identifierref. A resource can be linked (or referenced) to one of many items.

If you install TCL 8.4 (as mentioned here in the installation instructions for AOLserver, https://openacs.org/doc/openacs-5-0-0/aolserver4.html) it should work just fine. Otherwise, you can modify the code to get all the items that a single resource is referenced to... it shouldn't be hard, but it will take some time.

It does the same for files as well, so upgrading to TCL 8.4 might be the best option.

Thanks,

Ernie