Topic Options
Rate This Topic
#61530 - 04/18/03 09:34 AM Command Line Export Tool
Anonymous
Unregistered


I try to write a command line export tool using scripting language.
I want a way to export data in .arx file format using selection query in a command line envirronement.
The only way i find to do this is using PHP and database connections.
At this time I've some beta code that i created but it's not perfect for sure.
I can't export diay fields and the script bug in big forms.
I've stated from this idea:

SCHEMA "Group"
FIELDS "Request ID" "Creator" "Create Date" "Assigned To" "Last Modified By" "Modified Date" "Status" "Long Group Name" "Comments" "Status-History" "Group Name" "Group ID" "Group Type" "Floating Licenses" "Floating FTS Licenses" "Instance ID" "Object ID" "Group Number"
FLD-ID 1 2 3 4 5 6 7 8 9 15 105 106 107 115 116 490000000 490000100 536870914
DTYPES CHAR CHAR TIME CHAR CHAR TIME ENUM CHAR CHAR CHAR CHAR INTEGER ENUM INTEGER INTEGER CHAR CHAR CHAR
DATA "000000000000001" "AR System" 686681097 "" "AR System" 686681097 0 "superuser to the AR System" "Users who are members of this group have unlimited access to the AR System. They can\r\nperform any legal operation, including restructuring of the schemas and deleting of\r\nentries. They can view the entire contents of any entry and change the values for\r\nany field that is NOT a system field." "686681097AR System" "Administrator" 1 2 0 0 "" "" ""

If we can recreate the same file structure than this we can export data using selection criteria.
If you are interrested by this code or evolution of this one, just reply to this thread.

Top
#61531 - 12/13/03 07:22 PM Re: Command Line Export Tool [Re: Anonymous]
Anonymous
Unregistered


Hi...

I have successfully built a wrapper-script around the runmacro-command delivered by Remedy.

The run-macro-command can then be used to do the detailed export. The wrapper-script is just feeding it parameters for the startup.

For safety, the wrapper could:
* check the data in the form on the AR-Server
* check the output of the runmacro-tool
* check the exported datafile

If everything match up (concerning number of entries), you probably have a good export.

Its better to use something that is delivered along ARS as a standard tool than to fidle with the details yourself. It will probably break in the future. In addition it is like discovering the wheel again.

------
Quick

Top
#61532 - 02/09/04 03:51 AM Re: Command Line Export Tool [Re: Anonymous]
Anonymous
Unregistered


Hi, could you provide a link to this script ?
Thanks in advance.

Top
#61533 - 02/09/04 07:06 AM Re: Command Line Export Tool [Re: Anonymous]
Quick Offline
Stealth Member
*****

Registered: 12/14/03
Posts: 111
Loc: Oslo/Norway
Hi...

I don't consider my script as something I want to give away yet. This is mainly because I am fidling around with it still. I don't find any spare time to end it and pack it down for somebody else to use.

If I slip it away, it will just produce a lot of noise for me

Anyway some details about my script:
* it's written in python
* some tools to access ARS is done in perl (ARS-perl)
* using tk-widgets so there is a nice gui
* configuration, selections of forms to dump, progress is all in gui
* underlying tool is runmacro

A clip from the log shows the dumping of a single form. The parameters to the runmacro.exe tool is visible (the password is however masked in the log-output).

=======> START FORM Group
Dumping form Group
8 record(s) found in the form
C:\buffer\wbin\ars51\servers\ar03\runmacro.exe -f "Group" -x "ar6c" -U "Demo" -t "arx" -o "c:\data\dump\dump_2004-1-20_13-36-29\Group" -P "**********" 2>&1
Action Request System Runmacro.exe Version 5.1
Remedy, a BMC Software company. Copyright (c) 1991-2003 BMC Software, Inc. All rights reserved.

Accessing server - ar6c ...

Processing form - Group ...
Processing complete with total matches of 8 record(s).

Server - ar6c access complete with total matches of 8 record(s).


8 record(s) reported by the runmacro-tool
8 record(s) found in the exported file
=======> END FORM Group


It's not difficult to make something that works. It just a consideration of how fancy you want it. At the moment I have given priority to the fancy stuff (GUI) instead of the stability.

So at the moment status is:
* some bad errors can be triggered if the GUI is not used correctly
* to many tools have to be installed (perl, ARS-perl, python, tk)
* it's not intuitive to use, so it has to be documented (not fun yet for this tool)
* consider putting in some threads to avoid lock-up of application during dump of forms with lots of data.

If I am able to complete this someday, I probably make it public.
_________________________
------
Quick

Top