當批量導入用戶時,我試圖將Locale設為中文,測試過:zh_CN,CN,China等都不對,雖能正常導入,但導入后用戶的Locale設置錯誤,更新用戶時還是英文的。
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);
...
根據程序并跟蹤測試,得知Locale為中文時應該寫:
中文 (中國)
(注意:中間必須有一個空格)
如:User,,eric,eric,Eric Lin,中文 (中國),eric@abc.com,,,,,,,,,,x,1234
同理, 繁體中文應設置為:
中文 (臺灣)
----------------------------------------------------
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數據庫重新導入后,導致不能通過WGM和Proe Wildfire來創建EPMDocument,解決方法是:重新運行%WT_HOME%dbsqlwnc-wsp.sql,當然這要求當前Windchill系統必須正確安裝MO10和M020的patch。
---------------------------------------------------
導入Part和Doc的關聯
導入格式:
#PartDocLink,*文檔編號,docVersion,docIteration,*零部件編號,partVersion,partIteration
PartDocLink,SJ0000001,,,100-10-12,,
...
如上所示,如果partVersion為空,將可能導致系統創建關聯到舊版本的Part上。
建議把該欄位全部填上“A”即可創建關聯到Part的最新版本上。
在LoadPart.class中,根據編號、大版本、小版本獲取Part的函數如下:
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;
}
可見,但大版本為空時,沒有獲取到最新小版本;
當大版本不為空,小版本為空時,可以正常獲取到最新小版本。
而在LoadDoc.class中,根據編號、大版本、小版本獲取Doc的函數如下:
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;
}
可見,文檔的大版本和小版本都可以不寫,系統能找到最新小版本。
利用系統的導入程序導入文件注意以下幾點:(否則會出現即使文件能正常導入但是主文件卻不入庫的情況)
——文件類型必須存在;
——導入數據中所指定了的軟屬性必須是該文件類型已經擁有的軟屬性;
——采用絕對路徑的格式如下:“H:DocTest.txt”、“H:documentDocTest.txt”;
——如果采用相對路徑是指“%WT_HOME%loadFilescontent”目錄下的相對路徑;
——只要采用系統提供的導入程序就可以了,但是為了正常導入,并加入文檔的創建者需要修改系統提供的csvmapfile.txt文件,修改如下:
————系統: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:一般對象(如:Group、AccessRule……)在導入時都要在系統的csvmapfile.txt字段的基礎上加上字段“parentContainerPath”
----------------------------------------------------------------------
軟類型的導入
當導入軟類型時,如果你的主機名不是以ptc.com結尾的,必須填寫完整的軟類型名稱,否則將無法導入。如:
TypeNodeIconRoot,wt/clients/images,,,,,,,,,
BeginTypeDefNode,com.ptc.SitePart,wt.part.WTPart,part.gif,SitePart,SitePart,SitePart,
TRUE,FALSE,TRUE,SitePart
TypeDefAttrValue,ProjectPhase,Design,,,,,,,,,
...
EndTypeDefNode
相關文章
- 2021-09-08EXCEL在工作中的應用 制表、數據處理及宏應用PDF下載
- 2021-08-23精通AutoCAD三維設計與開發PDF下載
- 2021-08-22AutoCAD 2013應用與開發系列中文版AutoCAD 2013室內裝
- 2021-08-22AutoCAD 2013應用與開發系列中文版AutoCAD 2013機械圖
- 2021-08-19數字化成圖-最新AutoCAD地形圖測繪高級開發PDF下載
- 2021-08-03Autodesk RevitStructure實例詳解 [黃亞斌,徐欽 主編]
- 2021-08-03Autodesk RevitStructure2012應用寶典 [歐特克軟件(中
- 2021-08-02Autodesk RevitMEP2012應用寶典 [歐特克軟件(中國)有限
- 2021-08-02Autodesk Revit2013族達人速成 [歐特克軟件(中國)有限公
- 2021-08-01Visual Basic與AutoCAD二次開發PDF下載