|
||||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
IEditModelHandler | Provides a standard interface for managing the lifecycle of an Edit Model. |
Class Summary | |
---|---|
ArtifactEdit | Provides a Facade pattern for accessing Module Content Metamodels for Web Tools Platform flexible modules. |
ComponentCore | Provides a handle creation factory for the Virtual Path API. |
ModuleCoreNature | Allows projects to support flexible project structures. |
Exception Summary | |
---|---|
UnresolveableURIException | Thrown whenever a URI cannot be appropriately resolved. |
The ComponentCore API allows clients to work with the Structural Metamodels that define abstract modules within Eclipse projects. These metamodels are exposed through the Virtual Path API layer (see ComponentCore). Clients should also review the org.eclipse.wst.common.componentcore.resources package.
The following document includes information on these topics:
|
ComponentCore Metamodel (CCM) |
The ComponentCore Metamodel (CCM) is an EMF model that allows the tooling to understand most project structures. Each project has a single CCM which is stored under the project root named .wtpmodules . The XML format is defined by the ComponentCore schema. The following diagram is a UML representation of the ComponentCore Metamodel. This information is published for potential contributors of editors, but the EMF model is not exposed directly as API, and could change in view of changes for WTP 1.1. |
|
Figure 1: The Component Core Metamodel |
Each logical component contained in the project is represented by a WorkbenchComponent element. The WorkbenchComponent defines information about the type of component, the resources consumed by the module from the project, and the referenced components. The WorkbenchComponent is very generic, and as modeled, does not necessarily correspond to only J2EE artifacts. |
The WorkbenchComponent has a name , which is the name that will be used when the runtime form of the component is constructed. For a web application, the name might be "MyWebApplication". |
The WorkbenchComponent may be uniquely referenced by a URI. The fully qualified URI to any component must begin with the component protocol ("component:"), specify a subprotocol ("resource|classpath") and then a path to the referenced component. A WorkbenchComponent with the name "MyWebApplication" defined in a project named "MyWebModulesProject" would be referenced by the following URI: "component:/resource/MyWebModulesProject/MyWebApplication". As a future extension, a component referenced on the classpath of a project (perhaps a Utility Jar or an EJB Client Jar), the URI might be something like: "component:/classpath/MyWebModulesProject/CustomerEJBClient.jar". |
The WorkbenchComponent has a ComponentType. The ComponentType defines a componentTypeId , which indicates the specific kind of component. The Web Tools Platform uses the componentTypeId to determine how to work with the content component of the WorkbenchComponent and prepare the component for deployment. The ComponentType may also define the runtime-paths of special metadata resources which are important to the WorkbenchComponent. "Metadata" refers to resources which explain the content details of the specific modules. An example of such a file would be the "WEB-INF/web.xml" deployment descriptor for Web Applications. |
The WorkbenchComponent contains a list of ComponentResources. Each ComponentResource has "sourcePath" and a corresponding "runtimePath". The "sourcePath" can reference either a file or folder, but the referenced resource must be contained in the same project as the WorkbenchComponent definition. The "runtimePath" specifies a location relative to the deployed structure of the WorkbenchComponent where the contents of the referenced resource will be represented when the module is prepared for runtime. |
The WorkbenchComponent contains a list of ReferencedComponents. Each ReferencedComponent provides a handle that must resolve to a WorkbenchComponent, a runtimePath that defines where the constructed component will be placed within the context of the runtime WorkbenchComponent, and a DependencyType that can be either "consume" or "use" to indicate how the contents of that ReferencedComponent should be absorbed by the WorkbenchComponent. ReferencedComponents may reference WorkbenchComponents in other projects and on current project's classpath (Not yet implemented). The DependencyType will determine whether the contents of the ReferencedComponent are absorbed as-is or archived into a *.{w|j|e}ar file. |
The ProjectComponents object provides a root container for all WorkbenchComponents defined in a given project. |
ComponentCore provides a facade to manage the underlying model for
clients. Static methods
|
Constraints enforced by the CCM |
The following constraints are enforced by the model:
|
ComponentCore API: Working with the metamodel |
ComponentCore uses a handle based model much like the existing Platform Resource model. The ComponentCore facade is not tied to any project, and the handles that it returns may or may not exist. The complexity of managing the underlying EMF model is handled under the cover for users. |
|
Figure 2: The ComponentCore API |
|
||||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |