List Info

Thread: Re: Registration of UNO package via Java possible?




Re: Registration of UNO package via Java possible?
user name
2007-09-24 08:46:26
Rony G. Flatscher wrote:
> Hi Tobias,
[...]
>> Here ist the code:
>> -----%<----
>> String packageURL = 		
>>
"/home/tobias/workspace/OOComNG/oocom/unopkg/JudasCompo
nent.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: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Registration of UNO package via Java possible?
user name
2007-09-25 02:46:17
Hi Stephan,

> 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.

OK I changed it. Thanks for the information. Let me ask a
question: if
autodetection is possible, why should I pass the media
type?

Greetings, Tobias

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )