List Info

Thread: Re: Problems with installing and uninstalling Extensions




Re: Problems with installing and uninstalling Extensions
user name
2007-10-19 06:50:57
Tobias Krais wrote:
> Hi Juergen,
> 
>> well, that can have different reasons. It works
normally quite well and
>> more interesting would be what are you doing in
detail.
> 
> I tested many many times and I try to find out what is
wrong, to be able
> to reproduce my failure. The last thing I found out
is:
> 1. If I install my Extension (named
JudasComponent.oxt), the extension
> does NOT work.
> 2. Renaming the extension (e.g. JudasComponent01.oxt)
and installing it
> will install it and my extension works well!
> 3. The problem does not depend on my user profile.
> 4. I experienced the problem only on Ubuntu (amd64)
Feisty (OOo 2.2.0)
> and Gutsy (OOo 2.3). Up to now, I was not able to
reproduce the failure
> on Windows and I want to test on Debian Etch systems
next week.
> 5. The first 5 or six times worked also well on my
Ubuntu system.
> 6. The problem first occured when doing the following
steps via Java
> API: - detecting the version number of the installed
extension. Then
> removing the extension. At least installing a newer
version of the
> extension.
> 
> -> Is my OpenOffice registry broken?
you can easy test it. Run your office with

soffice -env:UserInstalltion=./mynewuserdir

Install and test your extensions in this new fresh user
directory.


Juergen

> 
>> When did you get this error, when you install the
extensions or when you
>> remove it.
> 
> I got the one specific error on installing my
extension. Normally, there
> is no error messages.
> 
>> When you get error when you remove the extensions i
would be interested
>> what exactly are you doing in your extension. It's
quite easy to crash
>> the office or doing some strange things in
extensions.
> 
> My extension contains two protocol handler.
> 1. The first one dispatches the save dialog.
> 2. The second reads my file and prints the current
document on a printer
> and a printer tray I specified on the file.
> 
> Here is the code I use for adding the package:
> -----%<-----
> public class UNOPackageManager implements
XCommandEnvironment {
> 
> public void addPackage(String packageURL, String
packageManagerType) {
> 	String packageUNOURL = createUNOFileURL(packageURL);
> 		
> 	XComponentContext xComponentContext =
> 				OOWorkbench.getXComponentContext();
> 			
> 	// Package manager name
> 	String packageManagerName =
>
	"/singletons/com.sun.star.deployment.thePackageManager
Factory";
> 	
> 	XPackageManager xPM = null;
> 	try {
> 		XPackageManagerFactory xPMF =
(XPackageManagerFactory)
> 		AnyConverter.toObject(XPackageManagerFactory.class,
>
		xComponentContext.getValueByName(packageManagerName));
> 		
> 		// Getting the package manager representative
> 		xPM = xPMF.getPackageManager(pmType);
> 	}
> 	catch (Exception e) {
> 	}
> 	try {
> 		XAbortChannel xAbortChannel =
xPM.createAbortChannel();
> 		xPM.addPackage(packageUNOURL, "",
xAbortChannel, this);
> 	}
> 	catch (Exception e) {
> 	}
> }
> 		
> /**
>  * Implementation of the getProgressHandler method of
the
>  * XCommandEnvironment.
>  * return An implementation of the XProgressHandler.
>  */
> public XProgressHandler getProgressHandler() {
> 	return new ProgressImpl();
> }
> 	
> /**
>  * Implementation of the getInteractionHandler method
of the
>  * XCommandEnvironment.
>  * return An implementation of the XInteractionHandler.
>  */
> public XInteractionHandler getInteractionHandler() {
> 	return new InteractionImpl();
> }
> 
> }
> 
> /**
>  * InteractionImpl implements the XInteractionHandler.
It is needed to
>  * add a UNO package.
>  * author tobias
>  */
> class InteractionImpl implements XInteractionHandler
> {
>     /**
>      * Implementation of the handle method of the
XInteractionHandler. 	
>      * It handles the add request of a package.
>      * param xRequest The XInteractionRequest needed to
handle the 		
>      * interaction.
>      */
>      public void handle (XInteractionRequest xRequest)
>     {
>         boolean approve = true;
>         XInteractionContinuation[] conts =
xRequest.getContinuations();
> 
>         for (int i = 0; i < conts.length; i++)
>         {
>             if (approve)
>             {
>                 XInteractionApprove xApprove =
(XInteractionApprove)
>                    
	UnoRuntime.queryInterface(XInteractionApprove.class,
>                     			conts[i]);
>                 if (xApprove != null)
>                     xApprove.select();
>                 //don't query again for ongoing
extensions
>                 approve = false;
>             }
>         }
>     }
> }
> 
> /**
>  * ProgressImpl implements the XProgressHandler. This
class is quiete empty,
>  * but nothing more is needed to add UNO packages.
>  * author tobias
>  */
> class ProgressImpl implements XProgressHandler {
>     /**
>      * Implementation of the push method of the
XProgressHandler. Empty.
>      * param status Object
>      */
> 	public void push(Object status) {
>     }
> 
> 	/**
>      * Implementation of the update method of the
XProgressHandler. Empty.
>      * param status Object
>      */
>     public void update(Object status) {
>     }
> 
>     /**
>      * Implementation of the pop method of the
XProgressHandler. Empty.
>      */
>     public void pop() {
>     }
> }
> -----%<-----
> 
> Now I continued testing with renamed packages. Adding
the package via
> API does install the package, but it is not working. Is
there a failure
> in the code?
> 
> Maybe that helps to give me a hint how to continue.
> 
> Greetings, Tobias
> 
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
> For additional commands, e-mail: dev-helpapi.openoffice.org
> 

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


Re: Problems with installing and uninstalling Extensions
user name
2007-10-22 07:37:21
Hi Juergen,

>> -> Is my OpenOffice registry broken?
> you can easy test it. Run your office with
>
> soffice -env:UserInstalltion=./mynewuserdir

now I continued testing here my results:
1. On Windows systems (Windows XP, OOo 2.3), installing the
extension
via API and unopkg works always properly and my extension is
working
perfect.
2. After removing my ~/.openoffice.org2/ and creating it new
on my
Ubuntu Gutsy 64 bit system (OOo 2.3) and Ubuntu Feisty 64
bit system
(OOo 2.2) (tested with different Java versions, always the
same result):
2.1 Installing the extension with unopkg installs the
extension
correctly and the extension works.
2.2 Installing the extension via API, the extension is
installed
correctly, but does not work. (expclicit: my commandURL does
not work.)
3. Installing the extension on Debian lenny (OOo 2.2.1) via
API and
unopkg works always properly and my extension is working
perfect.

Thus my results are: my former user directory was malformed.
For me, it
seems to be a linux x86_64 issue. What do you think? Can
anybody do a 5
minutes test out there? I can send debug instructions for
details.

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 )