Hi all,
I'm new to Epic development and need a bit of help with an existing system.
In the instance.acl file a number of java classes are loaded that perform actions when different elements are inserted into an xml document. I implemented a bug fix through a save callback that transforms the current document, closes it and re-opens the result of the transformation in its place. I tried various ways of doing this and came up with the version at the bottom of this post.
My problem is that once I have done this, none of the java actions are called when new elements are inserted into the new document. I'm guessing I need to reload instance.acl when I load the new document, but I don't know how to do that. Someone who posted here suggested edit that -current; would do this.
Can anyone show me a way to reload instance.acl, or let me know that this is already happening and I need to do something else (code snippets below)?
Thanks in advance
Chris
[[[[[[[how the java is loaded in the instance.acl]]]]]]]]
$obj = java_constructor('JavaClassName');
java_instance($obj, 'javaMethodName');
[[[[[acl code executed on save of original document]]]]]]]
function CB_SaveDoc(Document, Operation){
if (Operation==1) {
return 0 ; # Continue with the save.
} else if (Operation==2) {
if (doc_type()=='precedent3'){
save ;
#java_console(0) ;
#java_console(1) ;
$obj = java_static("NameSpaceFixer", "applyStyleSheet" \
, doc_path(), "$nsStyle", "C:\\temp.xml") ;
java_delete($obj);
local docPath = doc_path();
file_close();
remove_file -f "$docPath";
copy_file "C:\\temp.xml" $docPath
edit -xml $docPath;
#edit -current -- had no effect
return -1;
}
return 0 ; # Let Epic do the save.
}
doc_add_callback(0, 'save', 'CB_SaveDoc') ;