update credits
[LibreOffice.git] / writerfilter / source / ooxml / README.efforts
blob4448912f5911a3f9691adc5ba238f7e8a1afa71b
2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 #   Licensed to the Apache Software Foundation (ASF) under one or more
11 #   contributor license agreements. See the NOTICE file distributed
12 #   with this work for additional information regarding copyright
13 #   ownership. The ASF licenses this file to you under the Apache
14 #   License, Version 2.0 (the "License"); you may not use this file
15 #   except in compliance with the License. You may obtain a copy of
16 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 This file describes how the remaining efforts for writerfilter can be
20 extracted from the source code.
22 1. Marking up the efforts in the code.
24 Efforts are marked up in the code with comments like this:
26 /* WRITERFILTERSTATUS: done: <percent done>, planned: <effort planned>, spent: <effort spent, yet> */
28 The comments have to follow a case-label immediately. Consecutive
29 case-labels can be marked up, too. In the latter case the efforts are
30 counted for the preceeding case-labels as a whole.
32 2. Extraction process
34 2.1. Stage 1:
36 This stage is handled in status.sh. An XML-file is generated that
37 contains a top level element <stage1>. <stage1> contains an element
38 <analyze> and several <qname> and <status> elements.
40 2.1.1.  Use analyzemodel.xsl to extract necessary data from model.xml.
42 - Namespaces can be flagged with attribute @todo="ignore" to prevent
43   the namespace being considered.
45 - For every <element>/<attribute> an entry in an according element in <analyze> is genereated. These elements look like this:
47 <attribute id="..." resource="..." tokenid="..." qname="..." namespace="..." define="..." name="..."/>
49 Important for the extraction of efforts: @qname is the identifier used
50 in case-labels in .cxx files and thus links the status mark up
51 comments with elements/attributes in the model.xml.
53 2.1.2. Extract status information
55 The variable SEARCHIN in status.sh determines in what directory the script will search for case labels and status comments. Only .cxx files are searched. Lines like this
57 case NS_rtf::LN_UNUSED4:
59 result in elements like this
61 <qname file="/DomainMapper.cxx" line="216" qname="NS_rtf::LN_UNUSED4"/>.
63 Lines like this
65 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
67 result in elements like this
69 <status done="0" planned="0" spent="0"/>
71 The <qname> and <status> elements are children of the <stage1>
72 element. The are inserted in the same order as found in the
73 code. Therefore a <status> element corresponds to the group of
74 consecutive preceding <qname> elements.
76 2.2. Stage 2
78 In this stage analyzestage2.xsl is used on the result of stage 1 to
79 group the <qname> and <status> elements from stage 1. For each
80 <status> element a <qnames> element is generated that contains the
81 <qname> elements that the <status> element refers to, plus the
82 <status> element.
84 2.3. Stage 3
86 This stage associates the <attribute> and <element> elements in
87 model.xml with the extracted data. It uses analyzestage3.xsl on the
88 result of stage 2 to do this.
90 E.g. for given elements from stage 2:
92 <attribute 
93            id="dml-wordprocessingDrawing:CT_Inline:distR" 
94            resource="Properties"  
95            tokenid="ooxml:CT_Inline_distR" 
96            qname="NS_ooxml::LN_CT_Inline_distR" 
97            namespace="dml-wordprocessingDrawing" 
98            define="CT_Inline" 
99            name="distR"/>
101 and 
103    <qnames>
104     <qname file="/GraphicImport.cxx" line="1078" qname="NS_ooxml::LN_CT_Inline_distT"/>
105     <qname file="/GraphicImport.cxx" line="1079" qname="NS_ooxml::LN_CT_Inline_distB"/>
106     <qname file="/GraphicImport.cxx" line="1080" qname="NS_ooxml::LN_CT_Inline_distL"/>
107     <qname file="/GraphicImport.cxx" line="1081" qname="NS_ooxml::LN_CT_Inline_distR"/>
108     <status done="0" planned="0.5" spent="0"/>
109   </qnames>
111 the result of stage 3 will be
113   <attribute 
114              id="dml-wordprocessingDrawing:CT_Inline:distR" 
115              resource="Properties" 
116              tokenid="ooxml:CT_Inline_distR" 
117              qname="NS_ooxml::LN_CT_Inline_distR" 
118              namespace="dml-wordprocessingDrawing" 
119              define="CT_Inline" name="distR">
121              <file name="/GraphicImport.cxx" line="1081">
122                    <status done="0" planned="0.5" spent="0" qname-count="4"/>
123              </file>
125   </attribute>
127 @qname-count is the number of case-labels that the according mark-up comment refers to.
129 3. Collect efforts
131 This is done by the script efforts.sh. It uses status.sh to extract the status and determines the efforts in two steps.
133 3.1. Choose which <attribute>/<element> elements need effort
135 This stage uses todo.xsl on the result of 2.3.
137 There are two criteria that imply effort:
139 - The <attribute>/<element> is not handled in any file.
141 - The status for the <attribute>/<element> declares that work is
142   planned for it and less than 100 percent of this work is done.
144 3.2. Generate table of efforts in CSV format
146 This stage uses effort.xsl on the results of 3.1. and produces the
147 table of efforts. If there is no status defined for an
148 <attribute>/<element> it is assumed that the planned effort is 0.5
149 hours and no work has been done.