List Info

Thread: custom fields and synchronizing ogo




custom fields and synchronizing ogo
country flaguser name
Germany
2008-03-25 09:41:06
Hi,

usersopengroupware.org wrote: 
> > then I need to create it. What is the best way to
do this with an actual 
ogo 
> > version? Some years ago, I initially filled my ogo
db with 
> > contacts/enterprises using the import_perscomp.py
script. Is this still 
the 
> > best way to do, or is there, meanwhile, a better
way, using ZOGi or sth. 
> > else?
> 
> Of course, I'd recommend zOGI.  I've numerous example
sync scripts;  our
> marketing department imports contact lists via zOGI on
a regular basis.
> I think some scripts are in the archive of the
xmlrpc
> <http://mail.opengroupware.org/mailman/listinfo/xmlrpc&g
t; list.  Post over
> there for zOGI specific questions.  And there is a
relatively
> sophisticated example in the zOGI Wiki
> <http://code.google.com/p/zogi/wiki/ExampleImportSy
ncScript>
I took a look at the script, and it looks promising, that I
can tweak it, 
until it will fit my needs. Well, I don't nearly know
anything about python 
and ZOGi, so I have some questions:

I assume the two lines below the import line have to be on a
single line?
Then I see a lot of, maybe only in my eyes, magic numbers,
e.g.:

permissions = [ { 'operations' : 'rw',
                  'targetObjectId' : 970990 },
                { 'operations' : 'rw',
                  'targetObjectId' : 11530 } ] 
are 11530 and 970990 object ID values of accounts or teams
in ogo?

then, a little bit later when creating the Enterprise:
...
                 '_ACCESS' : permissions,
                 '_COMPANYVALUES' : [ { 'attribute' :
'division',
                                        'value' : 'WYC' },
                                      { 'attribute' :
'salesperson',
                                        'value' : row[0] },
...
I assume this will create all companies with a
"division" attribute with 
value WYC?

also, I don't think that this is really relevant, but I'm
wondering, what is 
the reason for this statement at the end of the script:

  if counter == 250:
    time.sleep(5)
    counter = 0
  else:
    time.sleep(0.2)
  counter = counter + 1


Do I can use ZOGi from within a different (scripting)
language, e.g. just a 
shell script? If so, are there example scripts available
somewhere too?


kind regards
Sebastian


> 
> -- 
> OpenGroupware.org Users
> usersopengroupware.org
> 
http://mail.opengroupware.org/mailman/listinfo/users
> 

-- 
OpenGroupware.org XML-RPC
xmlrpcopengroupware.org
http://mail.opengroupware.org/mailman/listinfo/xmlrpc

Re: custom fields and synchronizing ogo
country flaguser name
United States
2008-03-25 10:50:20
> I assume the two lines below the import line have to be
on a single line?

yep.

> Then I see a lot of, maybe only in my eyes, magic
numbers, e.g.:
> permissions = [ { 'operations' : 'rw',
>                   'targetObjectId' : 970990 },
>                 { 'operations' : 'rw',
>                   'targetObjectId' : 11530 } ] 
> are 11530 and 970990 object ID values of accounts or
teams in ogo?

Teams;  these permissions "rw" for teams 970990
& 11530 are set on all
imported values.  Obviously that would be different or
unnecessary
depending on the site.  They can be objectIds of accounts or
teams.

> then, a little bit later when creating the Enterprise:
> ...
>                  '_ACCESS' : permissions,
>                  '_COMPANYVALUES' : [ { 'attribute' :
'division',
>                                         'value' : 'WYC'
},
>                                       { 'attribute' :
'salesperson',
>                                         'value' :
row[0] },
> ...
> I assume this will create all companies with a
"division" attribute with 
> value WYC?

Yep.

> also, I don't think that this is really relevant, but
I'm wondering, what is 
> the reason for this statement at the end of the
script:
>   if counter == 250:
>     time.sleep(5)
>     counter = 0
>   else:
>     time.sleep(0.2)
>   counter = counter + 1

Just to pause the load;  on a production server we always
pause the load
so the load process doesn't consume an entire instance. 
This keeps the
request queue from getting so deep that interactive user
applications
notice a slow down.   Modern workstations can fire requests
at a server
at a pretty amazing rate,  even from a scripting language
like Python.

> Do I can use ZOGi from within a different (scripting)
language, 

Sure, any language that supports XML-RPC (Java, Jython, C#,
C, Perl,
PHP, etc...)

> e.g. just a shell script? 

Probably not.

> If so, are there example scripts available somewhere
too?

There are examples for Python, PHP, and Jython.
http://code.go
ogle.com/p/zogi/wiki/PHP
http://code
.google.com/p/zogi/wiki/Jython


-- 
OpenGroupware.org XML-RPC
xmlrpcopengroupware.org
http://mail.opengroupware.org/mailman/listinfo/xmlrpc

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )