Okay, I tried.
- My main template is basically (with other stuff, but that gets written correctly) :
package >
element >
method >
{Template - Fragment}
< method
child element >
< child element
< element
child package >
< child package
< package
- The template fragment :
custom >
{Method_Name}
< custom
- With settings :
Template Fragment checked.
Custom Query : Custom script checked, the script i created choosed in the list, and in the text field :
PrintMethod(#operationID#);
- The script :
function PrintMethod(operationID)
{
var xmlDOM = new ActiveXObject( "MSXML2.DOMDocument.4.0" );
xmlDOM.validateOnParse = false;
xmlDOM.async = false;
var node = xmlDOM.createProcessingInstruction("xml", "version='1.0'");
xmlDOM.appendChild(node);
var xmlRoot = xmlDOM.createElement( "EADATA" );
xmlDOM.appendChild(xmlRoot);
var xmlDataSet = xmlDOM.createElement( "Dataset_0" );
xmlRoot.appendChild(xmlDataSet);
var xmlData = xmlDOM.createElement( "Data" );
xmlDataSet.appendChild(xmlData);
var xmlRow = xmlDOM.createElement( "Row" );
xmlData.appendChild(xmlRow);
var theMethod as EA.Method;
theMethod = Repository.GetMethodByID(operationID);
if ( theMethod != null && theMethod.ObjectType == otMethod )
{
var xmlName = xmlDOM.createElement( "Method_Name" );
xmlName.text = theMethod.Name;
xmlRow.appendChild(xmlName);
}
return xmlDOM.xml;
};
I havent't tried to go any further yet, since this doesn't work at all, but eventually, i'd like to have more informations about the method in my XML and my RTF, including the method's parameters.
But this doesn't work, error while generating, the method name, or anything i put in my xml elements is never written in the RTF file.
I tried a plain text directly in my field Method_Name, didn't work, i tried any syntax for operationID (operationID, OperationID, OPERATIONID, ObjectID, OBJECTID, objectID), didn't work, I tried to remove any call to the operationID in the script, and just writing plain text in xmlName.text, didn't work either. I tried to find any kind of documentation, explanation or tutoriel on how this works, on your website or anywhere in the web, I only found unapplicable examples.
EDIT :
If I remove the parameter operationID from the script's method, and from its call, and only put plain text in my xml, it works. Problem is, it only prints plain text, because i can't access to my method's information this way.