Hi Sylvain,
1) About the File in input.
Yes you are right, the current API is working on File, we can change it to
manage URL or streams. Can you open a Feature Request please and assign it to
me.
2) About giving some parameters to the transformation
I recommend you to override gendoc2 services and call them explicitly in your
document using the service attribute in context tag (ex : <context
model='${model}' element='RootElement' services='MyOwnService1;MyOwnService2'/>
), detailed in Gendoc2 Developer Tutorial. You can also instead of using the
tags, create the instance of the services at runtime using :
è From GendocServices.getDefault() : public void setService(Class< ? extends
IService> serviceType, IService service)
To force input model element you have to extend the EMFModelLoaderService
(IEMFModelLoaderService) and override the getModel method to return your model
element.
3) About defining a new Output path you have to extend the
ConfigurationService (IConfigurationService) and override the getOutput ()
method .
4) For your diagrams it is the best solution
Regards,
Anne
De : [email protected]
[mailto:[email protected]] De la part de Topcased user
list where issues are discussed
Envoyé : vendredi 11 février 2011 17:58
À : [email protected]
Objet : [Topcased-users] [GenDoc2] Embedded in RCP
Hi,
I would like to embed GenDoc2 in a RCP application.
>From a contextual action (Eclipse Handler), I would like to be able to
>generate a Docx or ODT file with images.
The input parameters for the template would be :
* model: EObject (the root object of my model)
* diagrams: IFile[] (the list of GMF diagrams to convert into images) -> I
know I could develop a service to extend GMFServices here
* genPath: String (the absolute path of the destination folder where to
create the result)
After investigating a little in the source code taken from Gforge. It appears
that I need a "File" to represent my template as input.
But, my template "Template.docx" must be inside a bundle of my RCP application
(in a jar). So, I would need to be able to give an URL like "bundle://".
GendocProcess gendocProcess = new GendocProcess();
String resultFile =
gendocProcess.runProcess(currentFile.getLocation().toFile());
Could you help me to make it possible ? How can I give all these input
parameters dynamically and not put them in the template ?
Regards,
--
Sylvain Dudoit
________________________________
Ce message et les pièces jointes sont confidentiels et réservés à l'usage
exclusif de ses destinataires. Il peut également être protégé par le secret
professionnel. Si vous recevez ce message par erreur, merci d'en avertir
immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant
être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra
être recherchée quant au contenu de ce message. Bien que les meilleurs efforts
soient faits pour maintenir cette transmission exempte de tout virus,
l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne
saurait être recherchée pour tout dommage résultant d'un virus transmis.
This e-mail and the documents attached are confidential and intended solely for
the addressee; it may also be privileged. If you receive this e-mail in error,
please notify the sender immediately and destroy it. As its integrity cannot be
secured on the Internet, the Atos Origin group liability cannot be triggered
for the message content. Although the sender endeavours to maintain a computer
virus-free network, the sender does not warrant that this transmission is
virus-free and will not be liable for any damages resulting from any virus
transmitted.
_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users