describeGlobalTheme()
構文
1DescribeGlobalTheme = connection.describeGlobalTheme();使用方法
describeGlobalTheme() を使用して、組織で使用可能なオブジェクトのリストと、それらのオブジェクトに関するテーマ情報の両方を取得します。describeGlobalTheme() は、describeGlobal() と describeTheme() を単一のコールに組み合わせたものです。
組織のデータのテーマとオブジェクト情報を取得するには、条件を満たすアクセス権限でクライアントアプリケーションにログインする必要があります。詳細は、「データアクセスに影響する要素」を参照してください。
describeGlobalTheme() は、API バージョン 29.0 以降で使用できます。
サンプル
この Java のサンプルでは、describeGlobalTheme() をコールした後、取得したオブジェクトとテーマ情報を反復します。
1swfobject.registerObject("clippy.codeblock-1", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17public static void describeGlobalThemeExample() {
18 try {
19 // Get current theme and object information
20 DescribeGlobalTheme globalThemeResult = connection.describeGlobalTheme();
21 DescribeGlobalResult globalResult = globalThemeResult.getGlobal();
22 DescribeThemeResult globalTheme = globalThemeResult.getTheme();
23 // For the themes, get the array of theme items, one per object
24 DescribeThemeItem[] themeItems = globalTheme.getThemeItems();
25 for (int i = 0; i < themeItems.length; i++) {
26 DescribeThemeItem themeItem = themeItems[i];
27 System.out.println("Theme information for object " + themeItem.getName());
28 // Get color and icon info for each themeItem
29 DescribeColor colors[] = themeItem.getColors();
30 System.out.println(" Number of colors: " + colors.length);
31 int k;
32 for (k = 0; k < colors.length; k++) {
33 DescribeColor color = colors[k];
34 System.out.println(" For Color #" + k + ":");
35 System.out.println(" Web RGB Color: " + color.getColor());
36 System.out.println(" Context: " + color.getContext());
37 System.out.println(" Theme: " + color.getTheme());
38 }
39 DescribeIcon icons[] = themeItem.getIcons();
40 System.out.println(" Number of icons: " + icons.length);
41 for (k = 0; k < icons.length; k++) {
42 DescribeIcon icon = icons[k];
43 System.out.println(" For Icon #" + k + ":");
44 System.out.println(" ContentType: " + icon.getContentType());
45 System.out.println(" Height: " + icon.getHeight());
46 System.out.println(" Theme: " + icon.getTheme());
47 System.out.println(" URL: " + icon.getUrl());
48 System.out.println(" Width: " + icon.getWidth());
49 }
50 }
51 } catch (ConnectionException ce) {
52 ce.printStackTrace();
53 }
54}
55