package com.vci.server.workflow.event;
|
|
import java.io.UnsupportedEncodingException;
|
import java.util.ArrayList;
|
import java.util.HashMap;
|
import java.util.List;
|
import java.util.Map;
|
|
import com.vci.common.qt.object.Condition;
|
import com.vci.common.qt.object.QueryTemplate;
|
import com.vci.corba.common.VCIError;
|
import com.vci.corba.omd.data.BusinessObject;
|
import com.vci.corba.omd.data.LinkObject;
|
import com.vci.server.base.utility.OQueryHelper;
|
import com.vci.server.base.utility.ServerServiceProvider;
|
|
public class QueryHelper
|
{
|
// public static BusinessObject[] getbo(String[] oids,String boType)
|
// {
|
// BusinessObject[] bos = null;
|
// try
|
// {
|
// bos = ServerServiceProvider.getBOFService().getBatchBusinessObject(oids, boType);
|
// } catch (VCIError e) {
|
// e.printStackTrace();
|
// } catch (Throwable e) {
|
// e.printStackTrace();
|
// }
|
// if (bos == null || bos.length < 0) {
|
// return null;
|
// }
|
// return bos;
|
// }
|
|
// public static BusinessObject getbo(String oid,String boType)
|
// {
|
// BusinessObject bo = null;
|
// try
|
// {
|
// return ServerServiceProvider.getBOFService().readBusinessObject(oid, boType);
|
// } catch (VCIError e) {
|
// e.printStackTrace();
|
// } catch (Throwable e) {
|
// e.printStackTrace();
|
// }
|
// if (bos == null || bos.length < 0) {
|
// return null;
|
// }
|
// return null;
|
// }
|
|
// public static LinkObject getlo(String dboid,String partoid, String linkType){
|
// LinkObject lo = null;
|
// try {
|
// QueryTemplate qt2 = new QueryTemplate();
|
// qt2.setId("btmQuery");
|
// qt2.setLinkType(linkType);
|
// qt2.setType("link");
|
// qt2.setVersion(1);
|
// qt2.setQueryChildrenFlag(true);
|
// List<String> clauseList = new ArrayList<String>();
|
// clauseList.add("*");
|
// qt2.setClauseList(clauseList);
|
// Map<String, String> conditions = new HashMap<String, String>();
|
// conditions.put("f_oid", dboid);
|
// conditions.put("t_oid", partoid);
|
// Condition cond = OQueryHelper.getCondition(conditions);
|
//
|
// qt2.setCondition(cond);
|
// LinkObject[] los = ServerServiceProvider.getOQService().findLTObjects(qt2.getId(), OQueryHelper.getQTTextByQT(qt2));
|
// if(los.length>0)
|
// lo = los[0];
|
//
|
// } catch (VCIError e) {
|
// e.printStackTrace();
|
// } catch (Throwable e) {
|
// e.printStackTrace();
|
// }
|
//
|
// return lo;
|
// }
|
|
// public static String convertGBKToISO_8859_1(String text){
|
// return convertEncoding(text, "GBK", "ISO-8859-1");
|
// }
|
//
|
// public static String convertISO_8859_1ToGBK(String text){
|
// return convertEncoding(text, "ISO-8859-1", "GBK");
|
// }
|
//
|
// public static String convertEncoding(String text, String fromEncoding, String toEncoding){
|
// String res = text;
|
// try {
|
// res = new String(text.getBytes(fromEncoding), toEncoding);
|
// } catch (UnsupportedEncodingException e) {
|
// e.printStackTrace();
|
// }
|
// return res;
|
// }
|
}
|