Project

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  The MapForce API > Object Reference > Interfaces >

Project

A Project object represents a project and its tree of project items in MapForce.

 

Properties to navigate the object model:

 

Application
Parent

 

File handling:

 

FullName
Name
Path
Saved
Save
Close

 

Project tree navigation:

 

Count
Item
_NewEnum

 

Project tree manipulation:

 

AddActiveFile
AddFile
InsertWebService (Enterprise edition only)
CreateFolder

 

Code generation:

 

Output_Folder
Output_Language
Output_TextEncoding
Java_BasePackageName
GenerateCode
GenerateCodeEx
GenerateCodeIn
GenerateCodeInEx

 

For examples of how to use the properties and methods listed above, see Example: Project Support. For operations with Web services, the MapForce Enterprise edition is required.

 

 

Properties

Name

Description

_NewEnum

Read-only.

This property supports language-specific standard enumeration.

Application

Read-only.

Retrieves the top-level application object.

Count

Read-only.

Retrieves number of children of the project's root item. For examples, see Item or _NewEnum

FullName

Path and name of the project file.

Item

Read-only.

Returns the child at n position of the project's root. The index is zero-based. The largest valid index is Count-1. For an alternative to visit all children, see _NewEnum.

Java_BasePackageName

Sets or gets the base package name of the Java packages that will be generated. This property is used only when generating Java code.

Name

Read-only.

Name of the project file without file path.

Output_Folder

Sets or gets the default output folder used with GenerateCode and GenerateCodeIn. Project items can overwrite this value in their CodeGenSettings_OutputFolder property, when CodeGenSettings_UseDefault is set to false.

Output_Language

Sets or gets the default language for code generation when using GenerateCode. Project items can overwrite this value in their CodeGenSettings_OutputLanguage property, when CodeGenSettings_UseDefault is set to false.

Output_TextEncoding

Sets or gets the text encoding used when generating XML-based code.

Parent

Read-only.

The parent object according to the object model.

Path

Read-only.

Path of the project file without name.

Saved

Read-only.

True if the project was not modified since the last Save operation, false otherwise.

 

Methods

Name

Description

AddActiveFile

Adds the currently open document to the mapping folder of the project's root.

AddFile

Adds the specified document to the mapping folder of the project's root.

Close

Closes the project without saving.

CreateFolder

Creates a new folder as a child of the project's root item.

GenerateCode

Generates code for all project items of the project. The code language and output location is determined by properties of the project and project items.

GenerateCodeEx

Generates code for all project items of the project. The code language and output location are determined by properties of the project and project items. An object that can be used to iterate through all messages issued by the code generation process is returned. These messages are the same as those shown in the Messages window of MapForce.

GenerateCodeIn

Generates code for all project items of the project in the specified language. The output location is determined by properties of the project and project items.

GenerateCodeInEx

Generates code for all project items of the project in the specified language. The output location is determined by properties of the project and project items. Returns an object that can be used to iterate through all messages issued by the code generation process. These messages are the same as those shown in the Messages window of MapForce.

InsertWebService

Inserts a new Web service project into the project's Web service folder. If i_bGenerateMappings is true, initial mapping documents for all ports get generated automatically.

Save

Saves the project to the file defined by FullName.

 

Events

Name

Description

OnProjectClosed

This event is triggered when the project is closed. The project object passed into the event handler should not be accessed. The corresponding open event is Application.OnProjectOpened.


© 2019 Altova GmbH