configurationengine/doc/plugins/general.rst
author terytkon
Thu, 11 Mar 2010 17:04:37 +0200
changeset 0 2e8eeb919028
child 3 e7e0ae78773e
permissions -rw-r--r--
Adding EPL version of configurationengine.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     1
ImplML and plug-ins
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     2
===================
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     3
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     4
The `configuration project` concept contains an interface/implementation split
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     5
by using the Configuration Markup Language (ConfML) to specify the interface for
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     6
configurable entities in a project, and an arbitrary number of Implementation
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     7
Markup Languages (ImplML) to specify the output generated based on the interface.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     8
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     9
ConE plug-ins supply the actual code-level implementations for the different
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    10
implementation languages. This page describes common ImplML concepts.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    11
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    12
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    13
ImplML basics
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    14
-------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    15
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    16
All implementation languages are based on XML, and each separate
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    17
Implementation Mark-up Language (ImplML) resides within a single
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    18
XML namespace. The namespace of the ImplML must be defined in
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    19
the file, or the implementation won't be recognized. For example,
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    20
the following file is an example of CRML (Central Repository
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    21
Mark-up Language):
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    22
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    23
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    24
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    25
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    26
    <?xml version="1.0" encoding="UTF-8"?>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    27
    <repository xmlns="http://www.s60.com/xml/cenrep/1" uidName="Feature1_1" uidValue="0x00000001" owner="0x12341000">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    28
        <access type="R" capabilities="AlwaysPass"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    29
        <access type="W" capabilities="AlwaysPass"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    30
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    31
        <key ref="Feature1/IntSetting" name="Int setting" int="0x00000001" type="int" readOnly="false" backup="true">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    32
            <access type="R" capabilities="AlwaysPass"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    33
        </key>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    34
    </repository>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    35
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    36
Notice the use of the XML namespace ``xmlns="http://www.s60.com/xml/cenrep/1"``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    37
in the root element. This is what tells ConE that a CRML implementation should
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    38
be read from this XML document's root element. Here there is only one implementation
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    39
language used, and the extension of the file can reflect this (the extension is
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    40
.crml in this case).
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    41
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    42
However, the use of XML namespaces to differentiate implementation languages
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    43
enables the mixing of multiple languages in a single implementation file.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    44
For example, the following file uses two implementation languages under common container,
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    45
RuleML and ContentML:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    46
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    47
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    48
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    49
    <?xml version="1.0" encoding="UTF-8"?>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    50
    <container xmlns="http://www.symbianfoundation.org/xml/implml/1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    51
        <ruleml xmlns="http://www.s60.com/xml/ruleml/2">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    52
            <rule>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    53
                CustomSettings.StartupSoundFile.localPath configures StartupSettings.StartupSoundPath
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    54
                    = Startup.StartupSoundPath filenamejoin CustomSettings.StartupSoundFile.localPath
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    55
            </rule>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    56
        </ruleml>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    57
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    58
        <content xmlns="http://www.s60.com/xml/content/3">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    59
            <output file="${StartupSettings.StartupSoundPath}">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    60
                <input file="${CustomSettings.StartupSoundFile.localPath}"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    61
            </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    62
        </content>        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    63
    </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    64
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    65
The execution order of elements inside the container is the same as the order of definition.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    66
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    67
In this example, the RuleML section first sets the value of a ConfML setting,
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    68
whose value is then used in the ContentML section to copy the file to the
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    69
correct place. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    70
Notice how the XML namespaces are defined. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    71
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    72
 - The container is in http://www.symbianfoundation.org/xml/implml/1, the root element of implml namespace must always be container
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    73
 - The ruleml is in http://www.s60.com/xml/ruleml/2
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    74
 - The content is in xmlns="http://www.s60.com/xml/content/3"
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    75
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    76
When reading the implementation file, ConE checks the document root and its namespace 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    77
to find out from namespace to start parsing. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    78
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    79
.. _implml-file-extensions:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    80
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    81
File extensions
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    82
^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    83
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    84
Implementations are read from files under layers' ``implml/`` directories
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    85
inside the configuration project. The extensions of these files matter
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    86
in whether implementations are attempted to be read from a file or
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    87
not. The generic implementation file extension is ``implml``, but plug-ins
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    88
may extend the list of supported file extensions. However, the extension
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    89
does nothing more than specify whether the file is attempted to be parsed or
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    90
not; no checking on the implementation types is done. This means that
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    91
it is possible to create e.g. a CRML file with the extension ``templateml``,
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    92
but of course this makes no sense and should be avoided. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    93
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    94
The extension checking mechanism is there in order to differentiate
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    95
implementation files and any other related files, e.g. Python scripts
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    96
used by RuleML implementations. This way, if an implementation file
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    97
contains invalid XML data an error will be shown to the user, but a
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    98
Python script (the reading of which as XML would invariably fail and
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    99
produce an error) will simply be ignored.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   100
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   101
If you want to see what file extensions are supported, run to following
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   102
command::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   103
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   104
    cone info --print-supported-impls
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   105
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   106
This will print something like the following::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   107
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   108
    Running action info
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   109
    Supported ImplML namespaces:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   110
    http://www.symbianfoundation.org/xml/implml/1
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   111
    http://www.s60.com/xml/cenrep/1
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   112
    http://www.s60.com/xml/content/1
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   113
    http://www.s60.com/xml/content/2
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   114
    http://www.s60.com/xml/convertprojectml/1
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   115
    http://www.s60.com/xml/genconfml/1
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   116
    http://www.s60.com/xml/imageml/1
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   117
    http://www.s60.com/xml/ruleml/1
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   118
    http://www.s60.com/xml/ruleml/2
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   119
    http://www.s60.com/xml/templateml/1
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   120
    http://www.s60.com/xml/thememl/1
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   121
    http://www.symbianfoundation.org/xml/hcrml/1
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   122
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   123
    Supported ImplML file extensions:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   124
    implml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   125
    content
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   126
    contentml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   127
    crml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   128
    gcfml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   129
    convertprojectml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   130
    ruleml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   131
    imageml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   132
    thememl
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   133
    templateml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   134
    hcrml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   135
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   136
Another way is to check the log file created when running ``cone generate``.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   137
It should contain a line like the following::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   138
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   139
    Supported implementation file extensions: ['templateml', 'ruleml', 'thememl', 'imageml', 'crml', 'content', 'contentml', 'convertprojectml', 'hcrml', 'gcfml', 'implml']
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   140
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   141
**Guidelines for implementation file naming**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   142
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   143
- Use the corresponding file extension if the file contains only a
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   144
  single implementation instance (e.g. ``.crml`` for a CRML implementation)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   145
- Otherwise use the generic ``implml`` extension with containers
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   146
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   147
Implementation container nesting
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   148
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   149
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   150
In example 1, implementations were defined under a single root container element. The container
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   151
elements can be nested to form sub containers under the single implementation file. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   152
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   153
For example:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   154
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   155
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   156
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   157
    <?xml version="1.0" encoding="UTF-8"?>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   158
    <container xmlns="http://www.symbianfoundation.org/xml/implml/1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   159
        <container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   160
            <phase name="pre">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   161
            <ruleml xmlns="http://www.s60.com/xml/ruleml/2">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   162
                <rule>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   163
                    CustomSettings.StartupSoundFile.localPath configures 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   164
                    StartupSettings.StartupSoundPath = Startup.StartupSoundPath + "/" + CustomSettings.StartupSoundFile.localPath
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   165
                </rule>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   166
            </ruleml>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   167
        </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   168
     
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   169
        <container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   170
            <phase name="normal">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   171
            <content xmlns="http://www.s60.com/xml/content/3">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   172
                <output file="${StartupSettings.StartupSoundPath}">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   173
                    <input file="${CustomSettings.StartupSoundFile.localPath}"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   174
                </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   175
            </content>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   176
            
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   177
            <!-- Another ContentML section, copies the file to another directory -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   178
            <content xmlns="http://www.s60.com/xml/content/3">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   179
                <output dir="some/dir">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   180
                    <input file="${CustomSettings.StartupSoundFile.localPath}"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   181
                </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   182
            </content>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   183
        </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   184
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   185
    </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   186
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   187
Here the root level container has two sub-containers, where the first sub-container 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   188
is executed in "pre" phase (<phase name="pre"> definition) and the second in "normal" phase.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   189
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   190
.. _common-implml-namespace:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   191
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   192
Common ImplML namespace
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   193
-----------------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   194
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   195
Because there are common elements that are relevant for most, if not all, implementations,
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   196
there is a common ImplML namespace (``http://www.symbianfoundation.org/xml/implml/1``)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   197
that contains these. The common elements can be defined by default in the container elements.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   198
The support for the plugin implementation support for common elements depends on the implementation 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   199
of the plugin. So refer to the plugin specific documentation to what each plugins supports.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   200
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   201
.. _implml-common-elements:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   202
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   203
Elements 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   204
^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   205
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   206
The common ImplML elements are illustrated with the following UML class diagram:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   207
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   208
  .. image:: implml.jpg
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   209
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   210
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   211
====================  ======================  ===============================================================================
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   212
Element               Cardinality             Description
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   213
====================  ======================  ===============================================================================
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   214
container             1 .. *                  Defines a container for sub elements. For details see 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   215
                                              :ref:`implml-common-container` .
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   216
tempVariableSequence  0 .. *                  Defines a temporary sequence variable. For details see 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   217
                                              :ref:`implml-common-temporary-variables`.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   218
tempVariable          0 .. *                  Defines a temporary variable. For details see 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   219
                                              :ref:`implml-common-temporary-variables`.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   220
tag                   0 .. *                  Defines an implementation tag. For details see 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   221
                                              :ref:`implml-common-implementation-tags`.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   222
phase                 0 .. 1                  Defines a execution phase. For details see 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   223
                                              :ref:`implml-common-invocation-phase` .
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   224
====================  ======================  ===============================================================================
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   225
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   226
.. _implml-common-container:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   227
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   228
Container element
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   229
^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   230
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   231
The container element in the common namespace is like its name says a implementation 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   232
that can contain other implementations. So in other words containers can contain 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   233
other containers or actual implementations, like templateml, content, ruleml, etc.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   234
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   235
The key purpose of the containers is to offer a mechanism where one configuration 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   236
implementation solution can be nicely wrapped to a single file. The whole solution might 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   237
require generation of one or more output files, rules, content copying, executing system 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   238
commands, etc. To resolve simple and more complex problems the containers offer a execution 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   239
flow control, with phases, tags and conditions.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   240
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   241
Example with conditional container execution:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   242
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   243
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   244
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   245
    <?xml version="1.0" encoding="UTF-8"?>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   246
    <container xmlns="http://www.symbianfoundation.org/xml/implml/1"
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   247
               condition="${Feature1.Setting1}"
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   248
               value="true">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   249
        <!-- Affects to the root container and to the below implementation sections -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   250
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   251
        <content xmlns="http://www.s60.com/xml/content/2">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   252
            <output dir="content" flatten="true">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   253
                <input file="test/file1.txt"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   254
            </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   255
        </content>        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   256
    </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   257
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   258
In the above example the generation phase will check if the condition is evaluated as true before entering the container.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   259
The condition="${Feature1.Setting1}" refers to a Feature value inside the configuration, and value="true" requires
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   260
that the value of that feature is True. So content copying of test/file1.txt to content/file1.txt is executed only when Setting1 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   261
is set to True. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   262
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   263
.. _implml-common-invocation-phase:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   264
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   265
Invocation phase
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   266
^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   267
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   268
Containers and implementations may define the phase in which they are executed, which can be 'pre',
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   269
'normal' or 'post'. The default phase is determined by the code-level implementation
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   270
(usually the default phase is 'normal'), but this can be overridden for an
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   271
implementation by using the ``phase`` element. The element contains a single mandatory
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   272
attribute, ``name``, which defines the execution phase.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   273
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   274
When using containers in common implml files the ``phase`` of the implementation is always ignored. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   275
This enables overriding of the default ``phase`` of the implementations with the containers. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   276
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   277
Example with two implementation in post phase:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   278
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   279
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   280
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   281
    <?xml version="1.0" encoding="UTF-8"?>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   282
    <container  xmlns="http://www.symbianfoundation.org/xml/implml/1">        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   283
        <!-- Affects to the root container and to the below implementation sections -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   284
        <phase name='post'/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   285
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   286
        <content xmlns="http://www.s60.com/xml/content/2">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   287
            <output dir="content">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   288
                <input>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   289
                    <include files="test/file1.txt"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   290
                </input>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   291
            </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   292
        </content>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   293
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   294
        <ruleml xmlns="http://www.s60.com/xml/ruleml/1" xmlns:implml="http://www.symbianfoundation.org/xml/implml/1">                    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   295
            <rule>X.Y configures X.Z = X.Y</rule>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   296
        </ruleml>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   297
    </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   298
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   299
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   300
Example with two containers in different phases:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   301
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   302
To run implementation in different phases you must define two separate containers
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   303
that have a separate phase in them. In the below example the root level container 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   304
is entered and executed in pre,post phase but the first sub-container only in 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   305
pre phase and the second container in post phase.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   306
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   307
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   308
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   309
    <?xml version="1.0" encoding="UTF-8"?>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   310
    <container xmlns="http://www.symbianfoundation.org/xml/implml/1">        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   311
        <container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   312
            <phase name='pre'/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   313
            <ruleml xmlns="http://www.s60.com/xml/ruleml/1" xmlns:implml="http://www.symbianfoundation.org/xml/implml/1">                    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   314
                <rule>X.Y configures X.Z = X.Y</rule>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   315
            </ruleml>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   316
        </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   317
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   318
        <container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   319
            <phase name='post'/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   320
            
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   321
            <content xmlns="http://www.s60.com/xml/content/2">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   322
                <output dir="content">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   323
                    <input>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   324
                        <include files="test/file1.txt"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   325
                    </input>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   326
                </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   327
            </content>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   328
        </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   329
            
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   330
    </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   331
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   332
.. _implml-common-implementation-tags:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   333
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   334
Implementation tags
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   335
^^^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   336
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   337
A concept common to all implementations are implementation tags. These are simple
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   338
name-value pairs that can be used as one way of filtering the implementations
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   339
when generating. For example the tag ``target : core``, could be used to tag
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   340
the particular implementation and, when generating, the same tag could be used to
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   341
generate only implementations for the target *core*.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   342
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   343
Tags can be defined in implementations that support them or in containers that 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   344
hold implementations. The overall tags of a container is a sum of all tags defined 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   345
in its children (including sub-container and implementations)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   346
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   347
To generate only the implementations for the *core* target the following generation command could be used::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   348
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   349
    cone generate --impl-tag=target:core
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   350
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   351
**Tag elements**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   352
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   353
Tag elements are simple XML elements defining name-value pairs.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   354
There can be multiple tags with the same name, in which case the resulting value
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   355
for that tag will be a list of all the specified values. Examples:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   356
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   357
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   358
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   359
    <tag name="target" value="core">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   360
    <tag name="target" value="rofs2">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   361
    <tag name="target" value="uda">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   362
    <tag name="content" value="music">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   363
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   364
Tags can also get their values from ConfML settings, which can be referenced in the usual way:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   365
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   366
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   367
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   368
    <tag name="${Feature.TagName}" value="somevalue"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   369
    <tag name="target" value="${Feature.TargetValue}"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   370
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   371
When tags are defined to the container it will basically affect on all its sub implementations.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   372
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   373
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   374
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   375
    <?xml version="1.0" encoding="UTF-8"?>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   376
    <container xmlns="http://www.symbianfoundation.org/xml/implml/1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   377
        <tag name='target' value='core'/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   378
        <tag name='target' value='rofs2'/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   379
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   380
        <content xmlns="http://www.s60.com/xml/content/2">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   381
            <output dir="content">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   382
                <input>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   383
                    <include files="test/file1.txt"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   384
                </input>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   385
            </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   386
        </content>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   387
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   388
        <ruleml xmlns="http://www.s60.com/xml/ruleml/1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   389
            <rule>X.Y configures X.Z = X.Y</rule>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   390
        </ruleml>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   391
    </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   392
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   393
In this case both the ContentML and RuleML sections would have the same tags.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   394
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   395
The tag elements can be defined also in some implementation namespaces directly under the root element. E.g. the content in the following
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   396
content file would be copied to the output only for targets *core* and *rofs2*:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   397
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   398
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   399
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   400
    <?xml version="1.0" encoding="UTF-8"?>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   401
    <content xmlns="http://www.s60.com/xml/content/2" xmlns:implml="http://www.symbianfoundation.org/xml/implml/1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   402
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   403
        <tag name='target' value='core'/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   404
        <tag name='target' value='rofs2'/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   405
      
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   406
        <output dir="content">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   407
            <input>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   408
                <include files="test/file1.txt"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   409
            </input>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   410
        </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   411
    </content>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   412
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   413
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   414
Filtering Based on Implementation Tags
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   415
''''''''''''''''''''''''''''''''''''''
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   416
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   417
This chapter explains how to create implementation tag specific implementation files. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   418
`cone_defaults.cfg` defines the default tags for plugins. If nothing is defined 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   419
for a certain plugin type then plugin_tags variable is empty. Basically empty 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   420
tag means that corresponding plugin participates only those generation where 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   421
generation is not filtered by any implementation tag. If generation defines 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   422
implementation tag filter then generation is done only for those plugins that 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   423
match with the filter. If filter is not given filtering is not done and all 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   424
plugins are participating in generation. In case of customization layer this 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   425
would mean that uda content could end up to rofs3 section. Filtering is done 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   426
only for normal and post phases, which means that you don't need to define 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   427
any tag for ruleml files since they are ran in pre phase. Default value 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   428
can be overridden in implementation file of the plugin like the following example 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   429
shows. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   430
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   431
**Example 1:**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   432
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   433
Content plugin default value in cone_defaults.cfg is target:rofs3, which means 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   434
that by default it participates in generations that doesn't define 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   435
implementation tags or defines rofs3. However we want create content files that 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   436
copies stuff to uda. It can be done by overriding tag in .content file by  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   437
adding the following line there:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   438
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   439
::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   440
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   441
    <tag name='target' value='uda'/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   442
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   443
**Example 2:**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   444
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   445
commsdat.content doesn't contain any tag information and cccccc00.cre should 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   446
go to rofs3 image. No actions needed because default value for content is rofs3.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   447
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   448
Current default values for plugins:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   449
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   450
::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   451
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   452
    CRML    = 'core','rofs2','rofs3'
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   453
    GCFML   = 'core','rofs2','rofs3'
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   454
    CONTENT = 'rofs3'
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   455
    MAKEML  = 'makefile'
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   456
    RULEML  = ''
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   457
    IMAGEML = 'rofs3'
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   458
    THEMEML = 'rofs3'
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   459
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   460
Workflow for creating new implementation file:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   461
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   462
  .. image:: tag-fil.jpg
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   463
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   464
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   465
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   466
.. _implml-common-temporary-variables:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   467
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   468
Temporary variables (generation-scope temporary ConfML features)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   469
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   470
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   471
The common ImplML namespace also makes it possible to define temporary variables
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   472
for e.g. passing information between implementations or specifying a constant in only
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   473
one place. Unlike implementation tags, the temporary variables are not
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   474
implementation-specific, but they are visible to all implementations, because they are
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   475
normal ConfML settings. However, overwriting existing features in the
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   476
configuration is prevented by raising an error when defining a feature that already exists.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   477
Therefore the names of used temporary variables should be chosen with care.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   478
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   479
Temporary variables can be defined as follows:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   480
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   481
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   482
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   483
    <container xmlns="http://www.symbianfoundation.org/xml/implml/1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   484
        <tempVariable ref="TempFeature.IntSetting" type="int" value="123"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   485
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   486
        <!-- Default type is 'string' -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   487
        <tempVariable ref="TempFeature.StringSetting" value="test"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   488
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   489
        <!-- Initial value from an existing ConfML setting -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   490
        <tempVariable ref="TempFeature.StringSetting2" type="int" value="${ExistingFeature.Setting}"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   491
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   492
        <!-- TempFeature.IntSetting has already been defined, so this will always raise an error -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   493
        <tempVariable ref="TempFeature.IntSetting" type="int" value="555"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   494
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   495
        <!-- Simple sequences can also be defined. -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   496
        <tempVariableSequence ref="TempFeature.SequenceSetting">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   497
            <tempVariable ref="StringSubSetting" type="string"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   498
            <tempVariable ref="IntSubSetting" type="int"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   499
        </tempVariableSequence>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   500
    </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   501
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   502
Temporary variables only support the simplest ConfML setting types:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   503
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   504
- string
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   505
- int
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   506
- real
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   507
- boolean
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   508
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   509
**Usage example**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   510
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   511
In this example, we have the need to copy files from a number of different
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   512
locations to the output directory based on arbitrary logic. To do this, we create
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   513
a temporary sequence, populate it in a rule, and finally copy the files to
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   514
the output. This way there is no need to define a custom ConfML setting in
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   515
a separate file and include it in the project, so all implementation-specific
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   516
concerns are on the implementation side and do not leak to the interface (ConfML).
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   517
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   518
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   519
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   520
    <?xml version="1.0" encoding="UTF-8"?>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   521
    <container xmlns="http://www.symbianfoundation.org/xml/implml/1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   522
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   523
        <!-- Temporary sequence setting for storing a generation-time created list of files to copy -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   524
        <tempVariableSequence ref="FileCopyTemp.Files">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   525
            <tempVariable ref="Path" type="string"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   526
        </tempVariableSequence>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   527
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   528
        <!-- Rule for populating the temporary sequence -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   529
        <ruleml xmlns="http://www.s60.com/xml/ruleml/2">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   530
            <rule>True configures FileCopyTemp.Files = {% get_file_list() %}</rule>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   531
            
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   532
            <!-- Python script containing the get_file_list() -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   533
            <!-- function used above. It does whatever tricks -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   534
            <!-- are necessary to obtain the list of files to -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   535
            <!-- copy.                                        -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   536
            <eval_globals file="scripts/file_copy.py"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   537
        </ruleml>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   538
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   539
        <!-- ContentML implementation for copying the created file list to output -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   540
        <content xmlns="http://www.s60.com/xml/content/3">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   541
            <output dir="some_dir/">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   542
                <input files="${FileCopyTemp.Files.Path}"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   543
            </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   544
        </content>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   545
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   546
    </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   547
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   548
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   549
.. _implml-common-setting-refs-override:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   550
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   551
Overriding setting references
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   552
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   553
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   554
During generation, implementation instance may be filtered based on the setting references
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   555
they use. Normally the set of references should be correctly determined by the implementation
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   556
instance itself, but if for some reason the references need to be overridden in the
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   557
ImplML file, it is possible by using the common ``settingRefsOverride`` element.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   558
The element can be used in two ways:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   559
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   560
- It may contain a set of ``settingRef`` sub-elements defining the setting
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   561
  references
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   562
- It may contain a ``refsIrrelevant`` attribute that, if set to ``true``,
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   563
  specifies that setting references are irrelevant for the implementation. In
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   564
  this case the implementation will never be filtered out based on setting
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   565
  references during generation.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   566
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   567
**Examples**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   568
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   569
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   570
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   571
    <settingRefsOverride refsIrrelevant="true"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   572
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   573
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   574
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   575
    <settingRefsOverride>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   576
        <settingRef value="SomeFeature.SomeSetting"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   577
        <settingRef value="SomeFeature.SomeOtherSetting"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   578
    </settingRefsOverride>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   579
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   580
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   581
.. _implml-common-setting-output-dir-override:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   582
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   583
Overriding output directory parts
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   584
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   585
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   586
The final output directory for implementation output is consists of three parts:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   587
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   588
- *Output root*, speficied from the command in the ``generate`` action
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   589
- *Output sub-dir*, specified in a setting file (e.g. ``content/`` for CRML in
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   590
  iMaker variant content output settings file)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   591
- *Plug-in output*, specified in a setting file (e.g. ``private/10202BE9`` for CRML)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   592
- *Output file name*, specified in the implementation file in some way, may also
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   593
  contain some intermediary directories before the actual file name
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   594
  (e.g. ``12345678.txt`` for a CRML file with repository UID 0x12345678)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   595
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   596
Of these, the two first may be overridden in the implementation file using
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   597
the common ImplML elements ``outputRootDir`` and ``outputSubDir``. These elements
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   598
may contain a single ``value`` attribute containing the directory name.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   599
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   600
**Examples**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   601
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   602
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   603
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   604
    <outputRootDir value="\epoc32\data"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   605
    <outputSubDir value="widgets"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   606
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   607
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   608
.. code-block:: xml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   609
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   610
    <?xml version="1.0" encoding="UTF-8"?>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   611
    <container xmlns="http://www.symbianfoundation.org/xml/implml/1">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   612
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   613
        <!-- Temporary sequence setting for storing a generation-time created list of files to copy -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   614
        <outputRootDir value="\epoc32\data"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   615
        <outputSubDir value="widgets"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   616
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   617
        <!-- ContentML implementation for copying the created file list to output -->
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   618
        <content xmlns="http://www.s60.com/xml/content/3">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   619
            <output dir="some_dir/">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   620
                <input file="test.wgz"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   621
            </output>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   622
        </content>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   623
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   624
    </container>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   625
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   626
In the above example the content is copied to \epoc32\data\widgets\some_dir\text.wgz.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   627
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   628
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   629
.. rubric:: Footnotes
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   630
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   631
.. [#multi-content-note] In this case the run-time behavior would still be same; ContentML
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   632
   allows multiple ``output`` elements. However, this might not be the case for all
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   633
   implementation languages.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   634
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   635
.. [#legacy-implml-root-name-note] The specifications for the legacy implementation
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   636
   languages CRML and GenConfML do give the root element names, and say that each
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   637
   implementation must be in its own crml/gcfml file.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   638
   It is recommended to stick to this convention for these two implementation languages
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   639
   also in the future. Indeed, using them in a multi-implementation file has not been
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   640
   tested and may not even work correctly.