楼主: rattbell

Windchill PLM产品及实施简介

[复制链接]
论坛徽章:
0
271#
发表于 2011-7-28 12:39 | 只看该作者
upup

使用道具 举报

回复
论坛徽章:
0
272#
发表于 2011-8-1 17:50 | 只看该作者

dddd

/***
     * 获取部件对象下面挂的所有IBA属性
     *  
     * @param part  华为部件
     * @return      IBA属性Map集合
     */
    public static Map<String, String> getPartIBA(HuaweiPart part) {
        IBAHolder ibaholder = (IBAHolder) part;
        Map<String, String> ibaMap = new HashMap<String, String>();
        try {
            ibaholder = IBAValueHelper.service.refreshAttributeContainer(ibaholder, null, SessionHelper.manager.getLocale(), null);
            DefaultAttributeContainer attrContainer = (DefaultAttributeContainer) ibaholder.getAttributeContainer();
            AttributeDefDefaultView[] attrDefViews = attrContainer.getAttributeDefinitions();
            System.out.println("attrDefViews.length=" + attrDefViews.length);
            
            for (int i = 0; i < attrDefViews.length; i++) {
                String ibaName = attrDefViews.getName();
                AbstractValueView[] attrValueViews = attrContainer.getAttributeValues(attrDefViews);
                StringBuffer ibaValue = new StringBuffer();
                for (int j = 0; j < attrValueViews.length; j++) {
                    AbstractValueView attrValueView = attrValueViews[j];
                    ibaValue.append(attrValueView.getLocalizedDisplayString(SessionHelper.manager.getLocale())).append(";");
                }
                System.out.println("ibaName=" + ibaName + ",ibaValue=" + ibaValue.toString());
                ibaMap.put(ibaName, ibaValue.toString());
                System.out.println("iba Map Size:\t" + ibaMap.size());
                System.out.println("iBa Map Key:\t" + ibaMap.get(ibaName));
            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return ibaMap;
    }

使用道具 举报

回复
论坛徽章:
0
273#
发表于 2011-8-1 17:52 | 只看该作者

xxxx

/**
     * 写xml
     * Please write comments here
     */
    public static void ProcessWriter(String startTime, String endTime, String partState) {
        String xmlpath = "C:\\process.xml";
        try {
            //Document
            Element root = new Element("Root";
            Document doc = new Document(root);
            
            Map<HuaweiPart, Map<String, String>> partMap = getPartByCondition(startTime,endTime, partState);

                System.out.println("step into....";

                for (Iterator<HuaweiPart> iterMap = partMap.keySet().iterator(); iterMap.hasNext() {
                    Element partEle = new Element("Part";
                    root.addContent(partEle);
                    
                    HuaweiPart part1 = (HuaweiPart) iterMap.next();
                    Map<String, String> ibavalue = partMap.get(part1);
                    partEle.setAttribute("name", part1.getName());
                    partEle.setAttribute("number", part1.getNumber());
                    partEle.setAttribute("createtime",part1.getCreateTimestamp().toString());
                  
                    //遍历iba
                    for (Iterator<String> ibaMap = ibavalue.keySet().iterator(); ibaMap.hasNext() {
                        Element ibaEle = new Element("Iba";
                        partEle.addContent(ibaEle);
                        
                        String key = ibaMap.next();
                        ibaEle.setAttribute(key,ibavalue.get(key).toString());
                     
                    }

                }

            XMLOutputter outputter = new XMLOutputter();
            outputter.setEncoding("utf-8";
            outputter.output(doc, new FileOutputStream(xmlpath));
            
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

使用道具 举报

回复
论坛徽章:
0
274#
发表于 2011-8-2 16:56 | 只看该作者
谢谢!

使用道具 举报

回复
论坛徽章:
1
ERP板块每日发贴之星
日期:2011-08-10 01:01:01
275#
发表于 2011-8-9 09:33 | 只看该作者
学习,持续关注plm

使用道具 举报

回复
论坛徽章:
0
276#
发表于 2011-8-9 11:35 | 只看该作者
回复一下,看看

使用道具 举报

回复
论坛徽章:
0
277#
发表于 2011-8-10 11:38 | 只看该作者
膜拜

使用道具 举报

回复
论坛徽章:
0
278#
发表于 2011-8-11 21:09 | 只看该作者
学习,努力,感谢!

使用道具 举报

回复
论坛徽章:
2
2008新春纪念徽章
日期:2008-02-13 12:43:03ERP板块每日发贴之星
日期:2011-08-20 01:01:01
279#
发表于 2011-8-19 08:31 | 只看该作者
good.

使用道具 举报

回复
论坛徽章:
0
280#
发表于 2011-8-26 20:12 | 只看该作者
不错,想看一下

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表