axlsx 1.0.12 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/README.md +7 -3
  2. data/lib/axlsx.rb +57 -0
  3. data/lib/axlsx/content_type/content_type.rb +23 -0
  4. data/lib/axlsx/content_type/default.rb +37 -0
  5. data/lib/axlsx/content_type/override.rb +37 -0
  6. data/lib/axlsx/doc_props/app.rb +178 -0
  7. data/lib/axlsx/doc_props/core.rb +34 -0
  8. data/lib/axlsx/drawing/axis.rb +90 -0
  9. data/lib/axlsx/drawing/bar_3D_chart.rb +128 -0
  10. data/lib/axlsx/drawing/bar_series.rb +64 -0
  11. data/lib/axlsx/drawing/cat_axis.rb +63 -0
  12. data/lib/axlsx/drawing/cat_axis_data.rb +35 -0
  13. data/lib/axlsx/drawing/chart.rb +179 -0
  14. data/lib/axlsx/drawing/drawing.rb +137 -0
  15. data/lib/axlsx/drawing/graphic_frame.rb +52 -0
  16. data/lib/axlsx/drawing/line_3D_chart.rb +106 -0
  17. data/lib/axlsx/drawing/line_series.rb +46 -0
  18. data/lib/axlsx/drawing/marker.rb +61 -0
  19. data/lib/axlsx/drawing/one_cell_anchor.rb +89 -0
  20. data/lib/axlsx/drawing/pic.rb +153 -0
  21. data/lib/axlsx/drawing/picture_locking.rb +72 -0
  22. data/lib/axlsx/drawing/picture_locking.rb~ +36 -0
  23. data/lib/axlsx/drawing/pie_3D_chart.rb +41 -0
  24. data/lib/axlsx/drawing/pie_series.rb +56 -0
  25. data/lib/axlsx/drawing/scaling.rb +59 -0
  26. data/lib/axlsx/drawing/ser_axis.rb +45 -0
  27. data/lib/axlsx/drawing/series.rb +71 -0
  28. data/lib/axlsx/drawing/series_title.rb +22 -0
  29. data/lib/axlsx/drawing/title.rb +61 -0
  30. data/lib/axlsx/drawing/two_cell_anchor.rb +76 -0
  31. data/lib/axlsx/drawing/val_axis.rb +34 -0
  32. data/lib/axlsx/drawing/val_axis_data.rb +28 -0
  33. data/lib/axlsx/drawing/view_3D.rb +85 -0
  34. data/lib/axlsx/package.rb +215 -0
  35. data/lib/axlsx/rels/relationship.rb +44 -0
  36. data/lib/axlsx/rels/relationships.rb +25 -0
  37. data/lib/axlsx/stylesheet/border.rb +57 -0
  38. data/lib/axlsx/stylesheet/border_pr.rb +68 -0
  39. data/lib/axlsx/stylesheet/cell_alignment.rb +105 -0
  40. data/lib/axlsx/stylesheet/cell_protection.rb +36 -0
  41. data/lib/axlsx/stylesheet/cell_style.rb +65 -0
  42. data/lib/axlsx/stylesheet/color.rb +69 -0
  43. data/lib/axlsx/stylesheet/fill.rb +32 -0
  44. data/lib/axlsx/stylesheet/font.rb +139 -0
  45. data/lib/axlsx/stylesheet/gradient_fill.rb +76 -0
  46. data/lib/axlsx/stylesheet/gradient_stop.rb +33 -0
  47. data/lib/axlsx/stylesheet/num_fmt.rb +63 -0
  48. data/lib/axlsx/stylesheet/pattern_fill.rb +66 -0
  49. data/lib/axlsx/stylesheet/styles.rb +298 -0
  50. data/lib/axlsx/stylesheet/table_style.rb +47 -0
  51. data/lib/axlsx/stylesheet/table_style_element.rb +71 -0
  52. data/lib/axlsx/stylesheet/table_styles.rb +39 -0
  53. data/lib/axlsx/stylesheet/xf.rb +138 -0
  54. data/lib/axlsx/util/constants.rb +220 -0
  55. data/lib/axlsx/util/parser.rb +43 -0
  56. data/lib/axlsx/util/parser.rb~ +6 -0
  57. data/lib/axlsx/util/simple_typed_list.rb +160 -0
  58. data/lib/axlsx/util/validators.rb +132 -0
  59. data/lib/axlsx/version.rb +4 -0
  60. data/lib/axlsx/workbook/#workbook.rb# +165 -0
  61. data/lib/axlsx/workbook/workbook.rb +160 -0
  62. data/lib/axlsx/workbook/worksheet/cell.rb +337 -0
  63. data/lib/axlsx/workbook/worksheet/row.rb +107 -0
  64. data/lib/axlsx/workbook/worksheet/worksheet.rb +279 -0
  65. metadata +93 -141
  66. data/examples/follow_20111202.xlsx +0 -0
  67. data/test/content_type/tc_content_type.rb +0 -81
  68. data/test/content_type/tc_default.rb +0 -40
  69. data/test/content_type/tc_override.rb +0 -40
  70. data/test/doc_props/tc_app.rb +0 -19
  71. data/test/doc_props/tc_core.rb +0 -34
  72. data/test/drawing/tc_axis.rb +0 -40
  73. data/test/drawing/tc_bar_3D_chart.rb +0 -66
  74. data/test/drawing/tc_bar_series.rb +0 -34
  75. data/test/drawing/tc_cat_axis.rb +0 -32
  76. data/test/drawing/tc_cat_axis_data.rb +0 -18
  77. data/test/drawing/tc_chart.rb +0 -73
  78. data/test/drawing/tc_drawing.rb +0 -80
  79. data/test/drawing/tc_graphic_frame.rb +0 -26
  80. data/test/drawing/tc_line_3d_chart.rb +0 -48
  81. data/test/drawing/tc_line_series.rb +0 -27
  82. data/test/drawing/tc_marker.rb +0 -45
  83. data/test/drawing/tc_one_cell_anchor.rb +0 -67
  84. data/test/drawing/tc_pic.rb +0 -71
  85. data/test/drawing/tc_picture_locking.rb +0 -73
  86. data/test/drawing/tc_pie_3D_chart.rb +0 -33
  87. data/test/drawing/tc_pie_series.rb +0 -35
  88. data/test/drawing/tc_scaling.rb +0 -37
  89. data/test/drawing/tc_ser_axis.rb +0 -31
  90. data/test/drawing/tc_series.rb +0 -24
  91. data/test/drawing/tc_series_title.rb +0 -34
  92. data/test/drawing/tc_title.rb +0 -34
  93. data/test/drawing/tc_two_cell_anchor.rb +0 -38
  94. data/test/drawing/tc_val_axis.rb +0 -25
  95. data/test/drawing/tc_val_axis_data.rb +0 -18
  96. data/test/drawing/tc_view_3D.rb +0 -55
  97. data/test/rels/tc_relationship.rb +0 -16
  98. data/test/rels/tc_relationships.rb +0 -27
  99. data/test/stylesheet/tc_border.rb +0 -38
  100. data/test/stylesheet/tc_border_pr.rb +0 -33
  101. data/test/stylesheet/tc_cell_alignment.rb +0 -77
  102. data/test/stylesheet/tc_cell_protection.rb +0 -30
  103. data/test/stylesheet/tc_cell_style.rb +0 -58
  104. data/test/stylesheet/tc_color.rb +0 -38
  105. data/test/stylesheet/tc_fill.rb +0 -19
  106. data/test/stylesheet/tc_font.rb +0 -114
  107. data/test/stylesheet/tc_gradient_fill.rb +0 -65
  108. data/test/stylesheet/tc_gradient_stop.rb +0 -32
  109. data/test/stylesheet/tc_num_fmt.rb +0 -31
  110. data/test/stylesheet/tc_pattern_fill.rb +0 -38
  111. data/test/stylesheet/tc_styles.rb +0 -52
  112. data/test/stylesheet/tc_table_style.rb +0 -37
  113. data/test/stylesheet/tc_table_style_element.rb +0 -37
  114. data/test/stylesheet/tc_table_styles.rb +0 -30
  115. data/test/stylesheet/tc_xf.rb +0 -121
  116. data/test/tc_package.rb +0 -68
  117. data/test/util/tc_simple_typed_list.rb +0 -66
  118. data/test/util/tc_validators.rb +0 -76
  119. data/test/workbook/tc_workbook.rb +0 -60
  120. data/test/workbook/worksheet/tc_cell.rb +0 -179
  121. data/test/workbook/worksheet/tc_row.rb +0 -36
  122. data/test/workbook/worksheet/tc_worksheet.rb +0 -138
@@ -0,0 +1,47 @@
1
+ module Axlsx
2
+ # A single table style definition and is a collection for tableStyleElements
3
+ # @note Table are not supported in this version and only the defaults required for a valid workbook are created.
4
+ class TableStyle < SimpleTypedList
5
+
6
+ # The name of this table style
7
+ # @return [string]
8
+ attr_reader :name
9
+
10
+ # indicates if this style should be applied to pivot tables
11
+ # @return [Boolean]
12
+ attr_reader :pivot
13
+
14
+ # indicates if this style should be applied to tables
15
+ # @return [Boolean]
16
+ attr_reader :table
17
+
18
+ # creates a new TableStyle object
19
+ # @raise [ArgumentError] if name option is not provided.
20
+ # @param [String] name
21
+ # @option options [Boolean] pivot
22
+ # @option options [Boolean] table
23
+ def initialize(name, options={})
24
+ self.name = name
25
+ options.each do |o|
26
+ self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
27
+ end
28
+ super TableStyleElement
29
+ end
30
+
31
+ # @see name
32
+ def name=(v) Axlsx::validate_string v; @name=v end
33
+ # @see pivot
34
+ def pivot=(v) Axlsx::validate_boolean v; @pivot=v end
35
+ # @see table
36
+ def table=(v) Axlsx::validate_boolean v; @table=v end
37
+
38
+ # Serializes the table style
39
+ # @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to.
40
+ # @return [String]
41
+ def to_xml(xml)
42
+ attr = self.instance_values.select { |k, v| [:name, :pivot, :table].include? k }
43
+ attr[:count] = self.size
44
+ xml.tableStyle(attr) { self.each { |table_style_el| table_style_el.to_xml(xml) } }
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,71 @@
1
+ module Axlsx
2
+ # an element of style that belongs to a table style.
3
+ # @note tables and table styles are not supported in this version. This class exists in preparation for that support.
4
+ class TableStyleElement
5
+ # The type of style element. The following type are allowed
6
+ # :wholeTable
7
+ # :headerRow
8
+ # :totalRow
9
+ # :firstColumn
10
+ # :lastColumn
11
+ # :firstRowStripe
12
+ # :secondRowStripe
13
+ # :firstColumnStripe
14
+ # :secondColumnStripe
15
+ # :firstHeaderCell
16
+ # :lastHeaderCell
17
+ # :firstTotalCell
18
+ # :lastTotalCell
19
+ # :firstSubtotalColumn
20
+ # :secondSubtotalColumn
21
+ # :thirdSubtotalColumn
22
+ # :firstSubtotalRow
23
+ # :secondSubtotalRow
24
+ # :thirdSubtotalRow
25
+ # :blankRow
26
+ # :firstColumnSubheading
27
+ # :secondColumnSubheading
28
+ # :thirdColumnSubheading
29
+ # :firstRowSubheading
30
+ # :secondRowSubheading
31
+ # :thirdRowSubheading
32
+ # :pageFieldLabels
33
+ # :pageFieldValues
34
+ # @return [Symbol]
35
+ attr_reader :type
36
+
37
+ # Number of rows or columns used in striping when the type is firstRowStripe, secondRowStripe, firstColumnStripe, or secondColumnStripe.
38
+ # @return [Integer]
39
+ attr_reader :size
40
+
41
+ # The dxfId this style element points to
42
+ # @return [Integer]
43
+ attr_reader :dxfId
44
+
45
+ # creates a new TableStyleElement object
46
+ # @option options [Symbol] type
47
+ # @option options [Integer] size
48
+ # @option options [Integer] dxfId
49
+ def initialize(options={})
50
+ options.each do |o|
51
+ self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
52
+ end
53
+ end
54
+
55
+ # @see type
56
+ def type=(v) Axlsx::validate_table_element_type v; @type = v end
57
+
58
+ # @see size
59
+ def size=(v) Axlsx::validate_unsigned_int v; @size = v end
60
+
61
+ # @see dxfId
62
+ def dxfId=(v) Axlsx::validate_unsigned_int v; @dxfId = v end
63
+
64
+ # Serializes the table style element
65
+ # @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to.
66
+ # @return [String]
67
+ def to_xml(xml)
68
+ xml.tableStyleElement self.instance_values
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,39 @@
1
+ module Axlsx
2
+ # TableStyles represents a collection of style definitions for table styles and pivot table styles.
3
+ # @note Support for custom table styles does not exist in this version. Many of the classes required are defined in preparation for future release. Please do not attempt to add custom table styles.
4
+ class TableStyles < SimpleTypedList
5
+
6
+ # The default table style. The default value is 'TableStyleMedium9'
7
+ # @return [String]
8
+ attr_reader :defaultTableStyle
9
+
10
+ # The default pivot table style. The default value is 'PivotStyleLight6'
11
+ # @return [String]
12
+ attr_reader :defaultPivotStyle
13
+
14
+ # Creates a new TableStyles object that is a container for TableStyle objects
15
+ # @option options [String] defaultTableStyle
16
+ # @option options [String] defaultPivotStyle
17
+ def initialize(options={})
18
+ @defaultTableStyle = options[:defaultTableStyle] || "TableStyleMedium9"
19
+ @defaultPivotStyle = options[:defaultPivotStyle] || "PivotStyleLight16"
20
+ super TableStyle
21
+ end
22
+ # @see defaultTableStyle
23
+ def defaultTableStyle=(v) Axlsx::validate_string(v); @defaultTableStyle = v; end
24
+ # @see defaultPivotStyle
25
+ def defaultPivotStyle=(v) Axlsx::validate_string(v); @defaultPivotStyle = v; end
26
+
27
+ # Serializes the table styles element
28
+ # @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to.
29
+ # @return [String]
30
+ def to_xml(xml)
31
+ attr = self.instance_values.reject {|k, v| ![:defaultTableStyle, :defaultPivotStyle].include?(k.to_sym) }
32
+ attr[:count] = self.size
33
+ xml.tableStyles(attr) {
34
+ self.each { |table_style| table_style.to_xml(xml) }
35
+ }
36
+ end
37
+ end
38
+
39
+ end
@@ -0,0 +1,138 @@
1
+ module Axlsx
2
+ # The Xf class defines a formatting record for use in Styles. The recommended way to manage styles for your workbook is with Styles#add_style
3
+ # @see Styles#add_style
4
+ class Xf
5
+ #does not support extList (ExtensionList)
6
+
7
+ # The cell alignment for this style
8
+ # @return [CellAlignment]
9
+ # @see CellAlignment
10
+ attr_reader :alignment
11
+
12
+ # The cell protection for this style
13
+ # @return [CellProtection]
14
+ # @see CellProtection
15
+ attr_reader :protection
16
+
17
+ # id of the numFmt to apply to this style
18
+ # @return [Integer]
19
+ attr_reader :numFmtId
20
+
21
+ # index (0 based) of the font to be used in this style
22
+ # @return [Integer]
23
+ attr_reader :fontId
24
+
25
+ # index (0 based) of the fill to be used in this style
26
+ # @return [Integer]
27
+ attr_reader :fillId
28
+
29
+ # index (0 based) of the border to be used in this style
30
+ # @return [Integer]
31
+ attr_reader :borderId
32
+
33
+ # index (0 based) of cellStylesXfs item to be used in this style. Only applies to cellXfs items
34
+ # @return [Integer]
35
+ attr_reader :xfId
36
+
37
+ # indecates if text should be prefixed by a single quote in the cell
38
+ # @return [Boolean]
39
+ attr_reader :quotePrefix
40
+
41
+ # indicates if the cell has a pivot table drop down button
42
+ # @return [Boolean]
43
+ attr_reader :pivotButton
44
+
45
+ # indicates if the numFmtId should be applied
46
+ # @return [Boolean]
47
+ attr_reader :applyNumberFormat
48
+
49
+ # indicates if the fontId should be applied
50
+ # @return [Boolean]
51
+ attr_reader :applyFont
52
+
53
+ # indicates if the fillId should be applied
54
+ # @return [Boolean]
55
+ attr_reader :applyFill
56
+
57
+ # indicates if the borderId should be applied
58
+ # @return [Boolean]
59
+ attr_reader :applyBorder
60
+
61
+ # Indicates if the alignment options should be applied
62
+ # @return [Boolean]
63
+ attr_reader :applyAlignment
64
+
65
+ # Indicates if the protection options should be applied
66
+ # @return [Boolean]
67
+ attr_reader :applyProtection
68
+
69
+ # Creates a new Xf object
70
+ # @option options [Integer] numFmtId
71
+ # @option options [Integer] fontId
72
+ # @option options [Integer] fillId
73
+ # @option options [Integer] borderId
74
+ # @option options [Integer] xfId
75
+ # @option options [Boolean] quotePrefix
76
+ # @option options [Boolean] pivotButton
77
+ # @option options [Boolean] applyNumberFormat
78
+ # @option options [Boolean] applyFont
79
+ # @option options [Boolean] applyFill
80
+ # @option options [Boolean] applyBorder
81
+ # @option options [Boolean] applyAlignment
82
+ # @option options [Boolean] applyProtection
83
+ # @option options [CellAlignment] alignment
84
+ # @option options [CellProtection] protection
85
+ def initialize(options={})
86
+ options.each do |o|
87
+ self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
88
+ end
89
+ end
90
+
91
+ # @see Xf#alignment
92
+ def alignment=(v) DataTypeValidator.validate "Xf.alignment", CellAlignment, v; @alignment = v end
93
+
94
+ # @see protection
95
+ def protection=(v) DataTypeValidator.validate "Xf.protection", CellProtection, v; @protection = v end
96
+
97
+ # @see numFmtId
98
+ def numFmtId=(v) Axlsx::validate_unsigned_int v; @numFmtId = v end
99
+
100
+ # @see fontId
101
+ def fontId=(v) Axlsx::validate_unsigned_int v; @fontId = v end
102
+ # @see fillId
103
+ def fillId=(v) Axlsx::validate_unsigned_int v; @fillId = v end
104
+ # @see borderId
105
+ def borderId=(v) Axlsx::validate_unsigned_int v; @borderId = v end
106
+ # @see xfId
107
+ def xfId=(v) Axlsx::validate_unsigned_int v; @xfId = v end
108
+ # @see quotePrefix
109
+ def quotePrefix=(v) Axlsx::validate_boolean v; @quotePrefix = v end
110
+ # @see pivotButton
111
+ def pivotButton=(v) Axlsx::validate_boolean v; @pivotButton = v end
112
+ # @see applyNumberFormat
113
+ def applyNumberFormat=(v) Axlsx::validate_boolean v; @applyNumberFormat = v end
114
+ # @see applyFont
115
+ def applyFont=(v) Axlsx::validate_boolean v; @applyFont = v end
116
+ # @see applyFill
117
+ def applyFill=(v) Axlsx::validate_boolean v; @applyFill = v end
118
+
119
+ # @see applyBorder
120
+ def applyBorder=(v) Axlsx::validate_boolean v; @applyBorder = v end
121
+
122
+ # @see applyAlignment
123
+ def applyAlignment=(v) Axlsx::validate_boolean v; @applyAlignment = v end
124
+
125
+ # @see applyProtection
126
+ def applyProtection=(v) Axlsx::validate_boolean v; @applyProtection = v end
127
+
128
+ # Serializes the xf elemen
129
+ # @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to.
130
+ # @return [String]
131
+ def to_xml(xml)
132
+ xml.xf(self.instance_values.reject { |k, v| [:alignment, :protection, :extList, :name].include? k.to_sym}) {
133
+ alignment.to_xml(xml) if self.alignment
134
+ protection.to_xml(xml) if self.protection
135
+ }
136
+ end
137
+ end
138
+ end
@@ -0,0 +1,220 @@
1
+ module Axlsx
2
+
3
+ # XML Encoding
4
+ ENCODING = "UTF-8"
5
+
6
+ # spreadsheetML namespace
7
+ XML_NS = "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
8
+
9
+ # content-types namespace
10
+ XML_NS_T = "http://schemas.openxmlformats.org/package/2006/content-types"
11
+
12
+ # extended-properties namespace
13
+ APP_NS = "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
14
+
15
+ XML_NS_MC="http://schemas.openxmlformats.org/markup-compatibility/2006"
16
+
17
+ XML_NS_X14AC = "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
18
+
19
+ # doc props namespace
20
+ APP_NS_VT = "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
21
+
22
+ # core properties namespace
23
+ CORE_NS = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
24
+
25
+ # dc elements (core) namespace
26
+ CORE_NS_DC = "http://purl.org/dc/elements/1.1/"
27
+
28
+ # dcmit (core) namespcace
29
+ CORE_NS_DCMIT = "http://purl.org/dc/dcmitype/"
30
+
31
+ # dc terms namespace
32
+ CORE_NS_DCT = "http://purl.org/dc/terms/"
33
+
34
+ # xml schema namespace
35
+ CORE_NS_XSI = "http://www.w3.org/2001/XMLSchema-instance"
36
+
37
+ # spreadsheet drawing namespace
38
+ XML_NS_XDR = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
39
+
40
+ # drawing namespace
41
+ XML_NS_A = "http://schemas.openxmlformats.org/drawingml/2006/main"
42
+
43
+ # chart namespace
44
+ XML_NS_C = "http://schemas.openxmlformats.org/drawingml/2006/chart"
45
+
46
+ # relationships namespace
47
+ XML_NS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
48
+
49
+
50
+ # relationships name space
51
+ RELS_R = "http://schemas.openxmlformats.org/package/2006/relationships"
52
+
53
+ # table rels namespace
54
+ TABLE_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"
55
+
56
+ # workbook rels namespace
57
+ WORKBOOK_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
58
+
59
+ # worksheet rels namespace
60
+ WORKSHEET_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
61
+
62
+ # app rels namespace
63
+ APP_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"
64
+
65
+ # core rels namespace
66
+ CORE_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/metadata/core-properties"
67
+
68
+ # styles rels namespace
69
+ STYLES_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
70
+
71
+ # drawing rels namespace
72
+ DRAWING_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing"
73
+
74
+ # chart rels namespace
75
+ CHART_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"
76
+
77
+ # image rels namespace
78
+ IMAGE_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
79
+
80
+ # table content type
81
+ TABLE_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"
82
+
83
+ # workbook content type
84
+ WORKBOOK_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"
85
+
86
+ # app content type
87
+ APP_CT = "application/vnd.openxmlformats-officedocument.extended-properties+xml"
88
+
89
+ # rels content type
90
+ RELS_CT = "application/vnd.openxmlformats-package.relationships+xml"
91
+
92
+ # styles content type
93
+ STYLES_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"
94
+
95
+ # xml content type
96
+ XML_CT = "application/xml"
97
+
98
+ # worksheet content type
99
+ WORKSHEET_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"
100
+
101
+ # shared strings content type
102
+ SHARED_STRINGS_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"
103
+
104
+ # core content type
105
+ CORE_CT = "application/vnd.openxmlformats-package.core-properties+xml"
106
+
107
+ # chart content type
108
+ CHART_CT = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml"
109
+
110
+ # jpeg content type
111
+ JPEG_CT = "image/jpeg"
112
+
113
+ # gif content type
114
+ GIF_CT = "image/gif"
115
+
116
+ # png content type
117
+ PNG_CT = "image/png"
118
+
119
+ #drawing content type
120
+ DRAWING_CT = "application/vnd.openxmlformats-officedocument.drawing+xml"
121
+
122
+ # xml content type extensions
123
+ XML_EX = "xml"
124
+
125
+ # jpeg extension
126
+ JPEG_EX = "jpeg"
127
+
128
+ # gif extension
129
+ GIF_EX = "gif"
130
+
131
+ # png extension
132
+ PNG_EX = "png"
133
+
134
+ # rels content type extension
135
+ RELS_EX = "rels"
136
+
137
+ # workbook part
138
+ WORKBOOK_PN = "xl/workbook.xml"
139
+
140
+ # styles part
141
+ STYLES_PN = "styles.xml"
142
+
143
+ # app part
144
+ APP_PN = "docProps/app.xml"
145
+
146
+ # core part
147
+ CORE_PN = "docProps/core.xml"
148
+
149
+ # content types part
150
+ CONTENT_TYPES_PN = "[Content_Types].xml"
151
+
152
+ # rels part
153
+ RELS_PN = "_rels/.rels"
154
+
155
+ # workbook rels part
156
+ WORKBOOK_RELS_PN = "xl/_rels/workbook.xml.rels"
157
+
158
+ # worksheet part
159
+ WORKSHEET_PN = "worksheets/sheet%d.xml"
160
+
161
+ # worksheet rels part
162
+ WORKSHEET_RELS_PN = "worksheets/_rels/sheet%d.xml.rels"
163
+
164
+ # drawing part
165
+ DRAWING_PN = "drawings/drawing%d.xml"
166
+
167
+ # drawing rels part
168
+ DRAWING_RELS_PN = "drawings/_rels/drawing%d.xml.rels"
169
+
170
+ # chart part
171
+ CHART_PN = "charts/chart%d.xml"
172
+
173
+ # chart part
174
+ IMAGE_PN = "media/image%d.%s"
175
+
176
+ # App validation schema
177
+ APP_XSD = "lib/schema/shared-documentPropertiesExtended.xsd"
178
+
179
+ # core validation schema
180
+ CORE_XSD = "lib/schema/opc-coreProperties.xsd"
181
+
182
+ # content types validation schema
183
+ CONTENT_TYPES_XSD = "lib/schema/opc-contentTypes.xsd"
184
+
185
+ # rels validation schema
186
+ RELS_XSD = "lib/schema/opc-relationships.xsd"
187
+
188
+ # spreadsheetML validation schema
189
+ SML_XSD = "lib/schema/sml.xsd"
190
+
191
+ # drawing validation schema
192
+ DRAWING_XSD = "lib/schema/dml-spreadsheetDrawing.xsd"
193
+
194
+ # number format id for pecentage formatting using the default formatting id.
195
+ NUM_FMT_PERCENT = 9
196
+
197
+ # number format id for date format like 2011/11/13
198
+ NUM_FMT_YYYYMMDD = 100
199
+
200
+ # number format id for time format the creates 2011/11/13 12:23:10
201
+ NUM_FMT_YYYYMMDDHHMMSS = 101
202
+
203
+ # cellXfs id for thin borders around the cell
204
+ STYLE_THIN_BORDER = 1
205
+
206
+ # cellXfs id for default date styling
207
+ STYLE_DATE = 2
208
+
209
+ # error messages RestrictionValidor
210
+ ERR_RESTRICTION = "Invalid Data: %s. %s must be one of %s."
211
+
212
+ # error message DataTypeValidator
213
+ ERR_TYPE = "Invalid Data %s for %s. must be %s."
214
+
215
+ # error message for RegexValidator
216
+ ERR_REGEX = "Invalid Data. %s does not match %s."
217
+
218
+ # error message for duplicate sheet names
219
+ ERR_DUPLICATE_SHEET_NAME = "There is already a worksheet in this workbook named '%s'. Please use a unique name"
220
+ end