 |
Introduction
The proposed CJAN manifest structure is defined at <http://cjan.org/CJAN-xml-docs/build/site/om/manifest.html> (temporary location). From recent discussions, most of this is now likely to end up in a metadata section of the artifact archive. Some may better belong in the manifest (either Sun's MANIFEST.MF or the CJAN manifest.xml).
I've been thinking about Java application <=> operating environment intergration and would like to suggest some extra entities and attributes for manifest.xml, either for version 1 or for a later version. Much of this information would work best if it was present in the installed archive as the tools would still be able to interrogate the archive to determine the information.
FileInfo
CJAN-aware applications can provide further information about archives based on manifest.xml. Command-line applications could display this information when a particular flag is set and window managers, file viewers and so on could provide a "File Info" or "About"dialogue box. Right now, Java applications stand out from native applications in that the operating environment doesn't know much about the application beyond the fact that it is written in Java.
The FileInfo? or About dialogue box for the application is generated from the version, authors, license, homepage and purpose-description elements of the manifest. purpose-description is the only new entity and describes the purpose of the application/artifact.
Tooltip
The text for the tooltip comes from the short-description element of the manifest.
Launcher Menu
CJAN-aware applications can provide context-sensitive menus for Java archives based on manifest.xml.
The menu elements from the manifest provide a list of extra menu items to display for the application. When one is chosen, Main.Class is called with option as its only argument. You can nest menus inside other menus to create submenus, provided they have <Label> elements.
<menu>
<Item arg="-f=Default">
<Label>Enable foobar</Label>
<Label xml:lang="es">Habilitar el foobar</Label>
</Item>
<Item arg="-f=">
<Label>Disable foobar</Label>
<Label xml:lang="es">Deshabilitar el foobar</Label>
</Item>
</menu>
Application icon and name
If the icon element is defined and its value is a legal png, svg or xpm file, or with a suffix of .png, .svg, or .xpm refers to a legal png, svg or xpm file respectively; then this icon is used with the application in place of the CJAN-aware systems' standard java icon. The title-description element of the manifest is used for the name of the application in viewers and menus in preference to the file name. The file name will appear in the properties dialogue. ttile-description is a new entity and gives the preferred name of the Java application. icon is a new element.
Document bindings / file associations
Provide a list of extension to mimetype, mimetype to natural language description and mimetype to editor mappings. On systems that support the shared mime database (see http://www.freedesktop.org/Standards/AddingMIMETutor), the CJAN-aware file viewer should
add the mappings when the application is first installed, update the mappings when the application is moved and remove the mappings when the application is deleted (or found to be missing). One way to achieve this would be to make the database updates transient so that they are lost on a reboot, then have the viewer scan all the application directories for jar files with document bindings on startup (thus bootstrapping the bindings). Similarly, application directories not in the path could be bootstrapped by the viewer by simply opening a view onto them.
<mime type="text/x-diff">
<glob pattern="*.patch" />
<glob pattern="*.diff" />
<comment>Differences between files</comment>
<comment xml:lang="af">verskille tussen l?ers</comment>
<action arg="-f" class="org.cjan.example.DiffViewer" />
</mime>
Help
If Help.Class is defined in the manifest, the CJAN-aware application should display a help entry in the menu. When chosen, the CJAN-aware window manager, file viewer, etc. should run the specified class. If Help.Args is defined, the options should be passed as arguments to the help class.
Otherwise, if Help.URI is defined in the manifest, the CJAN-aware application should display a help entry in the menu. When chosen, the viewer should open the URI specified by the Help.URI entry.
Otherwise, if there is a directory called "help" (any combination of case) at the top level of the archive, the CJAN-aware viewer should process the Jar as a Zip file and open a viewer onto the directory. This requires that the viewer is able to browse zip files AND hide the rest of the contents of the zip file from the user.
with single argument:
<help class="org.cjan.example.Help">
<arg value="-h" />
</help>
with multiple arguments:
<help class="org.cjan.example.Help">
<arg value="-h" />
<arg value="-h" />
</help>
with argument line:
<help class="org.cjan.example.Help">
<arg line="-h contents" />
</help>
with URL:
<help uri="http://help.cjan.org/contents/" />
Summary of proposed elements and attributes:
purpose-description
menu / item@arg / label{@xml:lang}
title-description & icon
mime / glob@pattern+, comment{@xml:lang}+, action{@arg}
help@class / arg@value+ | arg@line
help@uri
To Do
This document was first written before the proposal to move some of the elements out of the manifest. This document, the manifest.xml document and the metadata proposal need to be updated together to clarify which elements live where.
Credits
The above was inspired by rox.sourceforge.net's viewer implementation and freedesktop.org's shared MIME database (neither directly related to Java) plus a Java request for enhancement asking for (unspecified) better integration with operating systems (can't find the reference) and a recent blog entry describing how MacOS? applications work with the operating environment and how Java applications on MacOS? stand out because every Java application looks the same. http://weblogs.java.net/pub/wlg/1013 and http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac/ and http://today.java.net/pub/a/today/2003/12/08/swing.html
-- MichaelDavey - 30 Apr 2004
|