Altova MapForce 2025 Professional Edition

ProjectItem

Home Prev Top Next

A ProjectItem object represents one item in a project tree.

 

Properties to navigate the object model:

 

Application

Parent

 

Project tree navigation:

 

Count

Item

_NewEnum

 

Project item properties:

 

Kind

Name

WSDLFile (only available to Web service project items)

QualifiedName (only available to Web service project items)

 

Project tree manipulation:

 

AddActiveFile (only available to folder items)

AddFile (only available to folder items)

CreateFolder (only available to folder items)

CreateMappingForProject (only available to Web service operations)

Remove

 

Document access:

 

Open (only available to mapping items and Web service operations)

 

Code-generation:

 

CodeGenSettings_UseDefault

CodeGenSettings_OutputFolder

CodeGenSettings_Language

GenerateCode

GenerateCodeEx

GenerateCodeIn

GenerateCodeInEx

 

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

 

Properties

Name

Description

_NewEnum

Read-only.

This property supports language specific standard enumeration. For examples, see Project.Item or Project._NewEnum.

Application

Read-only.

Retrieves the top-level application object.

CodeGenSettings_Language

Gets or sets the language to be used with GenerateCode or Project.GenerateCode. This property is consulted only if CodeGenSettings_UseDefault is set to false.

CodeGenSettings_OutputFolder

Gets or sets the output directory to be used with GenerateCode, GenerateCodeIn, Project.GenerateCode or Project.GenerateCodeIn. This property is consulted only if CodeGenSettings_UseDefault is set to false.

CodeGenSettings_UseDefault

Gets or sets whether output directory and code language are used as defined by either (a) the parent folders, or (b) the project root. This property is used with calls to GenerateCode, GenerateCodeIn, Project.GenerateCode and Project.GenerateCodeIn. If this property is set to false, the values of CodeGenSettings_OutputFolder and CodeGenSettings_Language are used to generate code for this project item.

Count

Read-only.

Retrieves the number of children of this project item. See also Item. For examples, see Project.Item or Project._NewEnum.

Item

Read-only.

Returns the child at n position of this project item. The index is 1-based (the first index is 1). The largest valid index is ProjectItem.Count. For an alternative, see ProjectItem._NewEnum. For examples, see Project.Item or Project._NewEnum.

Kind

Read-only.

Retrieves the kind of the project item. Availability of some properties and the applicability of certain methods is restricted to specific kinds of project items. The description of all methods and properties contains information about these restrictions.

Name

Retrieves or sets the name of a project item. The name of most items is read-only. Exceptions are user-created folders, the names of which can be altered after creation.

Parent

Read-only.

Retrieves the project that this item is a child of. Has the same effect as Application.ActiveProject.

QualifiedName

Read-only.

Retrieves the qualified name of a Web service item.

WSDLFile

Read-only.

Retrieves the file name of the WSDL file defining the Web service that hosts the current project item.

 

Methods

Name

Description

AddActiveFile

Adds the currently active document to this project item if it is a valid child. Otherwise, the document is added to the Mapping Folder of the project's root.

AddFile

Adds the specified document to this project item if it is a valid child. Otherwise, the document is added to the Mapping Folder of the project's root.

CreateFolder

Creates a new folder as a child of this project item.

CreateMappingForProject

Creates an initial mapping document for a Web service operation and saves it to i_strFileName. When using Project.InsertWebService you can set the i_bGenerateMappings flag to let MapForce automatically generate initial mappings for all ports.

GenerateCode

Generates code for this project item and its children. The code language and output location is determined by CodeGenSettings_UseDefault, CodeGenSettings_Language and CodeGenSettings_OutputFolder. Children of this project item can have their own property settings related to code-generation.

GenerateCodeEx

Generates code for this project item and its children. The code language and output location are determined by CodeGenSettings_UseDefault, CodeGenSettings_Language and CodeGenSettings_OutputFolder. Children of this project item can have their own property settings related to code-generation.

GenerateCodeIn

Generates code for the project item and its children in the specified language. The output location is determined by CodeGenSettings_UseDefault and CodeGenSettings_OutputFolder. Children of this project item can have their own property settings related to code-generation.

GenerateCodeInEx

Generates code for the project item and its children in the specified language. The output location is determined by CodeGenSettings_UseDefault and CodeGenSettings_OutputFolder. Children of this project item can have their own property settings related to code-generation.

 

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.

Open

Opens the project item as a document or makes the corresponding document the active one, if it is already open. The project item must be a MapForce mapping or, for Enterprise edition only, Web service operation.

Remove

Remove this project item and all its children from the project tree.

 

Events

Name

Description

OnModifiedFlagChanged

Occurs when the ProjectItem's modification status changes.

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.

© 2018-2024 Altova GmbH