Difference between revisions of "Documentation/DevGuide/Extensions/Examples"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial author Sun Microsystems, Inc.)
 
m (formatting and highlighting)
Line 9: Line 9:
 
The following content of a ''description.xml'' directly references update information:
 
The following content of a ''description.xml'' directly references update information:
  
  <nowiki><?xml version="1.0" encoding="UTF-8"?>
+
<source lang="xml">
  <description xmlns="http://openoffice.org/extensions/description/2006"
+
<?xml version="1.0" encoding="UTF-8"?>
              xmlns:xlink="http://www.w3.org/1999/xlink">
+
<description xmlns="http://openoffice.org/extensions/description/2006"
      <version value="1.0" />  
+
  xmlns:xlink="http://www.w3.org/1999/xlink">
 +
  <version value="1.0" />  
 
    
 
    
      <update-information>
+
  <update-information>
        <src xlink:href="http://extensions.openoffice.org/testarea/desktop/simple/update/plain1.update.xml" />
+
    <src xlink:href="http://my.company.com/update/extension.update.xml" />
      <src xlink:href="http://extensions.mirror.openoffice.org./testarea/desktop/simple/update/plain1.update.xml" />
+
    <src xlink:href="http://my.company-mirror.com/update/extension.update.xml" />
      </update-information>
+
  </update-information>
  </description></nowiki>
+
</description></nowiki>
 
+
</source>
 
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.
 
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 ''plain1.update.xml'':
+
This is the content of ''extension.update.xml'':
  
  <nowiki><?xml version="1.0" encoding="UTF-8"?>
+
<source lang="xml">
  <description xmlns="http://openoffice.org/extensions/update/2006"
+
<?xml version="1.0" encoding="UTF-8"?>
              xmlns:xlink="http://www.w3.org/1999/xlink">
+
<description xmlns="http://openoffice.org/extensions/update/2006"
      <identifier value="org.openoffice.legacy.plain1.oxt"/>
+
  xmlns:xlink="http://www.w3.org/1999/xlink">
      <version value="2.0" />  
+
  <identifier value="org.openoffice.legacy.extension.oxt"/>
      <update-download>
+
  <version value="2.0" />  
          <src xlink:href="http://extensions.openoffice.org/testarea/desktop/simple/update/plain1.oxt" />
+
  <update-download>
      </update-download>
+
    <src xlink:href="http://my.company.com/update/extension.oxt" />
  </description></nowiki>
+
  </update-download>
 +
</description>
 +
</source>
  
The src element contains a URL to version 2.0 of ''plain1.oxt''. ''Plain1.oxt'' has the identifier <code>org.openoffice.legacy.plain1.oxt</code> 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''.
+
The src element contains a URL to version 2.0 of ''extension.oxt''. ''extension.oxt'' has the identifier <code>org.openoffice.legacy.extension.oxt</code> 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 ===
 
=== Using the Atom Feed ===
 
This is the content of the ''description.xml'' of ''feed1.oxt'' which references an atom feed:
 
This is the content of the ''description.xml'' of ''feed1.oxt'' which references an atom feed:
  
  <nowiki><?xml version="1.0" encoding="UTF-8"?>
+
<source lang="xml">
  <description xmlns="http://openoffice.org/extensions/description/2006"
+
<?xml version="1.0" encoding="UTF-8"?>
              xmlns:xlink="http://www.w3.org/1999/xlink">
+
<description xmlns="http://openoffice.org/extensions/description/2006"
      <version value="1.0" />  
+
  xmlns:xlink="http://www.w3.org/1999/xlink">
      <update-information>
+
  <version value="1.0" />  
        <src xlink:href="http://extensions.openoffice.org/testarea/desktop/updatefeed/update/feed1.xml" />
+
  <update-information>
      </update-information>
+
    <src xlink:href="http://my.company.com/update/feed1.xml" />
  </description></nowiki>
+
  </update-information>
 +
</description>
 +
</source>
  
 
The feed:
 
The feed:
  
  <nowiki><?xml version="1.0" encoding="utf-8"?>
+
<source lang="xml">
  <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
+
<?xml version="1.0" encoding="utf-8"?>
 +
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
 
    
 
    
    <title>Extensions Update Feed</title>
+
  <title>Extensions Update Feed</title>
    <link rel="alternate" type="text/html" href="http://update.services.openoffice.org/ooo/snapshot.html"/>
+
  <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>
 
     <updated>2006-11-06T18:30:02Z</updated>
     <author>
+
     <summary>Click here to go to the download page.</summary>
      <name>The OpenOffice.org Project</name>
+
     <content type="application/xml" src="http://extensions.openoffice.org/testarea/desktop/updatefeed/update/feed2.update.xml" />
      <uri>http://openoffice.org</uri>
+
  </entry>
      <email>updatefeed@openoffice.org</email>
+
</feed>
    </author>
+
</source>
    <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></nowiki>
+
  
 
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 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.
Line 88: Line 95:
 
The ''update information'' for the version of ''feed1.oxt'':
 
The ''update information'' for the version of ''feed1.oxt'':
  
  <nowiki><?xml version="1.0" encoding="UTF-8"?>
+
<source lang="xml">
  <description xmlns="http://openoffice.org/extensions/update/2006"
+
<?xml version="1.0" encoding="UTF-8"?>
              xmlns:xlink="http://www.w3.org/1999/xlink">
+
<description xmlns="http://openoffice.org/extensions/update/2006"
      <identifier value="org.openoffice.legacy.feed1.oxt"/>
+
  xmlns:xlink="http://www.w3.org/1999/xlink">
      <version value="2.0" />  
+
  <identifier value="org.openoffice.legacy.feed1.oxt"/>
      <update-download>
+
  <version value="2.0" />  
          <src xlink:href="http://extensions.openoffice.org/testarea/desktop/updatefeed/update/feed1.oxt" />
+
  <update-download>
      </update-download>
+
    <src xlink:href="http://extensions.openoffice.org/testarea/desktop/updatefeed/update/feed1.oxt" />
  </description></nowiki>
+
  </update-download>
 +
</description>
 +
</source>
  
 
{{PDL1}}
 
{{PDL1}}
 
[[Category: Extensions]]
 
[[Category: Extensions]]

Revision as of 11:52, 13 November 2007



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