Book a Demo

Author Topic: create a new project (and import) using vbscript  (Read 3279 times)

gmacfarlane

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
create a new project (and import) using vbscript
« on: May 28, 2007, 01:55:10 am »
Hi,

I am having some trouble following the documentation. I am trying to write a VBScript that will create a new EA project (.eap) file, import (reverse engineer from) a folder hierarchy of Java code, then save the .eap file and close.

Can anyone offer me some pointers? I haven't got as far as the reverse engineering part - I can't find methods to create a repository or a project (only to open existing ones), and I am not sure whether I want a repository or a project in the first place? or do I need both?

sorry, I realise its probably a very basic question, but I am confused

can anyone offer any pointers?

thanks.
- Graeme.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: create a new project (and import) using vbscri
« Reply #1 on: May 28, 2007, 02:07:59 am »
Don't panic Graeme,

First, repositories and projects come together. You create an EA Application object, then use its Repository to get to the OpenFile() method. The Project object gets created and populated while you do all this.

Back in the dark ages, EA did not have a 'New' function as such. You had to manually create an empty project file (or schema if you used a DBMS) and then work with it. The current New functionality does essentially the same thing, but it all happens behind the scenes. The function uses information and patterns stored in the EABase file that gets installed along with EA.

Your automation project will do something similar. You'll want to create your own empty 'reference' project, with base settings you'll use commonly - you can have several of these if you have various 'flavors' of projects you commonly work with. Put these files where they can be easily referenced, but won't get trashed - perhaps you'll store them in a common directory as read-only files.

When you need to create a new project, get the particulars, then create an FSO in VBScript to handle the file system wizardry required to copy, rename, and perhaps write-enable, the appropriate reference file to the correct location. Then create an EA Application, get a reference to the Application's Repository method, and open the file. You're now off to the races. When you need a call to the read-only XML interface or any of the other Project methods, you can use the GetProjectInterface method of the Repository object, or you can just save a reference to the Project property of the Application interface.

HTH, David
No, you can't have it!

gmacfarlane

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: create a new project (and import) using vbscri
« Reply #2 on: May 28, 2007, 12:12:28 pm »
Thanks David,

all working now. Cheers!

- G