プロジェクトでアウトラインコードを操作します
カスタムアウトラインコードは、WBSコードやアウトライン番号とは異なるプロジェクト構造を提供するタスクまたはリソースに対して定義するタグです。 JavaのAspose.Tasksでは、これらのアウトラインコードと、エイリアス、AlllevelsRequired、Enterprise、EnterpriseOutlineCodealias、FieldID、FieldName、Phoneticalias、GUID、MASKS、および価値などのプロパティを取得できます。
アウトラインコード定義の取得 プロジェクトクラスは getoutlineCodes()を公開します。 OutlineCodededefinitionは、次のサンプルコードに示すように、すべての詳細を提供します。
次のコード行は、プロジェクトのアウトラインコード情報を取得します。
1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
2Project project = new Project(projectName);
3for (OutlineCodeDefinition ocd : project.getOutlineCodes()) {
4 System.out.println("Alias = " + ocd.getAlias());
5 if (ocd.getAllLevelsRequired()) {
6 System.out.println("It contains property: must have all levels");
7 } else {
8 System.out.println("It does not contain property: must have all levels");
9 }
10 if (ocd.getEnterprise()) {
11 System.out.println("It is an enterprise custom outline code.");
12 } else {
13 System.out.println("It is not an enterprise custom outline code.");
14 }
15 System.out.println(
16 "Reference to another custom field for which this outline code definition is an alias is = "
17 + ocd.getEnterpriseOutlineCodeAlias());
18 System.out.println("Field Id = " + ocd.getFieldId());
19 System.out.println("Field Name = " + ocd.getFieldName());
20 System.out.println("Phonetic Alias = " + ocd.getPhoneticAlias());
21 System.out.println("Guid = " + ocd.getGuid());
22
23 // Display outline code masks
24 for (OutlineMask m1 : ocd.getMasks()) {
25 System.out.println("Level of a mask = " + m1.getLevel());
26 System.out.println("Mask = " + m1.toString());
27 }
28
29 // Display out line code values
30 for (OutlineValue v1 : ocd.getValues()) {
31 System.out.println("Description of outline value = " + v1.getDescription());
32 System.out.println("Value Id = " + v1.getValueId());
33 System.out.println("Value = " + v1.getValue());
34 System.out.println("Type = " + v1.getType());
35 }
36}