PDA

View Full Version : Model Manager 13.20 bug on AssignReferencesCnHandler (maybe)


alexniccoli
07-04-2005, 04:13 AM
Hi all
In 13.20 (but i think in previous releases there is a bug) in
AssignReferencesCnHandler java class.In particular if you try to assign database references into titleblock, don't appear Change note attributes.

Follows the patch and xml tag to add to your custom.xml

package com.acme.datamgmt.integration.command.me10;

import com.osm.biz.*;
import com.osm.datamgmt.util.*;
import com.osm.dm.biz.*;


/**
* Used to handle update titleblock and back annotation code.
* <b><i>dwg_mgmt_send_command "Awmc_me10_il_load_cn_attr 'DRAWING_2D' 'C:/TEMP/me484117.cn'"</i></b>.
*/
public class AssignReferencesCnHandlerACME extends com.osm.datamgmt.integration.command.ME10CommandHandler {
/**
* Creates a new AssignReferencesCnHandler
*/
public AssignReferencesCnHandlerHC() {
super(false);
}

/**
* This exports the change note attributes out to the specified file.
*/
public void processCommand(java.util.List parameters)
throws com.osm.exception.WMException {
//Awmc_me10_il_load_cn_attr 'DRAWING_2D' 'C:/TEMP/me484117.cn'
// Cant use classname as it been corrupt by ME10 integration
//String docClass = removeQuotes((String) parameters.get(0));
String docClass = (String) (WMSession.getWMSession().getClassInstances(com.osm.datamgmt.biz.Drawing.class)).get(0);
String cnCSL = removeQuotes((String) parameters.get(1));

String cnClass = WMConfig.getInstance().getClassTagValue(docClass, "ChangeNoteClass");
System.out.println("classe note mod: " + cnClass);
WMClass cnWmClass = WMSession.getWMSession().openClass(cnClass, false);
Object[] attributes = cnWmClass.getAttributes().getAttributeNames().toArray();
WMLtab ltab = WMSession.getWMSession().newLtab();

for (int i = 0; i < attributes.length; i++) {
ltab.addColumn(""+ attributes[i]);//modifica alex
//ltab.write(i, 0, attributes[i]);
System.out.println("" + attributes[i]);
}

cnWmClass.close();
ltab.toCSL(cnCSL, true, true);

ltab.delete();
}
}


<ME10Handler>Awmc_me10_il_load_cn_attr
<Implementation>com.acme.datamgmt.integration.command.me10.AssignReferencesCnHandlerACME</Implementation>
</ME10Handler>