Difference between revisions of "Documentation/DevGuide/Extensions/Simple License"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
(some links and clean-up)
Line 18: Line 18:
 
     xmlns:xlink="http://www.w3.org/1999/xlink">
 
     xmlns:xlink="http://www.w3.org/1999/xlink">
 
     <registration>
 
     <registration>
       <simple-license accept-by="user" default-license-id="de">
+
       <simple-license accept-by="user" >
         <license-text xlink:href="registration/license_de.txt" lang="de" license-id="de" />
+
         <license-text xlink:href="registration/license_de.txt" lang="de" />
 
         <license-text xlink:href="registration/license_en_US.txt" lang="en-US" />
 
         <license-text xlink:href="registration/license_en_US.txt" lang="en-US" />
 
       </simple-license>
 
       </simple-license>
Line 26: Line 26:
 
</source>
 
</source>
  
In this example, the license would have to be agreed to by all users (that means no shared mode installation). This is indicated by the value <code>user</code> of the attribute accept-by in the <code><simple-license></code> element. The attribute could also have the value <code>admin</code>, which would indicate that the license needs only be agreed to by the person who installs it.
+
In this example, the license would have to be agreed to by all users (that means no shared mode installation). This is indicated by the value <code>user</code> of the attribute accept-by in the <code>[[Documentation/DevGuide/Extensions/Description of XML Elements#Element /description/registration/simple-license|<simple-license>]]</code> element. The attribute could also have the value <code>admin</code>, which would indicate that the license needs only be agreed to by the person who installs it.
  
The <code><license-text></code> elements contain information about the files which contain the text that is displayed. The content of these files must be UTF-8 encoded. It is displayed exactly as it is in the file. That is, no formatting occurs. There can be one to many <code><license-text></code> elements, where each element provides information about a different language of the license text. The attribute <code>xlink:href</code> contains a relative URL (relative to the root directory of the extension) which points to a file which contains the license text in exactly one language. Which language is indicated by <code>lang</code> attribute.
+
The <code>[[Documentation/DevGuide/Extensions/Description of XML Elements#Element /description/registration/simple-license/license-text|<license-text>]]</code> elements contain information about the files which contain the text that is displayed. The content of these files must be UTF-8 encoded. It is displayed exactly as it is in the file. That is, no formatting occurs. There can be one to many <code>[[Documentation/DevGuide/Extensions/Description of XML Elements#Element /description/registration/simple-license/license-text|<license-text>]]</code> elements, where each element provides information about a different language of the license text. The attribute <code>xlink:href</code> contains a relative URL (relative to the root directory of the extension) which points to a file which contains the license text in exactly one language. Which language is indicated by <code>lang</code> attribute.
  
If the package manager does not find a <code><license-text></code> element which matches the locale of {{PRODUCTNAME}} then it will pick the <code><license-text></code> that is marked as the default language. This mark is expressed by the license-id attribute of <code><license-text></code> and the default-license-id attribute of the <code><simple-license></code> element. There must always be exactly one <code><license-text></code> whose attribute value is the same as that from <code><simple-license></code>. This <code><license-text></code> element is then used as the default.
+
If the package manager does not find a <code>[[Documentation/DevGuide/Extensions/Description of XML Elements#Element /description/registration/simple-license/license-text|<license-text>]]</code> element which matches the locale of {{PRODUCTNAME}} then it will pick the first <code>[[Documentation/DevGuide/Extensions/Description of XML Elements#Element /description/registration/simple-license/license-text|<license-text>]]</code> element as the default. Prior to OOo 2.4. the default entry needed to marked explicitely by <code>[[Documentation/DevGuide/Extensions/Description of XML Elements#Element /description/registration/simple-license/license-text|license-id]]</code> attribute.
Please note, that as of OOo 2.4 the attributes default-license-id and license-id are not required anymore. Then the first  <license-text> element is used as the default if no matching locale was found.
+
  
  

Revision as of 09:11, 18 July 2008



This feature is about displaying a license text to the user during installation. The user can agree or decline the license, where in the latter case the installation will be aborted. It is called “Simple License” because there is no tamper resistant mechanism that prevents the installation in case the user does not agree to the license. It also does not do anything more than just displaying a license text. This text can be localized (see Documentation/DevGuide/Extensions/Localized XML Elements).

The license text is displayed either in a dialog or in the console dependent on the way the Extension Manager was started. When it was started by the Tools - Extension Manager menu item or by invoking unopkg gui in the console then a dialog is used. By using unopkg add the license text will be displayed in the console and user input has to be done through the same.

The license dialog or the license text in the console is displayed when the extension is being installed. Currently there are two modes to install extensions, user mode and shared mode. An extension that was installed in user mode (let's call it a user extension) can only be used by just that person who installed it. If the extension was installed in shared mode (let's call it a shared extension), then it can be used by all users. Since the license text is only displayed during installation, all users who are using a shared extension will not see any license text (except the user who installed this shared extension). However, the publisher of the extension may think it necessary that everyone who wants to use it has to agree to the license first. For this purpose, he can mark the extension accordingly. This extension can then only be installed in user mode and not in shared mode. Likewise the extension can be marked indicating that only the person who installs it needs to agree to the license. Such an extension can be installed in both modes. But when installing in user mode then every user has to agree to the license nonetheless.

Here is an example of the description.xml:

  <?xml version="1.0" encoding="UTF-8"?>
  <description xmlns="http://openoffice.org/extensions/description/2006"
    xmlns:xlink="http://www.w3.org/1999/xlink">
    <registration>
      <simple-license accept-by="user" >
        <license-text xlink:href="registration/license_de.txt" lang="de" />
        <license-text xlink:href="registration/license_en_US.txt" lang="en-US" />
      </simple-license>
    </registration>
  </description></nowiki>

In this example, the license would have to be agreed to by all users (that means no shared mode installation). This is indicated by the value user of the attribute accept-by in the <simple-license> element. The attribute could also have the value admin, which would indicate that the license needs only be agreed to by the person who installs it.

The <license-text> elements contain information about the files which contain the text that is displayed. The content of these files must be UTF-8 encoded. It is displayed exactly as it is in the file. That is, no formatting occurs. There can be one to many <license-text> elements, where each element provides information about a different language of the license text. The attribute xlink:href contains a relative URL (relative to the root directory of the extension) which points to a file which contains the license text in exactly one language. Which language is indicated by lang attribute.

If the package manager does not find a <license-text> element which matches the locale of OpenOffice.org then it will pick the first <license-text> element as the default. Prior to OOo 2.4. the default entry needed to marked explicitely by license-id attribute.


See also


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools