0
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
package com.nokia.s60tools.apiquery.cache.xml;
|
|
19 |
|
|
20 |
|
|
21 |
import java.util.LinkedHashMap;
|
|
22 |
import java.util.Map;
|
|
23 |
|
|
24 |
import com.nokia.s60tools.apiquery.cache.resources.Messages;
|
|
25 |
import com.nokia.s60tools.apiquery.shared.datatypes.XMLToUIMappingRules;
|
|
26 |
|
|
27 |
|
|
28 |
/**
|
|
29 |
* XML to UI Mapping rules for .metaxml files.
|
|
30 |
*/
|
|
31 |
public class MetadataXMLToUIMappingRules extends XMLToUIMappingRules {
|
|
32 |
|
|
33 |
private static final String NAME_PARAM = "name"; //$NON-NLS-1$
|
|
34 |
|
|
35 |
//
|
|
36 |
// UI Texts
|
|
37 |
//
|
|
38 |
public static final String RELEASE_DEPRECATED_SINCE_VERSION = Messages.getString("MetadataXMLToUIMappingRules.DeprecatedSince"); //$NON-NLS-1$
|
|
39 |
public static final String RELEASE_SINCE_VERSION = Messages.getString("MetadataXMLToUIMappingRules.ReleaseSince"); //$NON-NLS-1$
|
|
40 |
public static final String RELEASE_CATEGORY = Messages.getString("MetadataXMLToUIMappingRules.ReleaseCategory"); //$NON-NLS-1$
|
|
41 |
public static final String ADAPTATION = Messages.getString("MetadataXMLToUIMappingRules.Adaptiotion"); //$NON-NLS-1$
|
|
42 |
public static final String HTML_DOC_PROVIDED = Messages.getString("MetadataXMLToUIMappingRules.HtmlDocProvided"); //$NON-NLS-1$
|
|
43 |
public static final String SUBSYSTEM = Messages.getString("MetadataXMLToUIMappingRules.Subsystem"); //$NON-NLS-1$
|
|
44 |
public static final String TYPE = Messages.getString("MetadataXMLToUIMappingRules.Type"); //$NON-NLS-1$
|
|
45 |
public static final String DESCRIPTION = Messages.getString("MetadataXMLToUIMappingRules.Description"); //$NON-NLS-1$
|
|
46 |
public static final String NAME = Messages.getString("MetadataXMLToUIMappingRules.Name"); //$NON-NLS-1$
|
|
47 |
public static final String LIBS = Messages.getString("MetadataXMLToUIMappingRules.Libs"); //$NON-NLS-1$
|
|
48 |
public static final String HEADERS = Messages.getString("MetadataXMLToUIMappingRules.Headers"); //$NON-NLS-1$
|
|
49 |
|
|
50 |
//Extended SDK is removed in metadata version 2.0.
|
|
51 |
public static final String EXTENDED_SDK = Messages.getString("MetadataXMLToUIMappingRules.ExtendedSDK"); //$NON-NLS-1$
|
|
52 |
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Collection replaces {@link MetadataXMLToUIMappingRules#SUBSYSTEM} in metadata version 2.0.
|
|
56 |
*/
|
|
57 |
public static final String COLLECTION = Messages.getString("MetadataXMLToUIMappingRules.Collection"); //$NON-NLS-1$
|
|
58 |
|
|
59 |
public MetadataXMLToUIMappingRules(){
|
|
60 |
init();
|
|
61 |
}
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Set rules for mapping .metaxml file to UI.
|
|
65 |
*
|
|
66 |
*/
|
|
67 |
private void init() {
|
|
68 |
|
|
69 |
/*
|
|
70 |
* 1.0 version of XML:
|
|
71 |
* <code>
|
|
72 |
* <?xml version="1.0" ?>
|
|
73 |
* <api id="3d801aa532c1cec3ee82d87a99fdf63f" dataversion="1.0">
|
|
74 |
* <name>temp</name>
|
|
75 |
* <description>temp</description>
|
|
76 |
* <type>c++</type>
|
|
77 |
* <subsystem>temp</subsystem>
|
|
78 |
* <libs><lib name="aa.lib"/>
|
|
79 |
* </libs>
|
|
80 |
* <release category="sdk" sinceversion="1.0" deprecatedsince="1.2"/>
|
|
81 |
* <attributes>
|
|
82 |
* <htmldocprovided>yes</htmldocprovided>
|
|
83 |
* <adaptation>yes</adaptation>
|
|
84 |
* <extendedsdk sinceversion="1.0" deprecatedsince="1.2"/>
|
|
85 |
* </attributes>
|
|
86 |
* </api>
|
|
87 |
* </code>
|
|
88 |
* 2.0 version of XML
|
|
89 |
*
|
|
90 |
* <?xml version="1.0" ?>
|
|
91 |
* <api id="3d801aa532c1cec3ee82d87a99fdf63f" dataversion="1.0">
|
|
92 |
* <name>temp</name>
|
|
93 |
* <description>temp</description>
|
|
94 |
* <type>c++</type>
|
|
95 |
* <collection>temp</collection>
|
|
96 |
* <libs><lib name="aa.lib"/>
|
|
97 |
* </libs>
|
|
98 |
* <release category="public" sinceversion="1.0" deprecatedsince="1.2"/>
|
|
99 |
* <attributes>
|
|
100 |
* <htmldocprovided>yes</htmldocprovided>
|
|
101 |
* <adaptation>yes</adaptation>
|
|
102 |
* </attributes>
|
|
103 |
* </api>
|
|
104 |
*/
|
|
105 |
|
|
106 |
addRule(NAME_PARAM, NAME);
|
|
107 |
addRule("description", DESCRIPTION);//$NON-NLS-1$
|
|
108 |
addRule("type", TYPE);//$NON-NLS-1$
|
|
109 |
addRule("subsystem", SUBSYSTEM);//$NON-NLS-1$
|
|
110 |
addRule("collection", COLLECTION);//$NON-NLS-1$ //Collection replaces subsystem in version 2.0
|
|
111 |
|
|
112 |
//Libs parameters
|
|
113 |
Map<String, String> libAttributes = new LinkedHashMap <String,String>();
|
|
114 |
libAttributes.put(NAME_PARAM, NAME_PARAM); //$NON-NLS-1$
|
|
115 |
addRule("lib", LIBS, "libs", libAttributes);//$NON-NLS-1$ //$NON-NLS-2$
|
|
116 |
|
|
117 |
//release parameters
|
|
118 |
//@see e.g. Z:\s60\mw\cameraengines\cameraengines_dom\custom_onboard_camera_api\custom_onboard_camera_api.metaxml for release attributes
|
|
119 |
Map<String, String> releasAttributes = new LinkedHashMap <String, String>();
|
|
120 |
releasAttributes.put("category", RELEASE_CATEGORY); //$NON-NLS-1$ //$NON-NLS-2$
|
|
121 |
releasAttributes.put("sinceversion", RELEASE_SINCE_VERSION); //$NON-NLS-1$ //$NON-NLS-2$
|
|
122 |
releasAttributes.put("deprecatedsince", RELEASE_DEPRECATED_SINCE_VERSION); //$NON-NLS-1$ //$NON-NLS-2$
|
|
123 |
addRule("release", Messages.getString("MetadataXMLToUIMappingRules.Release"), releasAttributes); //$NON-NLS-1$ //$NON-NLS-2$
|
|
124 |
|
|
125 |
addRule("htmldocprovided", HTML_DOC_PROVIDED);//$NON-NLS-1$
|
|
126 |
addRule("adaptation", ADAPTATION);//$NON-NLS-1$
|
|
127 |
|
|
128 |
//Extended SDK parameters
|
|
129 |
//Extended SDK is removed in metadata version 2.0.
|
|
130 |
//Developer edited by hand file: Z:\s60\mw\ahle\ahle_dom\adaptive_history_list_api\adaptive_history_list_api.metaxml Where is extended SDK params to tests - This comment can be removed.
|
|
131 |
Map<String, String> extendedAttributes = new LinkedHashMap <String, String>();
|
|
132 |
extendedAttributes.put("sinceversion", "Extended SDK since version"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
133 |
extendedAttributes.put("deprecatedsince", "Extended SDK deprecated since version"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
134 |
addRule("extendedsdk", EXTENDED_SDK, extendedAttributes);//$NON-NLS-1$
|
|
135 |
|
|
136 |
|
|
137 |
}
|
|
138 |
|
|
139 |
}
|