|
|
@ -11,6 +11,7 @@ import java.awt.Toolkit;
|
|
|
|
import java.awt.datatransfer.StringSelection;
|
|
|
|
import java.awt.datatransfer.StringSelection;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.math.BigInteger;
|
|
|
|
import java.math.BigInteger;
|
|
|
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Arrays;
|
|
|
@ -24,6 +25,7 @@ import java.util.Map;
|
|
|
|
import javax.swing.JDialog;
|
|
|
|
import javax.swing.JDialog;
|
|
|
|
import javax.xml.bind.JAXBException;
|
|
|
|
import javax.xml.bind.JAXBException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.james.mime4j.codec.EncoderUtil;
|
|
|
|
import org.eclipse.jface.dialogs.Dialog;
|
|
|
|
import org.eclipse.jface.dialogs.Dialog;
|
|
|
|
import org.eclipse.jface.dialogs.IDialogConstants;
|
|
|
|
import org.eclipse.jface.dialogs.IDialogConstants;
|
|
|
|
import org.eclipse.jface.viewers.TreeViewer;
|
|
|
|
import org.eclipse.jface.viewers.TreeViewer;
|
|
|
@ -101,6 +103,7 @@ import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateInput;
|
|
|
|
import com.teamcenter.soa.client.model.LovValue;
|
|
|
|
import com.teamcenter.soa.client.model.LovValue;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.com.origin.autocode.jfom.util.ClassProperty;
|
|
|
|
import cn.com.origin.autocode.jfom.util.ClassProperty;
|
|
|
|
|
|
|
|
import cn.com.origin.autocode.jfom.util.HttpUtil;
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomBZJBean;
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomBZJBean;
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomBean;
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomBean;
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomLovBean;
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomLovBean;
|
|
|
@ -132,6 +135,7 @@ import cn.com.origin.autocodemanager.common.tree.AbstractTreeData;
|
|
|
|
import cn.com.origin.autocodemanager.common.tree.TreeViewOperation;
|
|
|
|
import cn.com.origin.autocodemanager.common.tree.TreeViewOperation;
|
|
|
|
import cn.com.origin.autocodemanager.views.listcodeview.NewItemListCodeView;
|
|
|
|
import cn.com.origin.autocodemanager.views.listcodeview.NewItemListCodeView;
|
|
|
|
import cn.com.origin.autocodemanager.views.treecodeview.NewItemTreeCodeView;
|
|
|
|
import cn.com.origin.autocodemanager.views.treecodeview.NewItemTreeCodeView;
|
|
|
|
|
|
|
|
import net.sf.json.JSONObject;
|
|
|
|
|
|
|
|
|
|
|
|
public class NewCodeItemDialog extends Dialog {
|
|
|
|
public class NewCodeItemDialog extends Dialog {
|
|
|
|
private Table propTable;
|
|
|
|
private Table propTable;
|
|
|
@ -4059,8 +4063,9 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
|
|
|
|
|
|
|
|
if (newComp != null) {
|
|
|
|
if (newComp != null) {
|
|
|
|
afterCreate();
|
|
|
|
afterCreate();
|
|
|
|
|
|
|
|
sendToClassification();
|
|
|
|
// sendObjToClassfication((TCComponentItem) newComp);
|
|
|
|
// sendObjToClassfication((TCComponentItem) newComp);
|
|
|
|
sendObjToClassficationByWebService((TCComponentItem) newComp);
|
|
|
|
// sendObjToClassficationByWebService((TCComponentItem) newComp);
|
|
|
|
newComp.refresh();
|
|
|
|
newComp.refresh();
|
|
|
|
new GetCodeNumber().delete_recycleID(counterID);
|
|
|
|
new GetCodeNumber().delete_recycleID(counterID);
|
|
|
|
setClipboard(newID);
|
|
|
|
setClipboard(newID);
|
|
|
@ -4332,4 +4337,64 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean sendToClassification() {
|
|
|
|
|
|
|
|
TCComponentItem item = (TCComponentItem) newComp;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
String uid = item.getLatestItemRevision().getUid();
|
|
|
|
|
|
|
|
String cid = codeRemark.trim();
|
|
|
|
|
|
|
|
List<Integer> idsList = new ArrayList<Integer>();
|
|
|
|
|
|
|
|
List<String> valuesList = new ArrayList<String>();
|
|
|
|
|
|
|
|
for (int i = 0; i < classPropList.size(); i++) {
|
|
|
|
|
|
|
|
// System.out.println(" CLASS ID = " + integers[i] + " =" +
|
|
|
|
|
|
|
|
// vals[i]);
|
|
|
|
|
|
|
|
CNClassPropBean bean = classPropList.get(i);
|
|
|
|
|
|
|
|
String value = "";
|
|
|
|
|
|
|
|
if (bean.isLov) {
|
|
|
|
|
|
|
|
value = ((Combo) classTextList.get(i)).getText();
|
|
|
|
|
|
|
|
value = bean.lovMapping.get(value);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
value = ((Text) classTextList.get(i)).getText();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// icspro[i] = new ICSProperty(bean.propID, value);
|
|
|
|
|
|
|
|
if (!"".equals(value)) {
|
|
|
|
|
|
|
|
idsList.add(bean.propID);
|
|
|
|
|
|
|
|
valuesList.add(value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int[] ids = new int[idsList.size()];
|
|
|
|
|
|
|
|
String[] values = valuesList.toArray(new String[valuesList.size()]);
|
|
|
|
|
|
|
|
for (int i = 0; i < idsList.size(); i++) {
|
|
|
|
|
|
|
|
ids[i] = idsList.get(i);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ClassificationBean cfb = new ClassificationBean(ids, values);
|
|
|
|
|
|
|
|
System.out.println(Arrays.toString(ids));
|
|
|
|
|
|
|
|
System.out.println(Arrays.toString(values));
|
|
|
|
|
|
|
|
System.out.println(cfb.getIds()[0]);
|
|
|
|
|
|
|
|
JSONObject obj = new JSONObject();
|
|
|
|
|
|
|
|
obj.put("ids", ids);
|
|
|
|
|
|
|
|
obj.put("values", values);
|
|
|
|
|
|
|
|
String url = EncoderUtil.encodeAddressDisplayName(obj.toString());
|
|
|
|
|
|
|
|
url = url.substring(1, url.length() - 1);
|
|
|
|
|
|
|
|
url = URLEncoder.encode(url);
|
|
|
|
|
|
|
|
url = "http://localhost:8080/classification?uid=" + uid + "&cid=" + cid + "&prop=" + url;
|
|
|
|
|
|
|
|
System.out.println(url);
|
|
|
|
|
|
|
|
final String URL = url;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
HttpUtil.doGet(URL);
|
|
|
|
|
|
|
|
System.out.println("success");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).start();
|
|
|
|
|
|
|
|
} catch (TCException e) {
|
|
|
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|