Hi Tobias,
> [...]
>
> I tried to implement it and it seems to work partly. I
can remove
> already registered components successfully.
>
Very good!
> But I have problems registering my Extension.
Registering it manually
> works great, thus I know the Extension is fine,
although its an old
> extension (.uno.pkg). My code seems also to find the
package, because
> passing the wrong path returns a worse error message.
>
> Here is the error message:
> -----%<-----
> com.sun.star.deployment.DeploymentException: Fehler
beim Hinzufügen von:
> JudasComponent.und.pkg
>
Are you sure it is ".und.pkg" above ('d' instead
of 'o' in ".uno.pkg")?
> -----%<-----
> "Fehler beim Hinzufügen von" is German and
means "Failure when adding...".
>
Not sure why that happens (I *think* this behaviour may have
started
with 2.2, as it used to work flawlessly beforehand).
[It would be nice if at that point OOo would give a much
more meaningful
error message!]
> 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>.
> Maybe someone can help me...
>
Maybe the "addPackage()" method got changed, such
that the last two
arguments need to be supplied and not be "null"?
(Just a wild guess.)
---rony
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|