configurationengine/doc/plugins/contentml-plugin/content.rst
author terytkon
Thu, 11 Mar 2010 17:04:37 +0200
changeset 0 2e8eeb919028
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
How to use the ConE Content plugin
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
Introduction
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     5
'''''''''''''
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     6
The basic concept of Content plugin is to transfer file resources from
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     7
one place to another. So one may have for example; an audio file stored in the
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     8
configuration project and needs to define the audio file location in the
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     9
device. With ConE Content plugin you can basically define a copy operation. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    10
You just create <somename>.content (or general *.implml file) type file to the configuration project implml folder 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    11
and set the rules or filters in there.    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    12
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    13
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    14
content elements
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    15
----------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    16
The content model is drawn out as a uml model in below picture.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    17
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    18
  .. image:: content2.jpg
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    19
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    20
content
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    21
^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    22
The root element of the content file is always content, which defines the xml namespace (xmlns) 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    23
to http://www.s60.com/xml/content/2 in the current version. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    24
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    25
**content example**::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    26
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    27
  <content xmlns="http://www.s60.com/xml/content/2"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    28
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    29
tag
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    30
^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    31
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    32
Implementation tag elements can be defined under the root element. See the page on `tags <tags.html>`_ for more info.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    33
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    34
output
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    35
^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    36
The output element can define a output folder where content is copied from :ref:`content-input` elements that 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    37
are children of this particular output. There can be several output elements inside a single content 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    38
file or block.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    39
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    40
**output example**::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    41
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    42
  <output dir="foobar"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    43
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    44
The above statement defines that content is copied under foobar folder in the cone output folder.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    45
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    46
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    47
.. _content-input:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    48
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    49
input
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    50
^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    51
The user can define input under the output element. The input element can define a source directory and two file filters for 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    52
that directory (include and exclude filters). The input element will always search files under the content directories of the 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    53
configuration project. But the content of the search directory is a layered content of all configuration project content directories 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    54
(See content layering in Configuration project specification (TODO: add link here)).
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    55
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    56
**input example**::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    57
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    58
  <input dir="foobar"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    59
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    60
the above statement would include all files found under foobar directory.::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    61
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    62
  <input file="foobar/file1.txt"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    63
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    64
the above statement would include file1.txt from folder foobar to the copy operation.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    65
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    66
include
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    67
^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    68
The include filter can be used inside input statement to filter files for the copy operation.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    69
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    70
The include filter can have following attributes.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    71
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    72
+------------------+-------------------------------------------+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    73
| Attribute name   | description                               |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    74
+==================+===========================================+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    75
| files            | comma separated list of inpu files.       |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    76
+------------------+-------------------------------------------+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    77
| pattern          | regexp pattern to filter input files that |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    78
|                  | are found in the input folder.            |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    79
+------------------+-------------------------------------------+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    80
| flatten          | "true"|"false" to define if the directory |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    81
|                  | struture is flattened at output.          |
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
**input include example**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    85
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    86
This would copy files foobar/test/override.txt and foobar/test/s60.txt to output if they are found.::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    87
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    88
  <input dir="foobar">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    89
    <include files="test/override.txt, test/s60.txt"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    90
  <input>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    91
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    92
The below statement would copy all files ending with ".jpg" from userdata and copy them 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    93
directly to the output root folder.::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    94
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    95
  <input dir="userdata">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    96
    <include pattern="\.jpg$" flatten="true"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    97
  <input>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    98
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    99
exclude
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   100
^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   101
The exclude filter can be used similarly as the include filter, but in a negative meaning. 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   102
For example to ensure that files beginning with a dot are never copied.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   103
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   104
The exclude filter can have following attributes.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   105
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   106
+------------------+-------------------------------------------+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   107
| Attribute name   | description                               |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   108
+==================+===========================================+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   109
| pattern          | regexp pattern to filter input files that |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   110
|                  | are found in the input folder.            |
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   111
+------------------+-------------------------------------------+
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   112
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   113
**input exclude example**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   114
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   115
This would exclude all files that have .svn as part of the file path::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   116
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   117
  <input dir="foobar">
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   118
    <exclude pattern="\.svn"/>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   119
  <input>
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   120
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   121
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   122
How to create a content file
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   123
----------------------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   124
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   125
* Create a new file in the content folder name for ex. mycontentfile.content
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   126
* Set the file encoding to UTF-8
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   127
* Set the definition tag first *<?xml version="1.0" encoding="UTF-8"?>*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   128
* Set the content tag *<content xmlns="http://www.s60.com/xml/content/1">*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   129
* Set the description tag *<desc>Copy only prod</desc>*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   130
* Set a content configuration tag for ex. *<include pattern="prod"/>*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   131
* Set another content configuration tag for ex. *<output dir="content"/>*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   132
* Close the content tag *</content>*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   133
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   134
Now you have content file which copies the prod files to the content directory in the device configuration 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   135
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   136
**example of a entire content file**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   137
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   138
The example defines here two copy operations to two different outputs. First one to content with selected 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   139
files as input and the other to include, where it tries to copy all \*.hrh files to the root of the include 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   140
directory.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   141
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   142
.. literalinclude:: example.content
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   143
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   144
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   145
Logic and rules
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   146
---------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   147
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   148
What may you define with content file logic. Here are some explanations.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   149
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   150
* *<include pattern="prod"/>* include the files in the prod folder
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   151
* *<exclude pattern="prod"/>* exclude the files in the prod folder
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   152
* *<input dir="${content.inputdir}"/>* input files are setted in the value of the content/inputdir reference link in confml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   153
* *<output dir="${content.outputdir}"/>* output files are setted in the value of the content/outputdir reference link in confml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   154
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   155
So you may include and exclude folder and files. Content file definition supports regex patterns
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   156
You may give the location of the content as a confml reference link, *note: use the dots instead of slashes*  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   157
 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   158
 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   159
XSD
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   160
---
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   161
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   162
.. literalinclude:: ../../xsd/contentml2.xsd
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   163
   :linenos:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   164
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   165
 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   166
FAQ
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   167
---
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   168
This will be updated based on the questions.