다른 응용 프로그램과 통합 > Creo Parametric – Windchill Integration > 관리 및 구성 > Creo Parametric과의 상호 작업을 위한 Windchill 구성 > CAD 문서와 WTPart의 이름 지정 및 번호 지정 관리 > 네이밍 서비스 사용자 정의
  
네이밍 서비스 사용자 정의
네이밍 서비스에서는 작성할 새 EPMDocument에 대해 다음을 지정할 수 있도록 Windchill 서비스 위임 메커니즘을 사용합니다.
EPMDocument의 번호 설정
EPMDocument의 이름 설정
* 
업로드 시 네이밍 서비스 사용자 정의는 Windchill 10.0 이전 버전에서 사용자 정의 코드를 사용하여 이름과 번호를 생성하기 위해 사용할 수 있습니다. 하지만 Windchill 10.0 이전 버전에서는 네이밍 서비스 사용자 정의에 사용하기 위해 업로드 요청에 매개변수를 사용할 수 없습니다.
* 
이름 지정 서비스는 업로드 작업 전용입니다. 시스템에서 이름 지정 정책 및 사용자 정의에 사용되는 우선 순위는 다음과 같습니다.
이름:
1. 이름 지정 서비스 사용자 정의
2. Creo Parametric파일 > 새로 만들기 창을 통해 명시적으로 지정된 공통 이름
3. 이름 매개변수(작업 > 업로드 작업 > 업로드 > 이름 지정 매개변수 = <문자열 매개변수>)
4. 파일 이름(기본 설정 작업 > 업로드 작업 > 업로드 > 파일 확장자 삭제 시 이름 업로드는 파일 이름(CAD 이름)을 기준으로 이름이 지정된 경우에만 적용됩니다.)
번호:
1. 이름 지정 서비스 사용자 정의
2. 번호 매개변수(작업 > 업로드 작업 > 업로드 > 번호 지정 매개변수)
3. 파일 이름(기본 설정 작업 > 업로드 작업 > 업로드 > 파일 확장자 삭제 시 번호 업로드는 파일 이름[CAD 이름]을 기준으로 번호가 지정된 경우에만 적용됩니다.)
이름 지정 서비스를 사용자 정의하려면 다음 절차를 따르십시오.
1. 인터페이스 EPMDocumentNamingDelegate를 구현하는 Java 클래스를 작성합니다. 인터페이스 정의는 다음과 같습니다.
package com.ptc.windchill.uwgm.proesrv.c11n;
public interface EPMDocumentNamingDelegate
{
public void validateDocumentIdentifier(DocIdentifier
docIdentifier);
}
DocIdentifier 클래스의 정의는 다음과 같습니다.
package com.ptc.windchill.uwgm.proesrv.c11n;
import java.util.HashMap;
public class DocIdentifier
{
{
private String m_modelName;
private String m_docName;
private String m_docNumber;
private HashMap m_parameters;
}
public DocIdentifier(String modelName, String
docName, String docNumber, HashMap params)
{
m_modelName = modelName;
m_docName= docName;
m_docNumber= docNumber;
m_parameters= params;
}
/** get the CAD Name for the model **/

public String getModelName()
{
return m_modelName;
}
/** get the EPMDocument name for the model **/

public String getDocName()
{
return m_docName;
}
/** set the EPMDocument name for the model **/
public void setDocName(String docname)
{
m_docName = docname;
}
/** set the EPMDocument number for the model **/
public void setDocNumber(String docnumber)
{
m_docNumber = docnumber;
}
/** get the EPMDocument number for the model **/
public String getDocNumber()
{
return m_docNumber;
}
/** get the Pro/E designated parameters for the model. These are
name-value pairs indexed by the name **/
public HashMap getParameters()
{
return m_parameters;
}
}
2. 새 클래스에서는 EPMDocument 이름/번호 지정을 위한 비즈니스 로직을 메소드에 구현합니다.
public void validateDocumentIdentifier(DocIdentifier docIdentifier)
DocumentIdentifier 객체는 업로드 서비스가 작성할 EPMDocument의 이름과 번호 정보를 갖습니다.
이 DocIdentifier 객체가 나타내는 EPMDocument의 CAD 이름을 가져오려면 DocIdentifier.getModelName()을 사용합니다.
Creo Parametric에서 지정한 매개변수를 사용하여 EPMDocument 번호/이름 지정을 설정할 수 있습니다.
연관된 매개변수를 가져오려면 DocIdentifier.getParameters()를 사용합니다.
DocIdentifier의 "set" 메소드를 사용하여 새 이름/번호 값을 설정합니다. 업로드 서비스에서는 이 제안이 실행 가능할 경우 적용합니다.
3. site.xconf 파일(<Windchill>)을 편집하여 서버에서 사용자 정의 서비스의 가용성을 나타내도록 다음 등록 정보를 추가합니다.
<Service context="default" name="com.ptc.windchill.uwgm.proesrv.c11n.EPMDocumentNamingDelegate" targetFile="codebase/service.properties">
<Option cardinality="singleton" requestor="wt.epm.EPMDocument" serviceClass="com.ptc.windchill.uwgm.proesrv.c11n.EPMDefaultDocument NamingDelegate"/>
</Service>
그런 다음 xconfmanager 도구를 사용하여 service.properties 파일에 변경 사항을 적용합니다(-xconfmanager p 실행).
serviceClass의 값 대신 해당 클래스의 경로를 사용합니다(즉 "com.ptc.windchill.uwgm.proesrv.c11n.EPMDefaultDocumentNamingDelegate"를 해당 클래스의 경로로 대체).
4. 메소드 서버를 다시 시작합니다.