Hi Hussein,

I'm working (with a Java developer) on a feature that allows users to define 
publishing parameters on the fly, right before running the Convert command. 

Basically, it searches the current document for a specific set of attributes 
(arch, audience, and document, in this case) and presents the user with a 
multipick interface so that they can determine the profiling parameters they 
want to use to publish. My only roadblock is determining which 
publishParameters 
set to write the parameters to. Since the publishParameters set is prefaced 
with 
the name of the configuration, I need access to that information.

I think when I get the correct 'app' instance, the above configuration issue 
will be solved.
 
I want to get Configuration whenever new document is opened. From this 
Configuration, I get the name, which is used to get corresponding 
attributeGroup.

To do that, I need the 'app' instance. The code is like this:
 
OpenedDocument openedDoc = app.getActiveOpenedDocument();
Configuration config = openedDoc.getConfiguration();
String configName =  config.getName();
  
My question is how to get the reference of 'app'(App class) instance from the 
command class. I understand Action classes can have access to 'app'.
 
However, in this case, the command class should be used, not Action, because 
the 
menu is created all with commands in xsl, which have parameter values 

to send to each command classes.
 
So, to get the 'app' variable, I created Action class which implements Command 
interface. At this time, the prepareCommand/executeCommand methods of the 
Command are not invoked. (Only the init() and exec() method of the Action were 
invoked.) These Command methods should be invoked to get the parameter value in 
the class.
 
As second way, I made the class implements AppTool,in which 'app' variable 
exists. But this is not working either, because it has 'app' value as 'null'.
 
The current class/method looks like this:
 
 public class ExecWithConversionParameters extends RecordableCommand 
 protected Object doExecute(DocumentView docView, String parameter, int x, int 
y)

Help?
Jeff.
 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to