Rony G. Flatscher wrote:
Hi Tobias,
[...]
Here ist the code:
-----%<----
String packageURL =             
"/home/tobias/workspace/OOComNG/oocom/unopkg/JudasComponent.uno.pkg";

//Creating a UNO compatible File URL
String packageUNOURL = OODocument.createUNOFileURL(packageURL);
String mediaType = "application/vnd.sun.star.uno-component;type=Java";
        
// Use String "vnd.sun.star.tdoc:///4711/uno_packages" for transient,
// "user" for local, "shared" for global package installation
XPackageManager xPM = getPackageManager("user");
try {
        xPM.addPackage(packageUNOURL, mediaType, null, null);
}
catch (Exception e) {
        System.out.println(e);
}
-----%<----
I think the mediaType is wrong. But what media type should I use to add
a complete Extension Package? I tried adding the jar file contained in
the package, but I got the same error...
Hmm, mostlikely the media-type is o.k., eg. cf.
<http://wiki.services.openoffice.org/wiki/General_UNO_Component_Project_Type>.

No, application/vnd.sun.star.uno-component;type=Java is for jar files. The correct media type for the containing .uno.pkg or .oxt is application/vnd.sun.star.package-bundle (desktop/source/deployment/registry/package/dp_package.cxx:1.21 l. 257). Or pass an empty string for auto detection.

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to