프로젝트의 확장 된 속성으로 작업합니다

Microsoft Project에는 응용 프로그램간에 정보를 교환하고 프로젝트 파일을 사용한 프로그래밍을보다 쉽게 ​​교환하는 광범위한 XML 데이터 교환 스키마가 있습니다. 스키마를 사용하면 작업, 리소스 및 할당에 확장 된 속성을 추가 할 수 있습니다. 이 기사는 Aspose.Tasks 를 사용하여 자원 할당에 확장 속성을 할당하는 방법을 보여줍니다.

확장 속성 설정 ResourceAssignment 클래스에 의해 노출 된 확장 된 Attedtribute 속성은 할당의 확장 된 속성을 관리하는 데 사용될 수 있습니다. 이 속성은 리소스의 확장 된 속성을 다루기 위해 확장 attribute 객체의 목록을 읽거나 씁니다. ExtendedAttribute 객체는 관련 속성을 추가로 노출시킵니다.

다음 예는 자원의 확장 된 속성을 설정하는 것을 보여줍니다.

 1// The path to the documents directory.
 2String dataDir = Utils.getDataDir(ExtendedAttributes.class);
 3
 4Project prj = new Project(dataDir + "project5.mpp");
 5ExtendedAttributeDefinitionCollection eads = prj.getExtendedAttributes();
 6
 7// Create extended attribute definition
 8ExtendedAttributeDefinition attributeDefinition = ExtendedAttributeDefinition
 9        .createTaskDefinition(CustomFieldType.Start, ExtendedAttributeTask.Start7, "Start 7");
10prj.getExtendedAttributes().add(attributeDefinition);
11
12eads.add(attributeDefinition);
13
14// Get zero index task
15Task tsk = prj.getRootTask().getChildren().getById(1);
16ExtendedAttributeCollection eas = tsk.getExtendedAttributes();
17
18// Add extended attribute
19ExtendedAttribute ea = attributeDefinition.createExtendedAttribute();
20ea.setFieldId(attributeDefinition.getFieldId());
21
22Date date = new Date();
23ea.setDateValue(date);
24
25eas.add(ea);
26
27prj.save(dataDir + "Project5.xml", SaveFileFormat.XML);
28
29// Display result of conversion.
30System.out.println("Process completed Successfully");
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.