Difference between revisions of "Documentation/DevGuide/OfficeDev/Properties of a Type"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial author Sun Microsystems, Inc.)
 
m
 
(16 intermediate revisions by 5 users not shown)
Line 4: Line 4:
 
|OfficeDevDocFilter=block
 
|OfficeDevDocFilter=block
 
|ShowPrevNext=block
 
|ShowPrevNext=block
|PrevPage=Documentation/DevGuide/OfficeDev/Necessary Steps
+
|PrevPage=Documentation/DevGuide/OfficeDev/Configuring a Filter in OpenOffice.org
|NextPage=Documentation/DevGuide/OfficeDev/Properties of an ExtendedTypeDetection Service
+
|NextPage=Documentation/DevGuide/OfficeDev/Properties of a Filter
 
}}
 
}}
{{DISPLAYTITLE:Properties of a Type}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/OfficeDev/{{SUBPAGENAME}}}}
Every type inside {{PRODUCTNAME}} is specified by the properties shown in the table below. These values are accessible at the previously mentioned service <idl>com.sun.star.document.TypeDetection</idl> using the interface <idl>com.sun.star.container.XNameAccess</idl>. Write access is not available here. All types are addressed by their internal names.
+
{{DISPLAYTITLE:Properties of a Type}}
 +
Every type inside {{AOo}} is specified by the properties shown in the table below. These values are accessible at the previously mentioned service <idl>com.sun.star.document.TypeDetection</idl> using the interface <idl>com.sun.star.container.XNameAccess</idl>. Write access is not available here. All types are addressed by their internal names. The property names are identical to the configuration property names.
 +
 
 +
{{Warn|The documentation of the TypeDetection service currently is outdated. In case of conflicting information about the properties this page is right. An update will follow soon. }}
  
 
{|border="1" cellpadding=4 style="border-collapse:collapse;"
 
{|border="1" cellpadding=4 style="border-collapse:collapse;"
Line 15: Line 18:
 
|-
 
|-
 
|<code>Name</code>  
 
|<code>Name</code>  
|string. The internal name of a type must be unique and is also used as a list entry. It contains any special characters, but they must been coded.  
+
|string. The internal name of the type. This is only an API property, not a configuration property. In the configuration this is the name of the configuration node containing all the other properties. To avoid name clashes with other node names it should follow the rules outlined for [[Documentation/DevGuide/Extensions/Extension_Identifiers | extension identifiers]].
 
|-
 
|-
 
|<code>UIName</code>  
 
|<code>UIName</code>  
|string. Displays the type at the user interface under a localized name. You must assign a value for a language, thus supporting CJK versions. All Unicode characters are permitted here.  
+
|string. User friendly name of the type. It may be localized using the localization support of the configuration. All Unicode characters are permitted here. Currently, this UI name is not used in {{AOo}} itself, but it is available for e.g. extensions.
 
|-
 
|-
 
|<code>MediaType</code>  
 
|<code>MediaType</code>  
|string. Describes the MIME type of the contents. The reason is that the internal names can be altered at any time without affecting the process.  
+
|string. Describes the MIME type of the Type.  
 
|-
 
|-
 
|<code>ClipboardFormat</code>  
 
|<code>ClipboardFormat</code>  
|string. The format is a unique description of this type for use in clipboards.  
+
|string. The property name is misleading and has historical reasons. This property contains a format name that is used somewhere in the content itself to enable filters loading it to verify that the content has the right type. It may be the "doctype" in a XML file, the storage format identifier in an OLE storage or the MIMEType of and ODF document. This name can be used by a generic ExtendedTypeDetection service that is used for more than one format.
 
|-
 
|-
 
|<code>URLPattern</code>  
 
|<code>URLPattern</code>  
|sequence<string>. Important components of a type are the patterns. They enable the support of your own URL schemata, for example, in {{PRODUCTNAME}} "private:factory/swriter" for opening an empty text document. The wildcards '*' or '?' are supported here.  
+
|sequence<string>. Enables the support of own URL schemata, that always shall be handled by the same filter(s). For example, in {{AOo}} "private:factory/swriter" for opening an empty text document. The wildcards '*' or '?' are supported here.  
 
|-
 
|-
 
|<code>Extensions</code>  
 
|<code>Extensions</code>  
|sequence<string>. The type of a content can be derived from its URL by its extension. In most cases, the flat detection depends on them alone.  
+
|sequence<string>. All extensions that this type is expected to have usually. As always in the configuration the default separator character is SPACE.
 
|-
 
|-
 
|<code>Preferred</code>  
 
|<code>Preferred</code>  
|boolean. Since file extensions cannot always be assigned to a unique type, this flag was introduced. It indicates the preferred type for a group of types with similar properties, otherwise, the first match is used.  
+
|boolean. Several file types may use the same extension; this property tells {{AOo}} that a particular type should get preference over others. Of course that only works if not every type uses that property. If no flag is set, the type found first in the Types set wins.
 +
|-
 +
|<code>DetectService</code>
 +
|string. {{AOo}} uses the properties described above of all types (like extension or MediaType) to guess the type of a particular file. Once a possible type is found, it is possible to call some code that examines the file more closely to verify the simple detection ("flat" and "deep" detection). The DetectService property is the service or implementation name of the UNO service that can do this task.
 +
|-
 +
|<code>PreferredFilter</code>
 +
|After a successful type detection {{AOo}} will look for a filter that can load this type. It is possible that more than one filter is present. This property tells which filter should be the preferred one. This selection can be overridden by explicit preselection of a different filter (by API or by user interaction in the file dialog).
 
|-
 
|-
 
|<code>DocumentIconID</code>  
 
|<code>DocumentIconID</code>  
|int. You can assign an icon to a type. To do this, the ID is used as reference to a resource. This feature is currently not supported in {{PRODUCTNAME}}.  
+
|int. Deprecated. Please don't use.
 
|}
 
|}
  
 
{{PDL1}}
 
{{PDL1}}
[[Category: Office Development]]
+
 
 +
[[Category:Documentation/Developer's Guide/Office Development]]

Latest revision as of 14:39, 9 August 2021



Every type inside Apache OpenOffice is specified by the properties shown in the table below. These values are accessible at the previously mentioned service com.sun.star.document.TypeDetection using the interface com.sun.star.container.XNameAccess. Write access is not available here. All types are addressed by their internal names. The property names are identical to the configuration property names.

Documentation caution.png The documentation of the TypeDetection service currently is outdated. In case of conflicting information about the properties this page is right. An update will follow soon.
Properties of a Document Type, available at TypeDetection
Name string. The internal name of the type. This is only an API property, not a configuration property. In the configuration this is the name of the configuration node containing all the other properties. To avoid name clashes with other node names it should follow the rules outlined for extension identifiers.
UIName string. User friendly name of the type. It may be localized using the localization support of the configuration. All Unicode characters are permitted here. Currently, this UI name is not used in Apache OpenOffice itself, but it is available for e.g. extensions.
MediaType string. Describes the MIME type of the Type.
ClipboardFormat string. The property name is misleading and has historical reasons. This property contains a format name that is used somewhere in the content itself to enable filters loading it to verify that the content has the right type. It may be the "doctype" in a XML file, the storage format identifier in an OLE storage or the MIMEType of and ODF document. This name can be used by a generic ExtendedTypeDetection service that is used for more than one format.
URLPattern sequence<string>. Enables the support of own URL schemata, that always shall be handled by the same filter(s). For example, in Apache OpenOffice "private:factory/swriter" for opening an empty text document. The wildcards '*' or '?' are supported here.
Extensions sequence<string>. All extensions that this type is expected to have usually. As always in the configuration the default separator character is SPACE.
Preferred boolean. Several file types may use the same extension; this property tells Apache OpenOffice that a particular type should get preference over others. Of course that only works if not every type uses that property. If no flag is set, the type found first in the Types set wins.
DetectService string. Apache OpenOffice uses the properties described above of all types (like extension or MediaType) to guess the type of a particular file. Once a possible type is found, it is possible to call some code that examines the file more closely to verify the simple detection ("flat" and "deep" detection). The DetectService property is the service or implementation name of the UNO service that can do this task.
PreferredFilter After a successful type detection Apache OpenOffice will look for a filter that can load this type. It is possible that more than one filter is present. This property tells which filter should be the preferred one. This selection can be overridden by explicit preselection of a different filter (by API or by user interaction in the file dialog).
DocumentIconID int. Deprecated. Please don't use.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages