*The construction fleet has entered our solar system and just passed that
rock formerly called a planet on it's way to Earth*

Remember, this post is even less supported than the previous one!

You need to tell the engine how the mappings to the options, you need to
tell it how the forms relate to each other. If you don't, it auto generates
mapping information, which is whats causing what you describe.

This would do what you want:

public class DataTest {

    public static void main(String[] args) throws ARImportException,
IOException, ARException {
        DataImport dataImport = new DataImport();
        ImportOptions options = new ImportOptions();
        options.setContext(new ARServerUser("Demo", "", null, "localhost"));
        options.getFileOptions().setDataFile("c:/temp/report.arx");
        options.getFileOptions().setType(FileType.ARX);

        // extract the form information from the ARX file
        ARXParser parser = new ARXParser();
        List<FormInformation> fileFormList = parser.extractFormInformation(
                options.getFileOptions().getDataFile(), true); // true for
extracting only the first
        // form
        FormInformation sourceForm = fileFormList.get(0);

        // get the form information for the destination form on the server
        String destinationFormName = "Sample:Classes";
        FormInformation destinationForm = Util.getServerForm(options,
destinationFormName);

        // generate the mapping information
        MappingOptions mappings =
Util.generateMappingsForARX(destinationForm, sourceForm);

        // remove the fields you don't want
        mappings.getMappings().remove(1);
        mappings.getMappings().remove(2);
        mappings.getMappings().remove(3);
        mappings.getMappings().remove(4);
        mappings.getMappings().remove(5);
        mappings.getMappings().remove(6);
        mappings.getMappings().remove(15);

        // tell the import code about the source and destination forms, and
how they map to each
        // other
        options.addFileForm(sourceForm);
        options.addServerForm(destinationForm);
        // tell it that data from the source form goes to the destination
form
        options.getFormMap().put(destinationForm.getName(),
sourceForm.getName());
        // set the mappings for the forms
        options.addMappingOptions(sourceForm.getName(),
destinationForm.getName(), mappings);

        dataImport.setOptions(options);
        dataImport.startImport();
    }
}


On Thu, Jul 9, 2009 at 7:57 AM, LJ Longwing <[email protected]> wrote:

> ** I will have no recollection where I got the information afterwards (I
> love the reference BTW)....but specifically what I'm trying to do (I got
> that far amazingly enough) is to remove field ID's 1-6 and 15 from any arx
> file I'm importing.  The process described below works well (as I found out
> a few days ago), but won't work for my needs...I have thus far been able to
> generate the FormInformation object, remove the fields I don't want mapped
> from the map, then generate the Mapping information using the Util object,
> and then add all of that information into the ImportOptions object and set
> it for the DataImport object, but when I call the startImport method it
> bypasses all of the work I have done, starts its own ARXImporter object,
> redoes all of my work, but uses ALL of the fields instead of just the ones
> I'm trying to get it to use.  This is where I'm stuck.
>
>  ------------------------------
> *From:* Action Request System discussion list(ARSList) [mailto:
> [email protected]] *On Behalf Of *Calman Steynberg
> *Sent:* Wednesday, July 08, 2009 4:45 PM
> *To:* [email protected]
> *Subject:* Re: DataImport JavaDoc
>
> ** Ok, before I start this here is the fine print:
>
>
> All of the information contained here is completely utterly unsupported.
>
> Using this information indicates that you've read the rules, regulations
> and limitations and general information that has been on display in the
> basement of the local planning office on Alpha Centauri, and that it might
> lead to the destruction of earth to make space for a hyperspace bypass.
>
> Now on to the juicy bits:
>
> I'm  not exactly what you are trying to accomplish, but this should help.
> In general, all you need to do is this:
> Create an instance of DataOptions and set the appropriate values
> Create an instance of DataImport and use setOptions()
> Call DataImport.startImport()
>
> import java.io.IOException;
>
> import com.bmc.arsys.api.ARException;
> import com.bmc.arsys.api.ARServerUser;
> import com.bmc.arsys.apiext.data.ARImportException;
> import com.bmc.arsys.apiext.data.DataImport;
> import com.bmc.arsys.apiext.data.ImportOptions;
> import com.bmc.arsys.apiext.data.FileOptions.FileType;
>
> public class DataTest {
>
>     public static void main(String[] args) throws ARImportException,
> IOException, ARException {
>         DataImport dataImport = new DataImport();
>         ImportOptions options = new ImportOptions();
>         options.setContext(new ARServerUser("Demo", "", null,
> "localhost"));
>         options.getFileOptions().setDataFile("c:/temp/report.arx");
>         options.getFileOptions().setType(FileType.ARX);
>         dataImport.setOptions(options);
>         dataImport.startImport();
>     }
>
> }
>
> You'd have to be more specific about what the additional things are you are
> trying to accomplish.
>
> Calman
>
> PS: Remember, unsupported, undocumented, etc.
>
>
>
> On Tue, Jul 7, 2009 at 10:16 AM, LJ Longwing <[email protected]>wrote:
>
>> ** I have a Java program that does all sorts of migration work for us,
>> including data import from ARX.  I have previously written my own parsing
>> routine for ARX which works fairly well, but I would prefer to use theirs
>> (because it's theirs) from within my Java program without launching another
>> shell to execute it.  My hope was that they built it to be called as an
>> instance, and I have it 'functional' but I would like to do some additional
>> things than just grab the file and import it...and am having difficulty
>> figuring out the interface without any documentation.
>>
>>  ------------------------------
>>  *From:* Action Request System discussion list(ARSList) [mailto:
>> [email protected]] *On Behalf Of *Lyle Taylor
>> *Sent:* Tuesday, July 07, 2009 11:02 AM
>>
>> *To:* [email protected]
>> *Subject:* Re: DataImport JavaDoc
>>
>>   **
>>
>> It would surprise me that they intended it to be used in this manner, as I
>> would expect they would expect you to use the Remedy API to do it in your
>> program (though I could be wrong).  Are you importing data from a file or
>> from data stored in memory?  If from a file, couldn’t you simply call out to
>> the command line version of the import utility to do the work?  I know that
>> may not be as elegant or streamlined as it sounds like you would like, but
>> it might be much easier.
>>
>>
>>
>> Lyle
>>
>>
>>
>> *From:* Action Request System discussion list(ARSList) [mailto:
>> [email protected]] *On Behalf Of *LJ Longwing
>> *Sent:* Tuesday, July 07, 2009 10:57 AM
>> *To:* [email protected]
>> *Subject:* Re: DataImport JavaDoc
>>
>>
>>
>> **
>>
>> I am not entirely sure of that, no, but I'm hoping they did :)  I have
>> need of doing data import via java program and am wanting to use theirs
>> instead of the one I built that has a few problems with it :)
>>
>>
>>  ------------------------------
>>
>> *From:* Action Request System discussion list(ARSList) [mailto:
>> [email protected]] *On Behalf Of *Lyle Taylor
>> *Sent:* Tuesday, July 07, 2009 10:48 AM
>> *To:* [email protected]
>> *Subject:* Re: DataImport JavaDoc
>>
>> **
>>
>> You sound like you’re trying to use Java program and Java API
>> interchangeably here.  Are you sure that BMC intended its import utility to
>> also provide an API for use in other programs?
>>
>>
>>
>> Lyle
>>
>>
>>
>> *From:* Action Request System discussion list(ARSList) [mailto:
>> [email protected]] *On Behalf Of *LJ Longwing
>> *Sent:* Tuesday, July 07, 2009 9:28 AM
>> *To:* [email protected]
>> *Subject:* Re: DataImport JavaDoc
>>
>>
>>
>> **
>>
>> Unfortunately Rahul, that is also documentation on how to use their tools
>> via the command line.
>>
>>
>>
>> In 7.5 the Import tool is a Java program.  I would like to attach to that
>> Java API via my Java program and perform actions with it.  I have been able
>> to successfully add their java class to my program, but without
>> documentation I'm finding it difficult to utilize the api.
>>  ------------------------------
>>
>> *From:* Action Request System discussion list(ARSList) [mailto:
>> [email protected]] *On Behalf Of *Maheshwari, Rahul
>> *Sent:* Tuesday, July 07, 2009 9:12 AM
>> *To:* [email protected]
>> *Subject:* Re: DataImport JavaDoc
>>
>> **
>>
>>
>>
>> The documentation is available in Chapter-17 of the following:
>>
>>
>>
>> http://documents.bmc.com/supportu/documents/53/80/95380/95380.pdf
>>
>>
>>
>>
>>
>> Thanks & Regards,
>>
>>
>>
>> Rahul Maheshwari
>>
>>
>>  ------------------------------
>>
>> *From:* Action Request System discussion list(ARSList) [mailto:
>> [email protected]] *On Behalf Of *LJ Longwing
>> *Sent:* Tuesday, July 07, 2009 8:09 PM
>> *To:* [email protected]
>> *Subject:* Re: DataImport JavaDoc
>>
>>
>>
>> That unfortunately is help on how to use the GUI tool, not documentation
>> of the API....and the normal API JavaDocs don't have this documentation.
>>
>>
>>  ------------------------------
>>
>> *From:* Action Request System discussion list(ARSList) [mailto:
>> [email protected]] *On Behalf Of *Ian Trimnell
>> *Sent:* Monday, July 06, 2009 11:42 PM
>> *To:* [email protected]
>> *Subject:* Re: DataImport JavaDoc
>>
>> ** LJ Longwing wrote:
>>
>> **
>>
>> I'm looking for the JavaDoc for the new 7.5 Java DataImport tool.  Any
>> suggestions on where to find?
>>
>> _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
>> Are"_
>>
>> Hi,
>>
>> I don't know which platform you are using but I found the documentation -
>> well, the help files - in the plugins folder within the distribution
>> folder.  On our Windows 2003 server they are in:
>>
>> C:\Program Files\BMC
>> Software\ARSystem\dataimporttool\plugins\com.bmc.arsys.dataimport.help_7.5.0\doc.zip
>>
>> In the com.bmc.arsys.dataimport.help_7.5.0 folder are some xml files which
>> make up the index pages.  These HTML pages are what you get if you select
>> Help Contents form the Help menu within BMC Remedy Data Import.
>>
>> Hope this helps,
>>  Ian
>> ------------------------------
>>
>> Ian Trimnell, AR System Lead Developer (amongst other jobs),
>> Specialist Support & Information Team, Academic & Administrative Computing
>> Service
>> Open University, MILTON KEYNES, UK
>> Phone: 01908 653741   web: http://www.open.ac.uk/
>> The Open University is incorporated by Royal Charter (RC 000391), an
>> exempt charity in England & Wales and a charity registered in Scotland (SC
>> 038302).
>>
>> _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
>> Are"_
>>
>> _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
>> Are"__Platinum Sponsor: [email protected] ARSlist: "Where the
>> Answers Are"_
>>
>> _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
>> Are"_
>>
>>
>>
>> NOTICE: This email message is for the sole use of the intended
>> recipient(s) and may contain confidential and privileged information. Any
>> unauthorized review, use, disclosure or distribution is prohibited. If you
>> are not the intended recipient, please contact the sender by reply email and
>> destroy all copies of the original message.
>>
>> _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
>> Are"_
>>
>> _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
>> Are"_
>> _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
>> Are"_
>>  _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
>> Are"_
>>
>
> _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
> Are"_
> _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
> Are"_
>

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:[email protected] ARSlist: "Where the Answers Are"

Reply via email to