[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[epf-dev] I need help adding method elements to a content package
|
Gang,
I have been struggling to figure out how to set up commands to add elements
to a content package. Here is the context for my problem:
I am building Eclispe-based transforms for converting our current
methodology knowledge base to an EPF-based (UMA) knowledge base
I have developed a viewer for our current methodology knowledge base and am
building actions to transform particular content types (e.g., term
definitions) to the EPF model
I have gotten to the point of attempting to create
MethodElementCreateChildCommands (from the
org.eclipse.epf.library.edit.command package) to add the term definition to
the selected content package.
This is where I get lost. The indirection through the EMF command
processing makes it difficult for me to figure out how to set up the
command. Here's what I have so far:
// Get the content package
ContentPackage contPackage = (ContentPackage) blackboard.get("package");
// Create the term definition to add
TermDefinition termDef = UmaFactory.eINSTANCE.createTermDefinition();
termDef.setName("name");
termDef.setPresentationName("Presentation Name");
//termDef.set(UmaPackage.CONTENT_DESCRIPTION__MAIN_DESCRIPTION, "Main
Description");
// create the command
CommandParameter cParam = new CommandParameter(termDef, UmaPackage.
eINSTANCE.getTermDefinition(), null);
Command command = MethodElementCreateChildCommand.create(editDomain,
contPackage, cParam, new ArrayList());
// execute the command
editDomain.getCommandStack().execute(command);
The command that is returned by the MethodElementCreateChildCommand.create
() is not executable. Remember that I am working outside the EPF UI
infrastructure.;
Any insight would be greatly appreciate.
- Jim
JIM TREMLETT
Solution Architect
CSC
200 Park Avenue, New York, NY 10166
GBS Americas | 646-652-6452 | jtremlett@xxxxxxx | www.csc.com
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
any order or other contract unless pursuant to explicit written agreement
or government initiative expressly permitting the use of e-mail for such
purpose.