當(dāng)批量導(dǎo)入用戶時(shí),我試圖將Locale設(shè)為中文,測(cè)試過(guò):zh_CN,CN,China等都不對(duì),雖能正常導(dǎo)入,但導(dǎo)入后用戶的Locale設(shè)置錯(cuò)誤,更新用戶時(shí)還是英文的。
LoadUser.class中的程序:
...
String s5 = LoadServerHelper.getValue("Locale", hashtable, hashtable1, 1);
...
if(s5 == null)
s5 = "English (United States)";
if(s5.equals("US"))
s5 = "English (United States)";
Locale locale = new Locale(s5, s5);
String s17 = locale.toString();
Enumeration enumeration = (new Vector()).elements();
for(Enumeration enumeration1 = OrganizationServicesHelper.manager.getUserLanguages(); enumeration1.hasMoreElements();)
{
Locale locale1 = (Locale)enumeration1.nextElement();
String s20 = locale1.getDisplayName(locale);
if(s20.equalsIgnoreCase(s5))
s17 = locale1.toString();
}
s17 = s17.replace('_', '-');
vector1.addElement(DirContext.getMapping(defaultAdapter, "user.preferredLanguage") + '=' + s17);
...
根據(jù)程序并跟蹤測(cè)試,得知Locale為中文時(shí)應(yīng)該寫(xiě):
中文 (中國(guó))
(注意:中間必須有一個(gè)空格)
如:User,,eric,eric,Eric Lin,中文 (中國(guó)),eric@abc.com,,,,,,,,,,x,1234
同理, 繁體中文應(yīng)設(shè)置為:
中文 (臺(tái)灣)
----------------------------------------------------
How to Bulk-Load documents that are soft-types of some Out-of-the-Box provided type.
Assuming that,
1. A Library called 'MyLib' exists and contain a folder called 'Folder1'
2. A soft-type of Out-of-the-box provided RefernceDocument, called SubOfRef was created that has two attributes. The name of this soft-type should be exactly as it is reported by Type Manager UI.
a) MBool, a boolean
b) MString, a String
3. An Organization called MyOrg exists
Then use ...
windchill wt.load.LoadFromFile -d C:PathToMyFile.xml -u wcadmin -p wcadmin -CONT_PATH "/wt.inf.container.OrgContainer=MyOrg/wt.inf.library.WTLibrary=MyLib"
...to load the data below.
Name of SoftType Load - 01
Title of SoftType Load - 01
NUM:SoftType-01
Document
description 1112-002
DESIGN
/Default/Folder1
com.ptc.ReferenceDocument│com.ptc.SubOfRef
MyAttrs/MBool
false
MyAttrs/MString
Eleven
ApplicationData
EGadWork.xls
DGadReq.doc
DGadSpec.doc
----------------------------------------------------
Windchill PDMLink 7.0數(shù)據(jù)庫(kù)重新導(dǎo)入后,導(dǎo)致不能通過(guò)WGM和Proe Wildfire來(lái)創(chuàng)建EPMDocument,解決方法是:重新運(yùn)行%WT_HOME%dbsqlwnc-wsp.sql,當(dāng)然這要求當(dāng)前Windchill系統(tǒng)必須正確安裝MO10和M020的patch。
---------------------------------------------------
導(dǎo)入Part和Doc的關(guān)聯(lián)
導(dǎo)入格式:
#PartDocLink,*文檔編號(hào),docVersion,docIteration,*零部件編號(hào),partVersion,partIteration
PartDocLink,SJ0000001,,,100-10-12,,
...
如上所示,如果partVersion為空,將可能導(dǎo)致系統(tǒng)創(chuàng)建關(guān)聯(lián)到舊版本的Part上。
建議把該欄位全部填上“A”即可創(chuàng)建關(guān)聯(lián)到Part的最新版本上。
在LoadPart.class中,根據(jù)編號(hào)、大版本、小版本獲取Part的函數(shù)如下:
private static WTPart getPart(String s, String s1, String s2)
throws WTException
{
WTPart wtpart = getCachedPart(s, s1, s2);
if(wtpart == null && s != null)
{
boolean flag = false;
QuerySpec queryspec = new QuerySpec(wt.part.WTPart.class);
queryspec.appendWhere(new SearchCondition(wt.part.WTPart.class, "master>number", "=", s.toUpperCase(), false));
if(s1 != null)
{
queryspec.appendAnd();
queryspec.appendWhere(new SearchCondition(wt.part.WTPart.class, "versionInfo.identifier.versionId", "=", s1, false));
if(s2 != null)
{
queryspec.appendAnd();
queryspec.appendWhere(new SearchCondition(wt.part.WTPart.class, "iterationInfo.identifier.iterationId", "=", s2, false));
} else
{
queryspec.appendAnd();
queryspec.appendWhere(new SearchCondition(wt.part.WTPart.class, "iterationInfo.latest", "TRUE"));
}
} else
{
flag = true;
}
QueryResult queryresult = PersistenceHelper.manager.find(queryspec);
if(flag)
{
queryresult = (new OwnershipIndependentLatestConfigSpec()).process(queryresult);
}
if(queryresult.size() > 0)
{
wtpart = (WTPart)queryresult.nextElement();
wtpart = cachePart(wtpart);
}
}
return wtpart;
}
可見(jiàn),但大版本為空時(shí),沒(méi)有獲取到最新小版本;
當(dāng)大版本不為空,小版本為空時(shí),可以正常獲取到最新小版本。
而在LoadDoc.class中,根據(jù)編號(hào)、大版本、小版本獲取Doc的函數(shù)如下:
public static WTDocument getDocument(String s, String s1, String s2)
throws WTException
{
WTDocument wtdocument = getCachedDocument(s, s1, s2);
if(wtdocument == null && s != null)
{
QuerySpec queryspec = new QuerySpec(wt.doc.WTDocument.class);
queryspec.appendWhere(new SearchCondition(wt.doc.WTDocument.class, "master>number", "=", s.toUpperCase(), false));
if(s1 == null)
{
queryspec.appendAnd();
queryspec.appendWhere(new SearchCondition(wt.doc.WTDocument.class, "iterationInfo.latest", "TRUE"));
} else
{
queryspec.appendAnd();
queryspec.appendWhere(new SearchCondition(wt.doc.WTDocument.class, "versionInfo.identifier.versionId", "=", s1, false));
if(s2 != null)
{
queryspec.appendAnd();
queryspec.appendWhere(new SearchCondition(wt.doc.WTDocument.class, "iterationInfo.identifier.iterationId", "=", s2, false));
}
}
QueryResult queryresult = PersistenceHelper.manager.find(queryspec);
if(queryresult.size() > 0)
{
wtdocument = (WTDocument)queryresult.nextElement();
if(s1 != null && s2 == null)
{
wtdocument = (WTDocument)VersionControlHelper.getLatestIteration(wtdocument);
}
wtdocument = cacheDocument(wtdocument);
}
}
return wtdocument;
}
可見(jiàn),文檔的大版本和小版本都可以不寫(xiě),系統(tǒng)能找到最新小版本。
利用系統(tǒng)的導(dǎo)入程序?qū)胛募⒁庖韵聨c(diǎn):(否則會(huì)出現(xiàn)即使文件能正常導(dǎo)入但是主文件卻不入庫(kù)的情況)
——文件類(lèi)型必須存在;
——導(dǎo)入數(shù)據(jù)中所指定了的軟屬性必須是該文件類(lèi)型已經(jīng)擁有的軟屬性;
——采用絕對(duì)路徑的格式如下:“H:DocTest.txt”、“H:documentDocTest.txt”;
——如果采用相對(duì)路徑是指“%WT_HOME%loadFilescontent”目錄下的相對(duì)路徑;
——只要采用系統(tǒng)提供的導(dǎo)入程序就可以了,但是為了正常導(dǎo)入,并加入文檔的創(chuàng)建者需要修改系統(tǒng)提供的csvmapfile.txt文件,修改如下:
————系統(tǒng):BeginWTDocument~create~wt.doc.LoadDoc.beginCreateWTDocument~name~title
~number~type~description~department~saveIn~teamTemplate~domain~
lifecycletemplate~lifecyclestate~typedef~version~iteration
————修改后:BeginWTDocument~create~wt.doc.LoadDoc.beginCreateWTDocument~user~name
~title~number~type~description~department~saveIn~teamTemplate~domain~
lifecycletemplate~lifecyclestate~typedef~version~iteration~parentContainerPath
NOTE:一般對(duì)象(如:Group、AccessRule……)在導(dǎo)入時(shí)都要在系統(tǒng)的csvmapfile.txt字段的基礎(chǔ)上加上字段“parentContainerPath”
----------------------------------------------------------------------
軟類(lèi)型的導(dǎo)入
當(dāng)導(dǎo)入軟類(lèi)型時(shí),如果你的主機(jī)名不是以ptc.com結(jié)尾的,必須填寫(xiě)完整的軟類(lèi)型名稱(chēng),否則將無(wú)法導(dǎo)入。如:
TypeNodeIconRoot,wt/clients/images,,,,,,,,,
BeginTypeDefNode,com.ptc.SitePart,wt.part.WTPart,part.gif,SitePart,SitePart,SitePart,
TRUE,FALSE,TRUE,SitePart
TypeDefAttrValue,ProjectPhase,Design,,,,,,,,,
...
EndTypeDefNode
相關(guān)文章
- 2021-09-08EXCEL在工作中的應(yīng)用 制表、數(shù)據(jù)處理及宏應(yīng)用PDF下載
- 2021-08-23精通AutoCAD三維設(shè)計(jì)與開(kāi)發(fā)PDF下載
- 2021-08-22AutoCAD 2013應(yīng)用與開(kāi)發(fā)系列中文版AutoCAD 2013室內(nèi)裝
- 2021-08-22AutoCAD 2013應(yīng)用與開(kāi)發(fā)系列中文版AutoCAD 2013機(jī)械圖
- 2021-08-19數(shù)字化成圖-最新AutoCAD地形圖測(cè)繪高級(jí)開(kāi)發(fā)PDF下載
- 2021-08-03Autodesk RevitStructure實(shí)例詳解 [黃亞斌,徐欽 主編]
- 2021-08-03Autodesk RevitStructure2012應(yīng)用寶典 [歐特克軟件(中
- 2021-08-02Autodesk RevitMEP2012應(yīng)用寶典 [歐特克軟件(中國(guó))有限
- 2021-08-02Autodesk Revit2013族達(dá)人速成 [歐特克軟件(中國(guó))有限公
- 2021-08-01Visual Basic與AutoCAD二次開(kāi)發(fā)PDF下載