Forum OpenACS Development: Re: Contacts package status

Collapse
Posted by Malte Sussdorff on
Dear Jon, I am really sorry you ran into these problems, but as mentioned before:

Contacts runs on 5.3 only.

After the problems we had with 5.2 and the freeze in the code of core procedures we had to make it require 5.3. Sadly this was not reflected in the .info file. This has been changed now.

With regards to deleting AMS, as AMS is package which is not only used by contacts, deleting attributes which have been created is something I would not like to do (not that I know how I could do that in the first place, making sure that no other package depends on the attribute to be in AMS).

Other than that we never tried to drop contacts to be honest. And I am pretty sure we won't be working on the drop scripts in the near future. There are still many little bugs in contacts that need to be dealt with before.

You don't need to be a voodoo master to try it out. You just have to run 5.3, and remind me to change the info file to be up to date with this dependency 😊.

Collapse
Posted by Jon Griffin on
Malte,
I did a little debugging and your sweeper proc appears to not work correctly.

set contact_package_ids [apm_package_ids_from_key -package_key
"contacts" -mounted]
foreach contact_package_id $contact_package_ids {
set default_group_id [contacts::default_group -package_id $contact_package_id]
set contact_package($default_group_id) $contact_package_id
lappend default_groups $default_group_id
}
At least in my install, the group that contacts sets up has no group type, therefore you can't add any people to it.

Again, it could be an error in my install, but as this is a somewhat live site, I don't want to do a reinstall.

Collapse
Posted by Iuri Sampaio on
Malte
I saw this thread and decide to come back to contacts pkg.
Installing on a fresh oacs HEAD (2006-11-15). I got the follow error on AMS pkg. Error on creating the AMS datamodel "ams-package-create.sql"

#-------------------------------------------------

[17/Nov/2006:16:42:13][5434.1103059888][-conn:ieee::4] Error: apm_package_install: Error installing Attribute Management System version 1.1d16: CONTEXT: SQL statement "SELECT acs_attribute_id_seq.nextval from dual"
PL/pgSQL function "acs_attribute__create_attribute" line 28 at select into variables
psql:ams-package-create.sql:138: ERROR: syntax error at or near "info" at character 62
QUERY: SELECT attribute_id, attribute_name, object_type, dynamic_p info $1 , $2 , $3 , $4 from ams_attributes where ams_attribute_id = :ams_attribute_id
CONTEXT: SQL statement in PL/PgSQL function "ams_attribute__delete" near line 11
psql:ams-package-create.sql:138: LINE 1: ...ribute_id, attribute_name, object_type, dynamic_p info $1 ,...
psql:ams-package-create.sql:138: ^
psql:ams-package-create.sql:214: ERROR: syntax error at or near "val" at character 1
QUERY: val := ams_attribute_value__value( $1 ,( select aav.value_id from ams_attribute_values aav where aav.object_id = $2 and aav.attribute_id = $1 ))
CONTEXT: SQL statement in PL/PgSQL function "ams_attribute_value__value_by_object_id" near line 6
psql:ams-package-create.sql:214: LINE 1: val := ams_attribute_value__value( $1 ,( select aav.value_id...
psql:ams-package-create.sql:214: ^

CONTEXT: SQL statement "SELECT acs_attribute_id_seq.nextval from dual"
PL/pgSQL function "acs_attribute__create_attribute" line 28 at select into variables
psql:ams-package-create.sql:138: ERROR: syntax error at or near "info" at character 62
QUERY: SELECT attribute_id, attribute_name, object_type, dynamic_p info $1 , $2 , $3 , $4 from ams_attributes where ams_attribute_id = :ams_attribute_id
CONTEXT: SQL statement in PL/PgSQL function "ams_attribute__delete" near line 11
psql:ams-package-create.sql:138: LINE 1: ...ribute_id, attribute_name, object_type, dynamic_p info $1 ,...
psql:ams-package-create.sql:138: ^
psql:ams-package-create.sql:214: ERROR: syntax error at or near "val" at character 1
QUERY: val := ams_attribute_value__value( $1 ,( select aav.value_id from ams_attribute_values aav where aav.object_id = $2 and aav.attribute_id = $1 ))
CONTEXT: SQL statement in PL/PgSQL function "ams_attribute_value__value_by_object_id" near line 6
psql:ams-package-create.sql:214: LINE 1: val := ams_attribute_value__value( $1 ,( select aav.value_id...
psql:ams-package-create.sql:214: ^

invoked from within
"db_source_sql_file -callback $callback $path/$file_path"
(procedure "apm_package_install_data_model" line 32)
invoked from within
"apm_package_install_data_model -callback $callback -data_model_files $data_model_files $spec_file_path"
invoked from within
"if { $load_data_model_p } {
apm_package_install_data_model -callback $callback -data_model_files $data_model_files $spec_file_path
..."
("uplevel" body line 53)
invoked from within
"uplevel $body "
[17/Nov/2006:16:42:13][5434.1103059888][-conn:ieee::4] Error:

Failed to install Attribute Management System, version 1.1d16. The following error was generated:

CONTEXT: SQL statement "SELECT acs_attribute_id_seq.nextval from dual&quo PL/pgSQL function "acs_attribute__create_attribute" line 28 at select psql:ams-package-create.sql:138: ERROR: syntax error at or near "info&quot QUERY: SELECT attribute_id, attribute_name, object_type, dynamic_p info $1 , id CONTEXT: SQL statement in PL/PgSQL function "ams_attribute__delete" n psql:ams-package-create.sql:138: LINE 1: ...ribute_id, attribute_name, object_ty psql:ams-package-create.sql:138: psql:ams-package-create.sql:214: ERROR: syntax error at or near "val" QUERY: val := ams_attribute_value__value( $1 ,( select aav.value_id from ams_at CONTEXT: SQL statement in PL/PgSQL function "ams_attribute_value__value_by psql:ams-package-create.sql:214: LINE 1: val := ams_attribute_value__value( $1 , psql:ams-package-create.sql:214: ^

<font color="red">NOTE:</font> If the error comes from a sql script you m the APM and try again but remember to leave the manually souced sql scipts unche

#----------------------------------------------

Debugging log error i went through the sql script "mysite/packages/ams/ams-package-create.sql"

and located the error, which I believe it's an attribuiton made gramatically wrong. But i'm not quite sure about it.

#---------------------------------

begin
val := ams_attribute_value__value(p_attribute_id,( select aav.value_id from ams_attribute_values aav where aav.object_id = p_object_id and aav.attribute_i\
d = p_attribute_id));

return v_value;
end;' language 'plpgsql' stable strict;

#-----------------------------

does anyone one know what's going on?

Collapse
Posted by Malte Sussdorff on
I will look into both things later. But did you update AMS as well ? (or did I miss the correct AMS dependency ...)?
Collapse
Posted by Iuri Sampaio on
yes it's up to date. i downloaded the entire oacs HEAD version.

"/packages/ams/ams.info"
version name="1.1d16" url="https://openacs.org/repository/download/apm/ams-1.1d16.apm";

is that correct?

Collapse
Posted by Iuri Sampaio on
Malte,
I believe i found a way out. At least, untill now it seems to work well!

I installed all the required packages first, (in a diferent installation step). Then i ran manually the script to create the datamodel (ams-package-create.sql) and finally installed the package unchecking the option "run datamodel automatically"

but the thing is if that works, why the other doesn't.
Is that the values are not passing properly?

#-----------------------------
begin
val := ams_attribute_value__value(p_attribute_id,( select aav.value_id from ams_attribute_values aav where aav.object_id = p_object_id and aav.attribute_i\
d = p_attribute_id));

return v_value;
end;' language 'plpgsql' stable strict;
#-----------------------------

Collapse
Posted by Iuri Sampaio on
so far i got an error, creating new ams-lists. The errror seems pretty simple but somehow i can;t locate it :(

[28/Nov/2006:03:14:56][3590.1099148208][-conn:conaje::3] Error: lang::message::lookup: Key 'ams.Table' does not exist in en_US
[28/Nov/2006:03:15:10][3590.1100196784][-conn:conaje::4] Error: lang::message::lookup: Key 'ams.Object_Types' does not exist in en_US
[28/Nov/2006:03:15:10][3590.1100196784][-conn:conaje::4] Error: lang::message::lookup: Key 'ams.Table' does not exist in en_US
[28/Nov/2006:03:15:12][3590.1097051056][-conn:conaje::1] Error: lang::message::lookup: Key 'ams.Table' does not exist in en_US
[28/Nov/2006:03:15:21][3590.1096002480][-conn:conaje::0] Error: Ns_PgExec: result status: 7 message: ERROR: function ams_list__new() does not exist
HINT: No function matches the given name and argument types. You may need to add explicit type casts.

[28/Nov/2006:03:15:21][3590.1096002480][-conn:conaje::0] Error: POST http://192.168.1.10:8090/ams/list-add?
referred by "http://192.168.1.10:8090/ams/list-add?object_type=party";
Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR: function ams_list__new() does not exist
HINT: No function matches the given name and argument types. You may need to add explicit type casts.

SQL:

select ams_list__new()


while executing
"ns_pg_bind 0or1row nsdb0 {

select ams_list__new()

}"
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql]"
("postgresql" arm line 2)
invoked from within
"switch $driverkey {
oracle {
return [uplevel $ulevel [list ns_ora $type $db $sql] $args]
}
..."
invoked from within
"db_exec 0or1row $db $full_statement_name $sql"
invoked from within
"if {[regexp -nocase -- {^\s*select} $test_sql match]} {
# ns_log Debug "PLPGSQL: bypassed anon function"
set selection..."
("uplevel" body line 6)
invoked from within
"uplevel 1 $code_block "
invoked from within
"db_with_handle -dbn $dbn db {
# plsql calls that are simple selects bypass the plpgsql
# mechanism for creating anonymous fun..."
(procedure "db_exec_plsql" line 57)
invoked from within
"db_exec_plsql create_object {}"
(procedure "package_instantiate_object" line 113)
invoked from within
"package_instantiate_object -extra_vars $extra_vars ams_list"
(procedure "ams::list::new" line 26)
invoked from within
"ams::list::new -list_id $list_id -package_key $package_key -object_type $object_type -list_name $list_name -pretty_name $pretty_name -description..."
("uplevel" body line 5)
invoked from within
"uplevel #$level $on_submit"
("1" arm line 1)
invoked from within
"switch $errno {
0 {
# TCL_OK
}
1 {
# TCL_E..."
(procedure "ad_form" line 625)
invoked from within
"ad_form -name list_form -form {
{list_id:key}
{package_key:text(select) {label "[_ ams.Package_Key_1]"} {options $package_options}}
{objec..."
("uplevel" body line 28)
invoked from within
"uplevel {
ad_page_contract {

@author Matthew Geddert mailto:openacs@geddert.com
@creation-date 2004-07-28
@cvs-id $Id: list-add.tcl,v 1.4 2005/0..."
(procedure "code::tcl::/home/oacsbr/conaje/packages/ams/www/list-add" 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 Iuri Sampaio on
ok done. all the installation errors seems to be gone.
I just ran all the update scripts mannually and then instanciate the pkg
Collapse
Posted by Malte Sussdorff on
Okay, the problems with AMS and contacts have been solved. I managed to install both in a vanilla installation. Now I will take a look at prepopulating contacts ...
Collapse
Posted by Iuri Sampaio on
Malte,
do you need help? It sounds weird to ask that. I don't have that experience, but i'll be glad to try.
Collapse
Posted by Malte Sussdorff on
Iuri, not weired at all. In the latest version of contacts on a fresh in stall it checks if the contacts::populate::crm procedure has been run and if not allows you to run it from the admin interface.

This should get you started with a basic CRM setting. But where you can help is if you take a look at the basic setting for CRM and decide if something is missing, then we could tune that a little bit more.

Collapse
Posted by Iuri Sampaio on
I did a search about basic setting for CRM
http://www.openacs.org/search/search?q=basic+setting+for+CRM+

and I found interesting posts about contacts pkg. including me on it!!
https://openacs.org/forums/message-view?message%5fid=387801#387938

https://openacs.org/forums/message-view?message_id=448530

Well, I decided the best approach would be learning the procedure.
I verified contacts pkg is not at https://openacs.org/api-doc/

So I tried to install contacts pkg.
I did a oacs head “fresh install” 2006-12-05 on my machine but contacts pkg now requires organizations of version >= 0.6d1.

which isn't avaible at cvs yet. the one i;ve got is
version name="0.5d4" url="https://openacs.org/repository/download/apm/organizations-0.5d4.apm";

Collapse
Posted by Malte Sussdorff on
Organizations in HEAD is currently at 0.6d2, so you might want to get this one as well from HEAD. Once you have it installed, try to use the contact::import::csv procedure which I just committed to import some of your existing data. And don't hesitate to ask questions about it, I tried to be fairly thorough in the documentation part, but it still assumes a German HEADER in the import, so this might get you confused. If you have any suggestions on how to generalize the procedure this would be highly appreciated. My first idea was to use I18N to check for the values in the header line of the CSV file (for the mapping).
Collapse
Posted by Iuri Sampaio on
Malte,
something is wrong. checking out HEAD from cvs, i;ve got
"organization v. 05.d4"

cvs -d:pserver:mailto:anonymous@cvs.openacs.org:/cvsroot co openacs-4/packages/organizations

or even full version HEAD
cvs -d:pserver:mailto:anonymous@cvs.openacs.org:/cvsroot co openacs-4

I didn't see the contact::import::cvs precedure yet, follwing your idea...
can javascript be better in this case??

Collapse
Posted by Iuri Sampaio on
Somehow I got:

version name="0.6d2" url="https://openacs.org/repository/download/apm/organizations-0.6d2.apm";

It's weird. Maybe i used wrong cvs command. But then How did i get the .06d2 version??
I tried once more using cvs and I still got 0.5d4

Anyway,
I installed contacts package. The installation ended up well, with no errors.
I'm reading API docs , I'll keep it posted

Collapse
Posted by Iuri Sampaio on
Malte,
I just downloaded oacs from CVS, cvs -d:pserver:mailto:anonymous@cvs.openacs.org:/cvsroot co openacs-4

AGAIN i have:

organizations pkg is still version 0.5d4. I overwrited and installed the one i had backed up that "somehow appeared on my machine" version 0.6d2

SO contacts installed, but I can't find the proc on APIdocs
contacts::import::cvs

we definitely have diferent releases of HEAD.
you said you commited the code...
where did you comminted?

Collapse
Posted by Malte Sussdorff on
Okay, mea culpa. For whatever the reason the higher organizations version number never got committed.. I had to do a fresh head checkout and copy things over.

As for the CSV thing, the command ist called contacts::import::csv, not contacts::import::cvs

Collapse
Posted by Iuri Sampaio on
My apologizes for the misspelling distraction.
Although contacts::import::cvs is not found.

I will leave my server up. Take a look at it:
i granted this user
usr: mailto:test@test.com
pwd: test

API docs:
http://201.12.191.182:8090/api-doc/proc-search?query_string=contact%3A%3Aimport%3A%3Acvs&name_weight=5&param_weight=3&doc_weight=2

APM
take a look at contacts and orgs pkg's version at:
http://201.12.191.182:8090/acs-admin/apm/

verify that I have contatcs is installed and it's updated.
later,

Collapse
Posted by Malte Sussdorff on
Hi Jon, indeed the sweeper proc does not run correctly. Try to run it again. The run this fix for the persons to set their names correctly (as you seem to have run the sweeper proc already).

db_foreach person {select latest_revision, first_names, last_name, email from persons p, parties pi, cr_items i where p.person_id = i.item_id and pi.party_id = p.person_id} {
ams::attribute::save::text -object_type "person" -object_id $latest_revision -attribute_name "first_names" -value $first_names
ams::attribute::save::text -object_type "person" -object_id $latest_revision -attribute_name "last_name" -value $last_name
ams::attribute::save::text -object_type "person" -object_id $latest_revision -attribute_name "email" -value $email
}

Last but not least find out what the default group for contacts is and add all the members to it.

The new sweeper proc should take care of this now.

Collapse
Posted by Iuri Sampaio on
Sorry for the confusion i made and also my delay on answer this thread,

I saw you uploaded the packages on HEAD. Plus I got the procedure on API docs.
I'll be reading it and post latter

Collapse
Posted by Jim Lynch on
When you look at posting #6 of this thread, there is a code example. At one time, the forums (or maybe bboard?) would retain indentation. Any way to get that back? The "pre" / "/pre" tag likes to double-space the code. What's the reason for that?
Collapse
27: the HTML pre tag (response to 26)
Posted by Andrew Piskorski on
Jim, this is the same question you asked back in March, right?

HTML pre tags do not "like to double-space" anything. If you're seeing that effect, you're probably doing it wrong. Try editing your HTML text differently. Remember, the whole point of "pre" is to display pre-formatted text in a fixed-width font. Pretty much all the whitespace between the tags is significant, and will be displayed.

Collapse
30: Re: the HTML pre tag (response to 27)
Posted by Jim Lynch on
Andrew,

Yes, same question :)