Examples

From Apache OpenOffice Wiki
< Documentation‎ | DevGuide
Revision as of 11:52, 13 November 2007 by Jl (Talk | contribs)

Jump to: navigation, search



description.xml Containing Direct Reference to the Update Information

The following content of a description.xml directly references update information:

<?xml version="1.0" encoding="UTF-8"?>
<description xmlns="http://openoffice.org/extensions/description/2006"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <version value="1.0" /> 
 
  <update-information>
    <src xlink:href="http://my.company.com/update/extension.update.xml" />
    <src xlink:href="http://my.company-mirror.com/update/extension.update.xml" />
  </update-information>
</description></nowiki>

The second src element contains a URL to a mirror which will be used by the Extension Manager if the location referenced by the URL in the first src element cannot be reached.

This is the content of extension.update.xml:

<?xml version="1.0" encoding="UTF-8"?>
<description xmlns="http://openoffice.org/extensions/update/2006"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <identifier value="org.openoffice.legacy.extension.oxt"/>
  <version value="2.0" /> 
  <update-download>
    <src xlink:href="http://my.company.com/update/extension.oxt" />
  </update-download>
</description>

The src element contains a URL to version 2.0 of extension.oxt. extension.oxt has the identifier org.openoffice.legacy.extension.oxt because it does not define an identifier in its description.xml. Otherwise the identifier would be the same as the one in the description.xml.

Using the Atom Feed

This is the content of the description.xml of feed1.oxt which references an atom feed:

<?xml version="1.0" encoding="UTF-8"?>
<description xmlns="http://openoffice.org/extensions/description/2006"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <version value="1.0" /> 
  <update-information>
    <src xlink:href="http://my.company.com/update/feed1.xml" />
  </update-information>
</description>

The feed:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
 
  <title>Extensions Update Feed</title>
  <link rel="alternate" type="text/html" href="http://update.services.openoffice.org/ooo/snapshot.html"/>
  <updated>2006-11-06T18:30:02Z</updated>
  <author>
    <name>The OpenOffice.org Project</name>
    <uri>http://openoffice.org</uri>
    <email>updatefeed@openoffice.org</email>
  </author>
  <id>urn:uuid:a4ccd383-1dd1-11b2-a95c-0003ba566e9d</id>
  <entry>
    <title>feed1.oxt version 2.0 available</title>
    <link rel="alternate" type="text/html"
      href="http://extensions.openoffice.org"/>
    <id>urn:uuid:a4ccd383-1dd1-11b2-a95c-0003ba566e9f</id>
    <category term="org.openoffice.legacy.feed1.oxt" label="feed1.oxt" />
    <updated>2006-11-06T18:30:02Z</updated>
    <summary>Click here to go to the download page.</summary>
    <content type="application/xml" src="http://extensions.openoffice.org/testarea/desktop/updatefeed/update/feed1.update.xml" />
  </entry>
  <entry>
    <title>feed2.oxt version 2.0 available</title>
    <link rel="alternate" type="text/html"
      href="http://extensions.openoffice.org"/>
    <id>urn:uuid:a4ccd383-1dd1-11b2-a95c-0003ba566eaf</id>
    <category term="org.openoffice.legacy.feed2.oxt" label="feed2.oxt" />
    <updated>2006-11-06T18:30:02Z</updated>
    <summary>Click here to go to the download page.</summary>
    <content type="application/xml" src="http://extensions.openoffice.org/testarea/desktop/updatefeed/update/feed2.update.xml" />
  </entry>
</feed>

The feed contains two entry elements and each references the update information for a different extensions. It could, however, also reference the update information for two different versions of the same extension.

The update information for the version of feed1.oxt:

<?xml version="1.0" encoding="UTF-8"?>
<description xmlns="http://openoffice.org/extensions/update/2006"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <identifier value="org.openoffice.legacy.feed1.oxt"/>
  <version value="2.0" /> 
  <update-download>
    <src xlink:href="http://extensions.openoffice.org/testarea/desktop/updatefeed/update/feed1.oxt" />
  </update-download>
</description>
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools