[api-dev] Navigator visible when opening document in hidden mode

2009-04-14 Thread Tobias Krais
Hi together,

I detected a strange behaviour of OpenOffice.org (3.0.1 and older) while
doing my unit tests. My tests first open a Global Document (.odm) and
thus always open the document Navigator window. After closing the
document there are two mysterious behaviours:

1. If I close the Global Document without closing the document Navigator
and open a normal text document (.odt), the Navigator is opened for this
document again.

2. This happens even if my document is opened in hidden mode! Thus I
have a hidden document with a visible Navigator :-)

Do you think its a bug? If yes, is just point 2 or even point 1 a bug?

Greetings, Tobias

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Navigator visible when opening document in hidden mode

2009-04-14 Thread Tobias Krais
Hi Carsten,

 From my point of view point 2 looks like a bug. Point 1 is the defined
 behavior of docking windows. The visibility state of a docking windows
 is NOT stored dependent on the application module. Only toolbars and the
 status bar store their visibility state dependent on the application
 module.

here it is: http://www.openoffice.org/issues/show_bug.cgi?id=101058

Thanks for your 5 Cents.

Greetings, Tobias

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



[api-dev] Getting my own toolbar via Java API

2009-04-13 Thread Tobias Krais
Hi together,

I created a extension with a little Add-On toolbar. While I can access
the bars OpenOffice.org delivers, e.g. the standard toolbar
(private:resource/toolbar/standardbar) I wonder how I can get the
toolbar of my extension.

Can somebody help me with this?

Greetings, Tobias

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] How to access the Storage of an opened OOo document?

2009-04-04 Thread Tobias Krais
Hi Guiseppe,

 Now my questions, keeping in mind that at a certain time I need to
 access the META-INF substorage to manipulate a custom file (read and
 write).

I did not read the whole Thread. Here an Idea, how to get your needed path:
-%-
// Return value
String currentPath = null;

// Get URL of the class
URL sourceURL = TheJudasConfigHandler.class.getProtectionDomain()
.getCodeSource().getLocation();

URI sourceURI;
try {
sourceURI = new URI(sourceURL.toString());
File source = new File(sourceURI);
if (source.getCanonicalPath().toString().endsWith(.jar)) {
// If this class is located within a JAR File, get the
// path of it
currentPath = source.getParentFile().getCanonicalPath()
+ File.separator;
} else {
currentPath = source.getCanonicalPath()
+ File.separator;
}
} catch (URISyntaxException e) {
throw new Exception(e);
} catch (IOException e) {
throw new Exception(e);
}

File globalConfigPath = new File(new File(currentPath)
.getParent() + System.getProperty(file.separator)
+ META-INF + System.getProperty(file.separator));
-%-

I hope this helps.

Greetings, Tobias

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] running extension once

2009-03-11 Thread Tobias Krais
Hi Giancarlo,

 then this can be rather simple, and does not depend on OOo API, but in how 
 you 
 design your implementation.
 Another point is: do you want your extension to run only once per frame, or 
 once per OOo main process?
 As you've been told, you can solve this with a flag; but this depends on your 
 design.

when I read Ariels message, an idea came up in my mind. Define a normal
singleton class in your extension with a static member. OpenOffice.org
creates just one VM. Thus the class and its members are allover the same.

Greetings, Tobias

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] how to know if an extension is already running [edit]

2009-03-10 Thread Tobias Krais
Hi Giancarlo,

 I think that should exist some sdk method which tells us if the
 extension has been already activated.
 Or am I wrong?
 
 I think so.
 The extension is loaded when you start OpenOffice.org.
 Whether functions included in the extension are running, and when they
 stop, is up to your code.

Cor is right. I use Java and registered a Singleton for a similar
purpose. I add a close listener to my dialog resetting my tracking variable.

Greetings,

Tobias

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Xstorable.storeToUrl locks soffice.bin

2009-02-23 Thread Tobias Krais
Hi Daniel,

 Really what I would like to know is how to avoid the hanging soffice.bin.

 Any hints?

I have two ideas:
1. After doing an action like opening, printing, storing or closing,
what happens it you let your main Thread sleep for half a second? This
avoids some deadlocks in my case.
2. If you can reproduce the deadlock, can you strace it? I think it
might be interesting for the OOo team.

Good luck,

Tobias

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Xprintable getPrinter returns a zero length sequence

2009-02-18 Thread Tobias Krais
Hi Daniel,

 The reason I am trying to do it this way is that we need to print or convert
 thousands of documents each month and when I create a Model Frame and
 Controller, OpenOffice inevitablly hangs after a short while, probably
 something to do with threading in OpenOffice and maybe finalizers in java.

I have the same problem. This is how I solved it:
1. I bootstrap OpenOffice.org,
2. open a document and convert it and
3. close the document.
4. Next I open the next  document and convert it...

The important thing is not to close OpenOffice.org. In case you always
start a new Java process for each conversion, you can open a socket or
something like this.

Greetings, Tobias

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Stop update warning

2009-01-16 Thread Tobias Krais
Hi Marian,

go to the extra menu - Options - OpenOffice.org - Online Update and
set the proper option.

Greetings, Tobias

Marian Roselló Bennassar schrieb:
 Dear all,
  
 I have a java program created with 2.4 API. The program converts from ODM to 
 PDF and from ODT to HTML. I execute the program from the command line, when I 
 try to convert a document created with OpenOffice 3 a dialog appears asking 
 me if I want to update to OpenOffice 3, how can I avoid this? I have already 
 disabled the check for updates option with no luck.
  
  The program runs automatically every night, since I have this problems the 
 executions is stop. Could anyone help me?
  
 Thank you,
 Marian.
 

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Stop update warning

2009-01-16 Thread Tobias Krais
Hi Marian,

try to delete your OpenOffice.org settings, in Linux it is
/homa/user/.openoffice.org2/

May be you want to make a copy before deletion.

Greetings, Tobias

Marian Roselló Bennassar schrieb:
 Thank you Tobias, but the problem is still there... When running the java 
 class from the command line, keeps asking if I want to update to OpenOffice3. 
 Has anyone seen this problem before?
 
 Thanks again,
 Marian 
 
 -Original Message-
 From: Tobias Krais [mailto:tux-s...@design-to-use.de] 
 Sent: 16 January 2009 11:12
 To: dev@api.openoffice.org
 Subject: Re: [api-dev] Stop update warning
 
 Hi Marian,
 
 go to the extra menu - Options - OpenOffice.org - Online Update and set 
 the proper option.
 
 Greetings, Tobias
 
 Marian Roselló Bennassar schrieb:
 Dear all,
  
 I have a java program created with 2.4 API. The program converts from ODM to 
 PDF and from ODT to HTML. I execute the program from the command line, when 
 I try to convert a document created with OpenOffice 3 a dialog appears 
 asking me if I want to update to OpenOffice 3, how can I avoid this? I have 
 already disabled the check for updates option with no luck.
  
  The program runs automatically every night, since I have this problems the 
 executions is stop. Could anyone help me?
  
 Thank you,
 Marian.

 
 -
 To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
 For additional commands, e-mail: dev-h...@api.openoffice.org
 
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
 For additional commands, e-mail: dev-h...@api.openoffice.org
 

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] open office software

2009-01-08 Thread Tobias Krais
Hi shakunthala,

 kindly help me in installing the open office software, many a time i
 downloaded form the net and try to install but it is not happening.
 
 Waiting for you reply.

this is the wrong list for this question. Please refer to a
openoffice.org-users list.

Greetings, Tobias

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] save to an image?

2009-01-06 Thread Tobias Krais
Hi Albert,

 Um... unless I'm misunderstanding you, don't you lose all the formatting and
 text styles if you do this?

I did not try it. There might be a way you can preserve the formattings.

Greetings, Tobias

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



[api-dev] Bug? Deploying non OXT files via API works

2008-12-29 Thread Tobias Krais
Hi together,

I deploy my OXT via Java API. And I created some unit tests. One is for
checking failure behaviour: e.g. I try to install a PDF or other non-OXT
and it works! Is this correct behaviour?
Checking if the PDF file is installed returns false. But the Extension
Manager Dialogue shows the PDF file with a questionmark.

A similar behaviour is when I install broken OXTs (broken means that
files like the description.xml or Addons.xcu is missing). Depending on
which OXT content files are missing, the extension is correctly
installed or is just shown with a questionmark.

Souldn't the installation fail if the OXT isn't correct or is even a PDF
file?

Greetings,

Tobias

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] Bug? Deploying non OXT files via API works

2008-12-29 Thread Tobias Krais
Hi Jürgen,

thank you for the explanations. Should I file a issue for the PDF thing?

Greetings, Tobias

Juergen Schmidt schrieb:
 Hi Tobias,
 
 the whole extension mechanism evolved over the time. I agree that the
 API should fail for files that can't be installed in general like a PDF.
 The other things are not so easy to decide. A missing description.xml is
 still a valid extension package. The description.xml was introduced
 later. You remember we started with plain zip files. One can argue that
 an oxt file must have a description.xml (and of course it should) but we
 decided to be flexible here. That means we check the content and see
 what we can install. A missing Addons.xcu doesn't mean that the oxt file
 is invalid. xcu files are required for some extensions but not
 necessarily for all kind of extensions.
 
 When i remember it correctly an oxt file is visible but disabled when
 one part referenced in the manifest is corrupt or can't be installed. I
 think this is fine. For some files you get an error box giving more
 details. But that is not always possible.
 A missing description.xml results in a question mark because the info
 from the description.xml are not available but the content is ok.
 
 It's not easy to decide. Especially if we won't break older extensions.
 But i agree that we should try to improve the error handling if
 possible. I don't know the detailed behavior of the API without testing
 it myself again but i think it's not easy possible at the moment.
 
 Juergen
 
 
 
 Tobias Krais wrote:
 Hi together,

 I deploy my OXT via Java API. And I created some unit tests. One is for
 checking failure behaviour: e.g. I try to install a PDF or other non-OXT
 and it works! Is this correct behaviour?
 Checking if the PDF file is installed returns false. But the Extension
 Manager Dialogue shows the PDF file with a questionmark.

 A similar behaviour is when I install broken OXTs (broken means that
 files like the description.xml or Addons.xcu is missing). Depending on
 which OXT content files are missing, the extension is correctly
 installed or is just shown with a questionmark.

 Souldn't the installation fail if the OXT isn't correct or is even a PDF
 file?

 Greetings,

 Tobias

 -
 To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
 For additional commands, e-mail: dev-h...@api.openoffice.org

 
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
 For additional commands, e-mail: dev-h...@api.openoffice.org
 

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



[api-dev] Overwrite property when exporting to HTML partly ignored?

2008-12-11 Thread Tobias Krais
Hi together,

I am exporting e.g. a presentation document to HTML via API. I set the
Overwrite property. The HTML export consists of several files. The main
file (presentation.html) is really overwritten while other files
(text0.html and img0.jpg) are not overwritten. Instead a message appears
that asks me to overwrite. Well, if I set the Overwrite option, I really
want to overwrite and I don't want to be asked again. Is this a bug or a
feature?

Greetings, Tobias

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



[api-dev] Bug? - Closing OOo will close multiple documents

2008-12-04 Thread Tobias Krais
Hi together,

I have the following strange behaviour:
1. Open a document (e.g. an odt file) via API and then close the
document (only the document, not the OOo frame). Thus an empty OOo frame
remains (in OOo3 the OOo app chooser is loaded in the frame).
2. Open again a document via API. The document is not loaded in the
first frame - a new one is opened. Now close the remaining frame from
point 1. Closing it will also close our document of point 2!

This does not occur if you open the documents with a file explorer! It
only occurs when opening via API.

I do not know if issue 65942
(http://www.openoffice.org/issues/show_bug.cgi?id=65942) is related to
this thing here.

Do you think this is a bug?

Greetings, Tobias

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



Re: [api-dev] How to now the running OO-version

2008-10-21 Thread Tobias Krais
Hi Fernand,

 BTW any idea how i can get the running OO-version ?

here a Java code example - we had this on the list already:
-%-
/**
 * Getting the OpenOffice version.
 * @return String containing the version, e.g. 2.3 or 2.2.1
 */
public static String getOpenOfficeVersion() {
return
getOpenOfficeProperty(org.openoffice.Setup/Product,ooSetupVersion);
}

/**
 * Getting the current used OpenOffice locale.
 * @return String containing the locale, e.g. de or en
 */
public static String getOpenOfficeLocale() {
return
getOpenOfficeProperty(org.openoffice.Setup/L10N,ooLocale);  
}

/**
 * Reading the OpenOffice Configuration Provider for different values.
 * @param nodePath Node path of the config to read.
 * @param node Node of the node path.
 * @return String with the property.
 */
private static String getOpenOfficeProperty(String nodePath, String
node){
if (!nodePath.startsWith(/)){
nodePath = / + nodePath;
}
String property = ;
// create the provider and remember it as a XMultiServiceFactory
try {
Object configProvider =
OOWorkbench.getXMCF().createInstanceWithContext(
com.sun.star.configuration.ConfigurationProvider,
OOWorkbench.getXComponentContext());

XMultiServiceFactory  xConfigProvider =
(XMultiServiceFactory) UnoRuntime.queryInterface(
com.sun.star.lang.XMultiServiceFactory.class,
configProvider);

// The service name: Need only read access:
final String sReadOnlyView =
com.sun.star.configuration.ConfigurationAccess;
// creation arguments: nodepath
PropertyValue aPathArgument = new PropertyValue();
aPathArgument.Name = nodepath;
aPathArgument.Value = nodePath;
Object[] aArguments = new Object[1];
aArguments[0] = aPathArgument;

// create the view
XInterface xElement = (XInterface)
xConfigProvider.createInstanceWithArguments(sReadOnlyView, aArguments);
XNameAccess xChildAccess =
(XNameAccess)
UnoRuntime.queryInterface(XNameAccess.class, xElement);

// get the value
property = (String) xChildAccess.getByName(node);
} catch (Exception e){
System.out.println(e);
}
return property;
}
-%-

Greetings, Tobias

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



Re: [api-dev] CannotRegisterImplementationException

2008-10-19 Thread Tobias Krais
Hi Marcin,

 Does anybody have a clue what happens? I have no access to machines that
 experience the problem but it seems replicable :/ Reinstall of OOo and
 Java and deleting Java settings doesn't fix the problem. I don't really
 know where to look for the reason - is it our code or the bug in the
 operating system or in OpenOffice.org?

IIRC we had the same problem. The JAR was compiled against Java 6 and on
the machines, only Java 5 was installed. Deleting the old Java VMs and
installing the newest solved our problem.

Greetings, Tobias

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



Re: [api-dev] Cannot open Open Office

2008-10-17 Thread Tobias Krais
Hi Max,

this is the wrong mailinglist for your question. Please go to a users
maillingliste in your language.

Greetings, Tobias

Max Foster schrieb:
 After downloading Open Office from Disk, I did not find the necessary
 logo on my Desktop.  Instead I found a logo labelleg Upen...  2.4(e..
  
 This accesses a number of logos none of which are marked 'startup'. 
 Please help me  to start this program.
 
 Upgrade Your Email - Click here!
 http://promos.hotbar.com/promos/promodll.dll?RunPromoEl=SG=RAND=38974partner=seekmo
 
 

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



Re: [api-dev] Where can i find SDK for OpenOffice 3.0?

2008-10-16 Thread Tobias Krais
Hi Ruslan,

this was already discussed this week. Please look it up.

Greetings, Tobias

Ruslan schrieb:
 Hello.
 
 Where can i find SDK for OpenOffice 3.0?
 
 on site i can find only SDK for OpenOffice 2.4
 
 Thanks.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-10-14 Thread Tobias Krais
Hi Stephan,

 as I read in the issue, the problem is solved and there exists a new
 unowinreg.dll. For I am not familiar with the OOo repos, can you send me
 the new file? I would like to test it under XP and Vista.
 
 Just mailed it directly to Tobias.

I just tested it and it works.

Thanks for the work!

Greetings, Tobias

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



[api-dev] Problems with Extension Update and Quickstarter

2008-10-09 Thread Tobias Krais
Hi together,

I have a problem updating extensions. I have an Extension containing a
singleton and want to update it using either the Extension Manager or
the unpublished API.

If I just update the extension (does'nt matter wheter I use Java or the
Extension Manager), the new version is installed, all contents of my
extension are activated out of the JAR file containing the application.
It is deactivated.

Thus I changed my Java Code in this way:
1. Removing the old extension.
2. Terminate the XDesktop.
3. Installing the new extension.
This works very well as long as I do not use a quickstarter (Windows or
Gnome). If I use a Quickstarter, there will be again the failure that
the JAR file of my extension is not activated.

Thus my question: is there a chance to close and start the quickstarter
via API? Or more generally: is there a chance to do this without user
interaction (except killing the process via command line call)?

Or: can't OOo do this automatically at next chance?

Greetings, Tobias

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



Re: [api-dev] Problems with Extension Update and Quickstarter

2008-10-09 Thread Tobias Krais
Hi Stephan,
 If I just update the extension (does'nt matter wheter I use Java or the
 Extension Manager), the new version is installed, all contents of my
 extension are activated out of the JAR file containing the application.
 It is deactivated.
 
 This sounds like a bug, so I would suggest you file an issue (including
 a description how exactly to reproduce the bug).

Thanks for the fast answer. Against which module should I file it?

Greetings, Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-10-08 Thread Tobias Krais
Hi Juergen,

 Can't you ask the developer responsible for unowinreg.dll about what's
 changed in it? Maybe this will shed some light on the issue or at
 least gives you some pointers into the right direction.

 :-) nothing has changed in the dll.

I don't know the internals of the dll file. The only difference seems to
be, that the new dll is compiled against OOo3 and the working dll is
compiled against OOo2.4.1. Am I right? Could this be a reason?

Greetings, Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-10-08 Thread Tobias Krais
Hi Juergen,

thanks a lot for your work!

Greetings, Tobias

Juergen Schmidt schrieb:
 Tobias Krais wrote:
 Hi Juergen,

 Can't you ask the developer responsible for unowinreg.dll about what's
 changed in it? Maybe this will shed some light on the issue or at
 least gives you some pointers into the right direction.

 :-) nothing has changed in the dll.

 I don't know the internals of the dll file. The only difference seems to
 be, that the new dll is compiled against OOo3 and the working dll is
 compiled against OOo2.4.1. Am I right? Could this be a reason?
 Stephan Bergmann found the problem. The new unowinreg.dll is compiled
 with the new compiler and contains in the manifest a dependency to a new
 C++ runtime.
 
 I tested on a VM where an OO.org3.0 was installed and the new runtime
 was in the system installed as well. A de-installation of OO.org 3.0
 didn't remove the new runtime and that was the problem of my tests :-(
 
 We will fix this problem asap. Until the fix is available please use the
 unowinreg.dll from a 2.4.1 SDK or use the NB plugin 1.1.4.
 
 Juergen
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-10-02 Thread Tobias Krais
Hi Juergen,

 i haven't the exact error message present but it was also a
 java.lang.UnsatisfiedLinkError ... can't load in a 32 bit env ... or
 somethinglike that.

-%-
Exception in thread main java.lang.UnsatisfiedLinkError: C:\Dokumente
und Eins
tellungen\twc\Lokale Einstellungen\Temp\unowinreg7421.dll: Diese
Anwendung konnt
e nicht gestartet werden, weil die Anwenungskonfiguration nicht korrekt
ist. Zur
 Problembehebung sollten Sie die Anwendung neu installieren
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.sun.star.lib.loader.WinRegKey.clinit(WinRegKey.java:88)
at
com.sun.star.lib.loader.InstallationFinder.getPathFromWindowsRegistry
(InstallationFinder.java:207)
at
com.sun.star.lib.loader.InstallationFinder.getPath(InstallationFinder
.java:115)
at com.sun.star.lib.loader.Loader.getCustomLoader(Loader.java:176)
at com.sun.star.lib.loader.Loader.main(Loader.java:137)
-%-

 Anywayl, i have only OO.org 2.4.1 installed until now in a WinXP SP2
 virtualbox image. As i mentioned before i have problems to reproduce it.
 I will keep you informed tomorrow ...

I think you can reproduce it: try to run such a JAR without any OOo
installation. This failure above will occur. But another failure should
occur (no UNO installation found).

Greetings, Tobias

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



Re: [api-dev] Java in Windows and OOo uses different Paper Tray names

2008-10-02 Thread Tobias Krais
Hi together,

in May we had a discussion on this topic. Meanwhile I solved my problem
due to an other thread on this mailing list. Here is the code I use for
getting the printers and its tray names from OOo:
-%-
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.sun.star.awt.XInfoPrinter;
import com.sun.star.awt.XPrinterServer;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Exception;
import com.sun.star.uno.XComponentContext;

import de.twc.oocom.oo.OOWorkbench;
import de.twc.utils.IPrinter;

public class OOPrinter implements IPrinter {

/**
 * Instance of this class.
 */
private static volatile IPrinter INSTANCE;

/**
 * The OpenOffice.org [EMAIL PROTECTED] XPrinterServer}.
 */
private XPrinterServer xPrinterServer = null;

/**
 * Getting the instance of this class. This class is a  
 * singleton.
 * @return [EMAIL PROTECTED] IPrinter} Instance of this class.
 */
public static IPrinter getInstance() {
if(INSTANCE == null)
synchronized (OOPrinter.class) {
if (INSTANCE == null) {
INSTANCE = new OOPrinter();
}
}
return INSTANCE;
}

/**
 * Getting the printer trays of a printer via OpenOffice.org.   
 * OpenOffice.org does not offer a method to get the printer
 * tray names directly. But is
 * offers a method, to get printer information and returns a
 * String like this: *;*;Tray Name; ;*;. This method derives
 * the tray name from the
 * string by detecting the sourrounding semicolons.
 * @param printerName String with the name of the printer.
 * @return String[] with the names of the printer trays.
 */
@Override
public String[] getPrinterTrays(String printerName) {
if(xPrinterServer == null)
initXPrinterServer();

XInfoPrinter xInfoPrinter =
xPrinterServer.createInfoPrinter(printerName);

// Print the trays received the OOo way
String ooTrays[] = xInfoPrinter.getFormDescriptions();
for(int i = 0; i  ooTrays.length; i++) {
String rangeRegex = (.*;){2}[^;]{5,};
Pattern pattern = Pattern.compile(rangeRegex);
Matcher matcher = pattern.matcher(ooTrays[i]);
while(matcher.find()){
String ooTray = matcher.group();
ooTrays[i] = ooTray.substring(
ooTray.lastIndexOf(;) + 1);
}
}
return ooTrays;
}

/**
 * Getting the printer names from OpenOffice.org.
 * @return String[] containing the printer names.
 */
@Override
public String[] getPrinters() {
if(xPrinterServer == null)
initXPrinterServer();
return  xPrinterServer.getPrinterNames();
}

/**
 * Initialising the [EMAIL PROTECTED] XPrinterServer}.
 */
private void initXPrinterServer() {
XComponentContext xCC =
OOWorkbench.getXComponentContext();
XMultiComponentFactory xMCF = xCC.getServiceManager();
Object oPrintServer = null;
try {
oPrintServer = xMCF.createInstanceWithContext(
com.sun.star.awt.PrinterServer, xCC);
} catch (Exception e) {
e.printStackTrace();
}
try {
xPrinterServer = (XPrinterServer)
AnyConverter.toObject(  
XPrinterServer.class, oPrintServer);
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
}
}
-%-

I hope this code serves you.

Greetings, Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Tobias Krais
Hi Matthias,

thanks for the classes.

 All that's really needed is the classes/ subtree of the 3.0 SDK. We're
 building our own program with the 2.4 SDK and the classes/ from 3.0
 and it bootstraps fine with 2.4 and 3.0. I've uploaded the classes to

These classes work for me in Linux with OOo 2.4.1 and 3.0rc3. But in
Windows they work only with OOo 3.0rc3, not with 2.4.1. Using it with
OOo 2.4.1 gives me following Java Exception:
-%-
Exception in thread main java.lang.UnsatisfiedLinkError: C:\Dokumente
und Eins
tellungen\twc\Lokale Einstellungen\Temp\unowinreg7421.dll: Diese
Anwendung konnt
e nicht gestartet werden, weil die Anwenungskonfiguration nicht korrekt
ist. Zur
 Problembehebung sollten Sie die Anwendung neu installieren
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.sun.star.lib.loader.WinRegKey.clinit(WinRegKey.java:88)
at
com.sun.star.lib.loader.InstallationFinder.getPathFromWindowsRegistry
(InstallationFinder.java:207)
at
com.sun.star.lib.loader.InstallationFinder.getPath(InstallationFinder
.java:115)
at com.sun.star.lib.loader.Loader.getCustomLoader(Loader.java:176)
at com.sun.star.lib.loader.Loader.main(Loader.java:137)
-%-

Did I make a mistake?

Greetings, Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Tobias Krais
Hi Juergen,

 you can find a SDK under
 http://distribution.openoffice.org/mirrors/#mirrors - select one of the
 mirrors and search under .../contrib/rc/3.0.0rc2
 
 Sorry that it is so complicate and i promise that we will provide an
 easier mechanism in the near future. I always have the same problem to
 find a snapshot SDK.

I found the 3rc3 SDK here:
ftp://mirror.csclub.uwaterloo.ca/openoffice/contrib/rc/3.0.0rc3/

The files are named OOo-SDK_3.0.0rc3_...

Thanks for fixing it so fast!

But using all the files in the classes folder leads to a
java.lang.UnsatisfiedLinkError as I wrote in answer to Matthias' mail.

Greetings,

Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Tobias Krais
Hi Matthias,

thanks for your answer.

 Exception in thread main java.lang.UnsatisfiedLinkError: C:\Dokumente
 und Einstellungen\twc\Lokale Einstellungen\Temp\unowinreg7421.dll: Diese
 Anwendung konnt e nicht gestartet werden, weil die Anwenungskonfiguration
 nicht korrekt ist.

 As you can see from the error message, there's a problem starting the
 unowinreg.dll. This happens before OOo is even started (this DLL is
 used to determine the location of the soffice.exe to start by reading
 certain registry keys). So this error cannot be related to to your
 OpenOffice.org version.

OK. I tested the same on other computers. The result: it worked on just
one machine, but did not work on 5 machines!

 I assume that your OOo 2.4.1 installation is
 on a different computer than your OOo 3.0 installation and you'll have
 to look for the answer to this problem in the differences between the
 two.

I tested it on the same machine, installing, uninstalling and
reinstalling the neede OpenOffice.org version...

 I've tested our own program built with the exact same classes/
 and it works fine under Windows 2000 regardless of which OOo version
 is installed.

... I envy your installation. I tested on different WinXP (some have SP2
others SP3) machines.

Lost greetings,

Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-30 Thread Tobias Krais
Hi Stephan,
 is that the recently introduced
 com/sun/star/lib/loader/Loader$Drain.class is not included.

 my SDK 2.4.1 does not come with this file. I do not have an Release
 candidate SDK installed (where can I get it?). Since when does the new
 class come along?
 
 The Simple Bootstrap mechanism had to be adapted for OOo 3.0.0, see the
 mail thread starting at
 http://udk.openoffice.org/servlets/ReadMsg?list=devmsgNo=4034.
 Quoting http://www.openoffice.org/issues/show_bug.cgi?id=88687#desc3:
 The net result is that newly built Simple Bootstrap applications should
 work against old and new OOo installations, but old Simple Bootstrap
 applications will not work against new OOo installations.

Thanks for the links, they were really useful to get acustomed to the
backgrounds.

Greetings, Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-29 Thread Tobias Krais
Hi Stephan,

 One thing that looks wrong with the explicit recipe at
 http://codesnippets.services.openoffice.org/Office/Office.BootstrapOpenOffice.snip
 is that the recently introduced
 com/sun/star/lib/loader/Loader$Drain.class is not included.

my SDK 2.4.1 does not come with this file. I do not have an Release
candidate SDK installed (where can I get it?). Since when does the new
class come along?

Thanks and greetings, Tobias

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



Re: [api-dev] Migrating simple bootstrap to OOo3

2008-09-29 Thread Tobias Krais
Hi Juergen,

 you should or better you have to include the bootstrap clue code from
 the new 3.0 SDK.

I think will do so. As I already answered Stephan Bergmanns mail, where
can I get the SDK? I used the Debian packages from the download website.
But I did not find a SDK included...

Or is there a sample code of the bootstrap clue in the web available?

Thanks in advance!

Greetings, Tobias

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



[api-dev] 64-bit deb packages (Was: Using com.sun.star.presentation.Presentation)

2008-09-15 Thread Tobias Krais
Hi Daniel,

 I'm currently trying to use the API, via Python, to automate the display
 of slideshows in Impress.  I am using the 64-bit deb
 packages from 'http://download.openoffice.org/3.0beta/'

If I try to download these packages, the bouncer tells me The download
you have chosen could not be initiated automatically. and I get no
downloads. How did you get the packages?

Greetings, Tobias

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



Re: [api-dev] Error exception

2008-09-14 Thread Tobias Krais
Hi Rudi,

 I have four calc tables in one program, each has 3000 rows and 30 columns. 
 Close to the end the routine, the system throws an error execption. If I add 
 a meaningless statement the routine ends one statement before. Can somebody 
 help me. Thanks.

please give us some code. We cannot help you without it.

Greetings, Tobias

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



Re: [api-dev] Adding a keyboard shortcut to an uno CommandURL

2008-08-26 Thread Tobias Krais
Hi Carsten,

 We are working on a solution for extension which is based on XCU files,
 hopefully that will be available for OOo 3.1. Currently you can only use
 the UI configuration manager to define a shortcut. For example see the
 Basic code below which defines a shortcut to a Basic macro.

thanks for the info. I think I will search for a Basic macro that
dispatches my CommandURL (.Judas:PrintTrays) and then assign a shortcut
to it.

Greetings, Tobias

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



Re: [api-dev] Howto create CalcAddin and then a .oxt File?

2008-08-22 Thread Tobias Krais
Hi Thomas,

we use Eclipse and created an ant file. May be it helps you:
-%-
?xml version=1.0 encoding=ISO-8859-1 ?
project default=judasextension name=OOo

property file=build.properties/

path id=build.classpath
fileset dir=${basedir}/
include name=lib/*.jar/
/fileset
/path

pathconvert property=test.project.manifest.classpath pathsep=
path refid=build.classpath/
mapper
chainedmapper
flattenmapper/
globmapper from=*.jar to=lib/*.jar /
/chainedmapper
/mapper
/pathconvert


target name=pre-init if=build.ext.OOo.dir
echo message=PRE INIT/

!-- trick IDEAs ant support --
property name=build.ext.OOo.dir 
value=${build.ext.OOo.dir}/
property name=build.dir value=${build.ext.OOo.dir}/
/target

target name=setProps depends=pre-init
property name=src.dir value=source/
property name=lib.dir value=lib/
property name=bin.dir value=bin/
property name=dist.dir value=dist/

property name=idl.dir 
value=${basedir}/idl/de/twc/oocom/comp/

property name=build.dir value=build/
property name=build.classes.dir 
value=${build.dir}/classes/
property name=build.lib.dir value=${build.dir}/lib/

property name=build.urd.dir
value=${build.dir}/urd/de/twc/oocom/comp/
/target

target name=init depends=setProps 
mkdir dir=${dist.dir}/
mkdir dir=${build.dir}/
mkdir dir=${bin.dir}/
mkdir dir=${build.classes.dir}/
mkdir dir=${build.lib.dir}/

copy todir=${build.lib.dir}
fileset dir=${lib.dir}/
/copy
/target

!--
$(JAVADIR)/javac -source 1.5 -target 1.5  -classpath
$(CLASSPATH):$(BIN_DIR) -d $(BIN_DIR) $(SOURCE_DIR)/*.java
--
target name=compile depends=init
!-- Compile the standard components --
javac destdir=${bin.dir}
deprecation=${compile.deprecation} debug=true
optimize=${compile.optimize}
classpath
fileset dir=${lib.dir}
include name=**/*.jar/
include name=**/*.zip/
/fileset
fileset dir=${openoffice.lib.dir}
include name=**/*.jar/
include name=**/*.zip/
/fileset
/classpath
src path=${src.dir}/
include name=**/*.java/
/javac
/target

!--
$(OOO_DIR)/sdk/linux/bin/idlc -C -I. -I $(OOO_DIR)/sdk/idl -O
$(URD_DIR) $(IDL_DIR)/JudasComponent.idl
--
target name=idl if=idl.file 
exec executable=${openoffice.sdk.bin.dir}/idlc
outputproperty=idl.out
arg value=-C /
arg value=-I. /
arg value=-I${openoffice.sdk.dir}/idl /
arg value=-O${build.urd.dir} /
arg value=${idl.file} /
/exec
echo message=${idl.out} /
/target

!--
$(OOO_DIR)/sdk/linux/bin/regmerge types.rdb /UCR
$(URD_DIR)/JudasComponent.urd
--
target name=regmerge if=idl.file depends=idl
basename property=filename file=${idl.file} suffix=.idl/
exec executable=${openoffice.sdk.bin.dir}/regmerge
outputproperty=regmerge.out
arg value=types.rdb/
arg value=/UCR /
arg value=${build.urd.dir}/${filename}.urd/
/exec
echo message=${regmerge.out} /
/target

!--
$(OOO_DIR)/sdk/linux/bin/javamaker -BUCR -nD -Gc
-Tde.twc.oocom.comp.XJudasComponent $(OOO_DIR)/program/types.rdb \\ -O
$(BUILD_DIR)types.rdb
and
cp -R $(BUILD_DIR)/de $(BIN_DIR)
--
target name=javamaker if=idl.file depends=regmerge 
basename property=filename file=${idl.file} suffix=.idl/
exec executable=${openoffice.sdk.bin.dir}/javamaker
outputproperty=javamaker.out
arg value=-BUCR /
arg value=-nD /
arg value=-Gc/
arg value=-Tde.twc.oocom.comp.XJudasComponent/
arg value=${openoffice.program.dir}/types.rdb /
arg 

[api-dev] Adding a keyboard shortcut to an uno CommandURL

2008-08-21 Thread Tobias Krais
Hi together,

I developed a OpenOffice.org Addon with a new toolbar. Now I would like
to add a keyboard shortcut to one of these buttons. When pressing the
button, the CommandURL .Judas:Print is called.

I did not succeed adding a keyboard shortcut for this CommandURL using
the normal dialog in the Extra menu. How can I add a keyboard shortcut
to call the CommandURL directly? Is the only way writing a macro
dispatching the CommandURL? Or can I do the trick in the Addons.xcu file?

Greetings, Tobias

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



Re: [api-dev] Using / defining own types in UNOIDL

2008-08-21 Thread Tobias Krais
Hi together,

sorry for my silly question. I solved it:

[snip]
IDL name: XSpringLoader
Java Implementation: SpringLaoderImpl
[snip]

I solved it this way: I created initialize methods for the attributes I
need in the XSpringLoader class. Additionally I created some
getInitialized...() methods in my SpringLoaderImpl class. After I
initialized everything I need, I cast the XSpringLoader object to an
SpringLoaderImpl object and was able to retrieve the needed attributes.

Greetings, Tobias

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



Re: [api-dev] Bootstrap and Performance

2008-08-21 Thread Tobias Krais
Hi again,

 Thus my question: has using this parameter a very positive impact on
 bootstrap performance? My machine seems to be too fast for testing this...

I now found it out: it does not boost the bootstrap. Do you know other
ways to speed up the bootstrap mechanism?

Greetings, Tobias

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



Re: [api-dev] Bootstrap and Performance

2008-08-21 Thread Tobias Krais
Hi Juergen,

 Thus my question: has using this parameter a very positive impact on
 bootstrap performance? My machine seems to be too fast for testing
 this...

 I now found it out: it does not boost the bootstrap. Do you know other
 ways to speed up the bootstrap mechanism?
 well the office has to start and it depends on the office start. Keep an
 office running should be faster. Improving the office start should help
 here as well ;-)
 
 I know that it is no satisfying answer but i have no other :-(

thanks for your answer. It is a satisfying answer, because now I know
that there is no need to continue searching.

But one question: on Windows machines, I use the quickstarter. Klicking
on documents in the explorer opens the documents extremely fast. But
bootstraping OOo is slower. Can you explain why?

Greetings, Tobias

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



Re: [api-dev] OOo Java ClassLoader strategies ? (Re: [dev] Saxon9 and OpenOffice 2.4

2008-08-12 Thread Tobias Krais
Hi Rony,

 Knowing them would really alleviate a lot of developing problems, where
 one loses really tons of time/resources to a) figure out that a class
 loader problem may be in effect and b) trying to find possible solutions.

May be this Issue helps you:
http://www.openoffice.org/issues/show_bug.cgi?id=80100

Greetings, Tobias

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



Re: [api-dev] Getting the path of the unopkg or soffice executable in java

2008-08-11 Thread Tobias Krais
Hi Anupam,

I had no more time for this thing, because we had more important things
to do. But in case I find time to solve it, I'll post it.

Grüßle, Tobias

Agnisys schrieb:
 Hi Tobias,
   Where you able to get an answer to your question?
   I'm looking for the same answer.
 
 Thanks,
 Anupam.
 
 
 Tobias Krais-2 wrote:
 Hi Cor,

 No Java-info from me.
 What I have in Basic might give a hint?

 sService = com.sun.star.deployment.PackageInformationProvider
 oPackageInfoProvider =
 GetDefaultContext.getValueByName(/singletons/ + sService)

 'you have to create an oxt with a description.xml and a unique
 identifier
 Dim sExtensionIdentifier$
 'change this with your extension's identifier
 sExtensionIdentifier = nl.nouenoff.xxx.oxt '
 org.openoffice.sdk.devguide.extensions.GenericOptionsPagesHandler

 Dim sPackageLocation$
 sPackageLocation =
 oPackageInfoProvider.getPackageLocation(sExtensionIdentifier)
 this is a very interesting idea. I will look after it next week.

 Greetings, Tobias

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



 

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



Re: [api-dev] Accessing the bridge of a bootstrapped connection

2008-08-05 Thread Tobias Krais
Hi Denis,

 after starting OpenOffice using bootstrap(), how do you get
 notified when the connection terminates?
 
 Is there a way to get the used bridge so that I could add an
 event listener?

you have to add a terminate listener to the XDesktop object.

Greetings, Tobias

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



Re: [api-dev] Closing problem

2008-07-26 Thread Tobias Krais
Hi Robert,

 I've got an ugly solution: each second I try to get the storage location
 of my XComponent. As soon as it failes (a disposed exception is thrown),
 I know the document was closed. What do you think about this solution?
 Or do you have any better ideas?
 
 I'm not sure if I understood you correctly, but this can help you ...
 Implement interface css.util.XCloseListener and attach it to
 document's frame via css.util.XCloseable from css.frame.XFrame.

Thanks for you answer. My problem is that I want prevent OOo to close
down completely. I want to leave initialized OOo when exiting my java
application. That is not possible using a close listener. After my close
event method is done, OOo will shut down completely.

Thus I think I need todo it the ugly way. What do you think?

Greetings, Tobias

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



Re: [api-dev] Closing problem

2008-07-25 Thread Tobias Krais
Hi together,

 I have a Java application bootstrapping OOo and opening a document.
 After opening the document, some additional stuff is done. Now I want to
 wait, until the user closes the document. When the user closes the
 document, I want OOo to leave an initialized UNO and do some other stuff.
 
 How to do this?

I've got an ugly solution: each second I try to get the storage location
of my XComponent. As soon as it failes (a disposed exception is thrown),
I know the document was closed. What do you think about this solution?
Or do you have any better ideas?

Greetings, Tobias

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



[api-dev] Using / defining own types in UNOIDL

2008-07-21 Thread Tobias Krais
Hi together,

recently I asked how to define a singleton in OOo. Now my singleton
works. It's purpose is to load the Spring Framework and to use it later.
Thus I defined an Interface with the needed methods:
-%-
#ifndef __de_twc_oocom_comp_xspringloader_idl__
#define __de_twc_oocom_comp_xspringloader_idl__

#include com/sun/star/uno/XWeak.idl
module de { module twc { module oocom { module comp {   
published interface XSpringLoader : com::sun::star::uno::XWeak {
any getSpring();
void setSpring([in] any spring);
};
 }; }; }; };
#endif
-%-

The implementation of these methods look like this:
-%-
public Object getSpring() {
if(springInstance == null)
initSpring();
return (Object) springInstance;
}

public void setSpring(Object spring) {
if (spring instanceof IServiceFactory) {
springInstance = (IServiceFactory) spring;
}
}
-%-

Initializing the Spring Framework works fine, but returning it failes
with the message:
-%-
com.sun.star.uno.RuntimeException: [jni_uno bridge error] UNO calling
Java method getSpring: [map_to_uno():any] UNO type not found:
de.twc.service.ServiceFactory
-%-

How can I solve this? Can I define my own return type? If I understood
the DevWiki correctly, this is not possible. Thus, how can I cast
springInstance to a meta-object and cast it back later?

Greetings, Tobias

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



Re: [api-dev] Loading Extension on startup of OpenOffice and use it later

2008-07-15 Thread Tobias Krais
Hi Daan,

 You can try to replace __getServiceFactory with __getComponentFactory as
 follows:
 
 ==
 public static XSingleComponentFactory __getComponentFactory (String
 implName) {
 XSingleComponentFactory xSingleComponentFactory = null;
 
 if (implName.equals(JudasProtocolHandler.class.getName())) {
  xSingleServiceFactory = Factory.createComponentFactory(
   JudasProtocolHandler.class, 
   new String[] {SERVICENAME}
   );
 } else if (implName.equals(SpringLoaderImpl.class.getName())) {
  xSingleServiceFactory = Factory.createComponentFactory(
   SpringLoaderImpl.class, 
   new String[] {SpringLoaderImpl.__singeltonName}
   );
 }
 return xSingleServiceFactory;
 }
 
 
 This is what we are using, I'm not sure about the exact differences
 between getServiceFactory and getComponentFactory.

I did so with no success.

Greetings, Tobias

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



Re: [api-dev] [SOLVED] Loading Extension on startup of OpenOffice and use it later

2008-07-15 Thread Tobias Krais
Hi Daan,

I solved the problem! Here is how I did it:
 ==
[...]
 } else if (implName.equals(SpringLoaderImpl.class.getName())) {
  xSingleServiceFactory = Factory.createComponentFactory(
  SpringLoaderImpl.class, 
  new String[] {SpringLoaderImpl.__singeltonName}
  );
 }
[...]
 

Here the failure resides in. I had to pass not only the singleton name
to the Factory.createComponentFactory method, but also the service name.

I had to change my __writeRegistryServiceInfo like this:
-%-
public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
try {
XRegistryKey newKey = regKey.createKey(
SpringLoaderImpl.class.getName() +
/UNO/SINGLETONS/ +
theSpringLoader.class.getName());
newKey.setStringValue(SpringLoaderImpl.__singeltonName);
} catch (InvalidRegistryException e) {
return false;
}

// NOTE: use the service Names!!!
boolean regSpring = FactoryHelper.writeRegistryServiceInfo(
SpringLoaderImpl.class.getName(),
SpringLoaderImpl.__serviceNames, regKey);

boolean regJudas = FactoryHelper.writeRegistryServiceInfo(
JudasProtocolHandler.class.getName(),
JudasProtocolHandler.SERVICENAME, regKey);
return regJudas  regSpring;
}
-%-

And my __getComponentFactory like this:
-%-
public static XSingleComponentFactory __getComponentFactory (String
implName) {
XSingleComponentFactory xSingleComponentFactory = null;

if (implName.equals(JudasProtocolHandler.class.getName())) {
xSingleComponentFactory =
Factory.createComponentFactory(
JudasProtocolHandler.class,
new String[]
{JudasProtocolHandler.SERVICENAME}
);
}
else if (implName.equals(SpringLoaderImpl.class.getName())) {
xSingleComponentFactory =
Factory.createComponentFactory(
SpringLoaderImpl.class,
SpringLoaderImpl.__serviceNames
);
}
return xSingleComponentFactory;
}
-%-

While __serviceNames is defined as:
-%-
public static final String[] __serviceNames = {
de.twc.oocom.comp.SpringLoaderImpl,
de.twc.oocom.comp.theSpringLoader};
-%-

Daan, your mails and answers were very helpful! Thanks a lot!

Greetings, Tobias

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



Re: [api-dev] [SOLVED] com.sun.star.uno.RuntimeException: no service object raising singleton /singletons/de.twc.oocom.comp.theSpringLoader

2008-07-15 Thread Tobias Krais
Hi together again,

 I created a singleton in Java but when trying to call it
 (theSpringLoader.get(xComponentContext)), I get following exception:
 -%-
 com.sun.star.uno.RuntimeException: no service object raising singleton
 /singletons/de.twc.oocom.comp.theSpringLoader
 -%-

 My singleton is stored in a Extension. How can I solve this problem?

I had to pass not only the singleton name to the
Factory.createComponentFactory method, but also the service name.

I had to change my __writeRegistryServiceInfo like this:
-%-
public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
try {
XRegistryKey newKey = regKey.createKey(
SpringLoaderImpl.class.getName() +
/UNO/SINGLETONS/ +
theSpringLoader.class.getName());
newKey.setStringValue(SpringLoaderImpl.__singeltonName);
} catch (InvalidRegistryException e) {
return false;
}

// NOTE: use the service Names!!!
boolean regSpring = FactoryHelper.writeRegistryServiceInfo(
SpringLoaderImpl.class.getName(),
SpringLoaderImpl.__serviceNames, regKey);

boolean regJudas = FactoryHelper.writeRegistryServiceInfo(
JudasProtocolHandler.class.getName(),
JudasProtocolHandler.SERVICENAME, regKey);
return regJudas  regSpring;
}
-%-

And my __getComponentFactory like this:
-%-
public static XSingleComponentFactory __getComponentFactory (String
implName) {
XSingleComponentFactory xSingleComponentFactory = null;

if (implName.equals(JudasProtocolHandler.class.getName())) {
xSingleComponentFactory =
Factory.createComponentFactory(
JudasProtocolHandler.class,
new String[]
{JudasProtocolHandler.SERVICENAME}
);
}
else if (implName.equals(SpringLoaderImpl.class.getName())) {
xSingleComponentFactory =
Factory.createComponentFactory(
SpringLoaderImpl.class,
SpringLoaderImpl.__serviceNames
);
}
return xSingleComponentFactory;
}
-%-

While __serviceNames is defined as:
-%-
public static final String[] __serviceNames = {
de.twc.oocom.comp.SpringLoaderImpl,
de.twc.oocom.comp.theSpringLoader};
-%-

Greetings, Tobias

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



RE: [api-dev] Loading Extension on startup of OpenOffice and use it later

2008-07-14 Thread Tobias Krais
Hi Daan,

 If the two interfaces have the same methods, why create two separate
 interfaces at all. The RegistrationClass (JudasComponent in your case)
 does not need to have an UNO interface, so you can also leave the
 JudasComponent idl files out (but if you want to define some extra
 methods on it, you'll need the idl files of course).

Good hint. I deleted the JudasComponent.idl file and it still works. Thanks!

I now changed my XSpringLoader.idl file like this:
-%-
#ifndef __de_twc_oocom_comp_xspringloader_idl__
#define __de_twc_oocom_comp_xspringloader_idl__

#include com/sun/star/uno/XWeak.idl
module de { module twc { module oocom { module comp {   

published interface XSpringLoader : com::sun::star::uno::XWeak {
void initSpring();
};

 }; }; }; };
#endif
-%-

 I would recommend to name your idl files according to the name of the
 interface / service / singleton that is defined in it. So I would rename
 the ild file containing the singleton to twcSpringLoader.idl (OOo
 convention is to use 'the' for singletons, so it would become
 theSpringLoader).

I did this already. You gave me the hint in your first mail. Thanks!
Now I have three idl files:
- XJudasComponent.idl
- XSpringLoader.idl
- theSpringLoader.idl

 According to this document:
 http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingU
 NO/Core_Interfaces_to_Implement it is recommended to implement the
 interface XTypeProvider, XServiceInfo and XWeak. Since XWeak extends the
 other interfaces (as well as XInterface) you can extend your interface
 from XWeak. There is also a helper class in Java called WeakBase that
 does implement all methods defined in those interfaces.

OK. I did this as you can see above.

 Creating an implementation in Java is nothing different from an
 implementation for an ordinary service:

I did this as you adviced me. Here my code:
-%-
package de.twc.oocom.comp;

import com.sun.star.lib.uno.helper.WeakBase;

public class SpringLoaderImpl extends WeakBase implements XSpringLoader {
public static final String __singeltonName =
de.twc.oocom.comp.theSpringLoader;

public static final String __serviceName =
de.twc.oocom.comp.SpringLoaderImpl;

public void initSpring() {
// TODO init Spring
}
}
-%-

 4. Store the singleton by adding the following code to
 __writeRegistryServiceInfo in you component registration class:

Here the changes in my __writeRegistryServiceInfo:
-%-
public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
try {
XRegistryKey newKey = regKey.createKey(
SpringLoaderImpl.class.getName() +
/UNO/SINGLETONS/ +
theSpringLoader.class.getName());
newKey.setStringValue(SpringLoaderImpl.__singeltonName);
} catch (InvalidRegistryException e) {
return false;
}

boolean regJudas = FactoryHelper.writeRegistryServiceInfo(
JudasProtocolHandler.class.getName(),
JudasProtocolHandler.SERVICENAME, regKey);
return regJudas;
}
-%-

 5. __getComponentFactory can be updated as you would do for an
 ordinary service (no special handling for singletons required)

[...]

 Is this correct?

 Yes, I think it is, but note that you need SpringLoaderImpl.class to
 refer the implementation that you created in Java, not to the singleton

After doing all these things, I still have the error no service object
raising singleton /singletons/de.twc.oocom.comp.theSpringLoader when
calling the singleton.

To sum up what I did:
- I have the three idl files in my component.
- I have the Java class SpringLoaderImpl as shown above.
- I completed the JudasComponent class with the code you adviced me.

I have no more ideas. Do you have any more idea?

Greetings, Tobias

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



[api-dev] Closing problem

2008-07-10 Thread Tobias Krais
Hi together,

I need some help regarding the following issue. May be it is stupid, but
please help anyway...

I have a Java application bootstrapping OOo and opening a document.
After opening the document, some additional stuff is done. Now I want to
wait, until the user closes the document. When the user closes the
document, I want OOo to leave an initialized UNO and do some other stuff.

How to do this? I added a close listener and thus I can catch the close
event. But how to prevent OOo from closing completely?

Can anyone help me?

Greetings, Tobias

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



[api-dev] com.sun.star.uno.RuntimeException: no service object raising singleton /singletons/de.twc.oocom.comp.theSpringLoader

2008-07-08 Thread Tobias Krais
Hi together,

I created a singleton in Java but when trying to call it
(theSpringLoader.get(xComponentContext)), I get following exception:
-%-
com.sun.star.uno.RuntimeException: no service object raising singleton
/singletons/de.twc.oocom.comp.theSpringLoader
-%-

My singleton is stored in a Extension. How can I solve this problem?

Please help the on this issue!

Greetings, Tobias

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



[api-dev] Using a self created Singleton (WAS: Loading Extension on startup of OpenOffice and use it later)

2008-07-03 Thread Tobias Krais
Hi together,

I changed the name of the thread, because I progressed a lot
implementing a singleton...

After implementing my singleton (see Steps below) I want to retrieve it
using the following Java code:
-%-
mySpringLoader.get(xComponentContext);
-%-
But I get an exception:
-%-
com.sun.star.uno.RuntimeException: no service object raising singleton
/singletons/de.twc.oocom.comp.mySpringLoader
at ...
-%-

What went wrong? Can you help me?

Here is the way, I created my singleton (thanks Daan de Wit for your
great help):

STEP 1. I created an IDL file for my UNO interface for my extension:
-%-
#ifndef __de_twc_oocom_comp_xspringloader_idl__
#define __de_twc_oocom_comp_xspringloader_idl__

#include com/sun/star/uno/XInterface.idl
module de { module twc { module oocom { module comp {   

published interface XSpringLoader : com::sun::star::uno::XInterface {
};

}; }; }; };
#endif
-%-

STEP 2. Then I defined my UNO singleton with the following IDL file:
-%-
#ifndef __de_twc_oocom_comp_myspringloader_idl__
#define __de_twc_oocom_comp_myspringloader_idl__

#include XSpringLoader.idl
module de { module twc { module oocom { module comp {   

published singleton mySpringLoader : XSpringLoader;

 }; }; }; };
#endif
-%-

STEP 3. I created a Java implementation of my singleton (very rudimentary):
-%-
package de.twc.oocom.comp;
public class SpringLoaderImpl implements XSpringLoader {

private static final SpringLoaderImpl INSTANCE =
new SpringLoaderImpl();

private SpringLoaderImpl() { }

public static final SpringLoaderImpl getInstance() {
return INSTANCE;
}

/**
 * The name of the singleton implemented.
 */
static final String SINGLETONNAME =
de.twc.oocom.comp.mySpringLoader;
}
-%-

STEP 4. I stored the singleton by adding the following code in my
__writeRegistryServiceInfo of my component registration class:
-%-
public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
try {
XRegistryKey newKey = regKey.createKey(
SpringLoaderImpl.class.getName() +
/UNO/SINGLETONS/ +
mySpringLoader.class.getName());

newKey.setStringValue(SpringLoaderImpl.SINGLETONNAME);

} catch (InvalidRegistryException e) {
return false;
}

// Registering my service implemented in the same component
boolean regJudas = FactoryHelper.writeRegistryServiceInfo(
JudasProtocolHandler.class.getName(),
JudasProtocolHandler.SERVICENAME, regKey);
return regJudas;
}
-%-

STEP 5. I changed my __getServiceFactory of my component registration
class. I am not sure if this step is correct. Daan adviced me the change
the method __getComponentFactory. But my component registration class
has no such method. Thus I used the __getServiceFactory. Can someone
tell me, if this is correct? Here is my code:
-%-
public static XSingleServiceFactory __getServiceFactory(String implName,
XMultiServiceFactory multiFactory, XRegistryKey regKey) {
XSingleServiceFactory xSingleServiceFactory = null;

if (implName.equals(JudasProtocolHandler.class.getName())) {
xSingleServiceFactory = FactoryHelper.getServiceFactory(
JudasProtocolHandler.class,
JudasProtocolHandler.SERVICENAME,
multiFactory,
regKey);
}
else if (implName.equals(SpringLoaderImpl.class.getName())) {
xSingleServiceFactory = FactoryHelper.getServiceFactory(
SpringLoaderImpl.class,
SpringLoaderImpl.SINGLETONNAME,
multiFactory,
regKey);
}
return xSingleServiceFactory;
}
--%--

STEP 6. I try to get my singelton this way:
-%-
mySpringLoader.get(xComponentContext);
-%-
Here, the failure described above happend. Can you help me solving this?

Thanks in advance!

Greeting, Tobias

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



Re: [api-dev] Supress warning dialog for saving sxw files

2008-07-01 Thread Tobias Krais
Hi Mathias,

 even if I'm a month too late: we also could define a new MediaDescriptor
 parameter (DisplayFormatWarning).

my five Cents: godd idea. Should I create an Issue?

Greetings, Tobias

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



Re: [api-dev] Supress warning dialog for saving sxw files

2008-07-01 Thread Tobias Krais
Hi Mathias,

 Thinking a bit more: you want to suppress this dialog even if the saving
 is done from the UI? Then the additional parameter won't help. I don't
 see a good fix for that.

Yes, I would like to... I would like to pass this PropertyValue to the
document I open via API. When Saving via API or UI, the warning dialog
should be supressed.

 OTOH if you are saving via API and see the dialog it is a bug and we
 don't need an additional parameter - just fix the bug. But does it
 happen by saving via API?

This message does not appear when saving via API.

Greetings, Tobias

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



Re: [api-dev] Loading Extension on startup of OpenOffice and use it later

2008-06-27 Thread Tobias Krais
Hi Daan,

for I am very new to singletons, please allow me some more questions.
May be some are silly, but I have a lack of knowledge...

 1. You first need to create an UNO interface for your extension (say
 XConnectionManager)

I have already created a UNO interface for my extension:
- XJudasComponent.idl and
- JudasComponent.idl

Now I add a new idl file named XSpringLoader.idl:
-%-
#ifndef __de_twc_oocom_comp_xspringloader_idl__
#define __de_twc_oocom_comp_xspringloader_idl__

#include com/sun/star/uno/XInterface.idl
module de { module twc { module oocom { module comp {   

interface XSpringLoader : com::sun::star::uno::XInterface {
published singleton twcSpringLoader : XSpringLoader;
};

 }; }; }; };
#endif
-%-
But my idlc compiler won't compile:
-%-
...XSpringLoader.idl(8) : error in lookup of symbol: 'published'
...XSpringLoader.idl(8) : Illegal syntax or missing identifier after
operation type: syntax error, unexpected IDL_SINGLETON, expecting
IDL_IDENTIFIER or IDL_GET or IDL_SET or IDL_PUBLISHED
-%-

 2. The UNO singleton is then defined as follows: 
   published singleton theConnectionManager : XConnectionManager;

What is incorrect in the above idl file?

 3. Implement the singleton by creating an implementation of the
 XConnectionManager interface, say ConnectionManagerImpl.

OK. This will look like this:
-%-
package de.twc.oocom.comp;

public class SpringLoaderImpl implements XSpringLoader {
//myCode
}
-%-

 4. Store the singleton by adding the following code to
 __writeRegistryServiceInfo in you component registration class:
   try {
   XRegistryKey newKey =
 xRegistryKey.createKey(ConnectionManagerImpl.class.getName() +
 /UNO/SINGLETONS/ + theConnectionManager.class.getName());
   
 newKey.setStringValue(de.krais.tobias.sample.theConnectionManager);
   } catch (InvalidRegistryException e) {
   return false;
   }

Should I add this code in the new class SpringLoaderImpl or in the class
JudasComponent, which im my main class for the extension?

 5. __getComponentFactory can be updated as you would do for an ordinary
 service (no special handling for singletons required)
 6. Now the singleton can be retrieved by calling
 theConnectionManager.get(componentContext)

I have to read about this...

Thanks a lot for your help! It boosts my task!

Greetings, Tobias

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



Re: [api-dev] Loading Extension on startup of OpenOffice and use it later

2008-06-27 Thread Tobias Krais
Hi Daan,

 for I am very new to singletons, please allow me some more questions.
 May be some are silly, but I have a lack of knowledge...
 
 Singletons definitely need more documentation, we found out how to
 register them by looking through the OOo rdb files...

I agree. I googled the whole web and there are no examples or any
guidance - out of you ;-)

 1. You first need to create an UNO interface for your extension (say
 XConnectionManager)
 I have already created a UNO interface for my extension:
 - XJudasComponent.idl and
 - JudasComponent.idl

 Now I add a new idl file named XSpringLoader.idl:

 My bad, didn't tell you that the singleton definition needs another idl
 file, so you get one idl file defining the interface, and another
 defining the singleton. Btw, likely you don't want the published keyword
 before the singleton definition as that means your interface needs to be
 published also.

If I need another idl file for the singleton, is it possible to reuse
the XJudasComponent.idl file instead of creating the XSpringLoader.idl
file? The contents of the files are very similar, except for the name.

My XSpringLoader.idl file now looks like this:
-%-
#ifndef __de_twc_oocom_comp_xspringloader_idl__
#define __de_twc_oocom_comp_xspringloader_idl__

#include com/sun/star/uno/XInterface.idl
module de { module twc { module oocom { module comp {   
interface XSpringLoader : com::sun::star::uno::XInterface {
};
 }; }; }; };
#endif
-%-
And my new SpringLoaderImpl.idl file looks like this:
-%-
#ifndef __de_twc_oocom_comp_springloaderimpl_idl__
#define __de_twc_oocom_comp_springloaderimpl_idl__

#include XSpringLoader.idl
module de { module twc { module oocom { module comp {   
singleton twcSpringLoader : XSpringLoader;
 }; }; }; };
#endif
-%-
Both compile like a charm :-)

 3. Implement the singleton by creating an implementation of the
 XConnectionManager interface, say ConnectionManagerImpl.

Do you have a code example you can share with me? Something like an
singleton class skeleton? This would help me a lot!

 4. Store the singleton by adding the following code to
 __writeRegistryServiceInfo in you component registration class:

 This code should be in the class that is registered in the MANIFEST.MF
 file in your jar as RegistrationClassName

OK. In my case this is the class JudasComponent. This method now looks
like this:
-%-
public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
try {
XRegistryKey newKey =
regKey.createKey(SpringLoaderImpl.class.getName() +
/UNO/SINGLETONS/ + twcSpringLoader.class.getName());
newKey.setStringValue(de.twc.oocom.comp.twcSpringLoader);
} catch (InvalidRegistryException e) {
return false;
}

boolean protocol = FactoryHelper.writeRegistryServiceInfo(
JudasProtocolHandler.class.getName(), SERVICENAME, regKey);
return protocol;
}
-%-

 5. __getComponentFactory can be updated as you would do for an
 ordinary
 service (no special handling for singletons required)

I have no __getComponentFactory method in my class, I only have a
__getServiceFactory(String, MultiServiceFactory, XRegistryKey). But I
think that won't make a difference. Here is the method:
-%-
public static XSingleServiceFactory __getServiceFactory (String
implName, XMultiServiceFactory multiFactory, XRegistryKey
regKey) {
XSingleServiceFactory xSingleServiceFactory = null;

if (implName.equals(JudasProtocolHandler.class.getName())) {
 xSingleServiceFactory = FactoryHelper.getServiceFactory(
JudasProtocolHandler.class,
SERVICENAME,
multiFactory,
regKey);
}
else if (implName.equals(SpringLoaderImpl.class.getName())) {
xSingleServiceFactory = FactoryHelper.getServiceFactory(
SpringLoaderImpl.class,
de.twc.oocom.comp.twcSpringLoader,
multiFactory,
regKey);
}
return xSingleServiceFactory;
}
-%-
Is this correct?

 6. Now the singleton can be retrieved by calling
 theConnectionManager.get(componentContext)
 I have to read about this...

I found an example for it.

Thanks again for your great help!

Greetings, Tobias

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



Re: [api-dev] Loading Extension on startup of OpenOffice and use it later

2008-06-26 Thread Tobias Krais
Hi Jürgen,

 I want to implement this and read the link. Thanks for the hints! Are
 there examples for implementing a job, or even an async job? I did not
 find one.

 maybe you should check the related example of the SDK

Thanks for the hint. I found an example for the Jobs here:
/usr/lib/openoffice/sdk/examples/DevelopersGuide/Components/Addons/JobsAddon/
In Ubuntu, I had to install the package openoffice.org-dev-doc.

I continue searching for a Singleton example.

Thanks  greetings, Tobias

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



Re: [api-dev] Loading Extension on startup of OpenOffice and use it later

2008-06-26 Thread Tobias Krais
Hi together,

 You'll need to register a job that is to be invoked on the 'OnStartApp'
 event, in this job you can create the connection, and than store it in a
 singleton service for later use.

I start OOo via API. Is it also possible to store the connection from
that code in a singelton and then use it later? In that case I won't
need a job.

Where can I find information about storing and reading a singleton?

Greetings, Tobias

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



[api-dev] Bootstrap and Performance

2008-06-26 Thread Tobias Krais
Hi together,

I have a question about the OOo bootstrap mechanism described in the Dev
Guide Wiki
(http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Java/Transparent_Use_of_Office_UNO_Components).
There is the possibility of setting the unopath parameter:
-%-
java
 -Dcom.sun.star.lib.loader.unopath=/opt/OpenOffice.org/program
 -jar SimpleBootstrap_java.jar
-%-

Thus my question: has using this parameter a very positive impact on
bootstrap performance? My machine seems to be too fast for testing this...

Greetings, Tobias

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



Re: [api-dev] Loading Extension on startup of OpenOffice and use it later

2008-06-24 Thread Tobias Krais
Hi together,

 You'll need to register a job that is to be invoked on the 'OnStartApp'
 event, in this job you can create the connection, and than store it in a
 singleton service for later use.
 
 Information about jobs can be found here:
 http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingU
 NO/Jobs/Jobs

I want to implement this and read the link. Thanks for the hints! Are
there examples for implementing a job, or even an async job? I did not
find one.

Greetings, Tobias

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



Re: [api-dev] Installing Extensions

2008-05-21 Thread Tobias Krais
Hi Fernand,

 Do not now  how some extensions are installed, but as a user i
 expierenced that having the Quikckstarter active,  
 sorry: DISables :-)
 
 enables the (re)instalation of some extensions but certenaly not all
 suffers from this problem

that is interesting that you seem to experience the same. Now I
implemented it this way. First I try to install it with the unopkg tool.
If this does not work, I try to install it using unpublished API. If
this also does not work, the same is repeated the next time OOo is
started unless the extension is installed. That seems to work...

Greetings, Tobias

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



Re: [api-dev] Java in Windows and OOo uses different Paper Tray names

2008-05-20 Thread Tobias Krais
Hi Andrew,

 I thought that the tray names were set in the PPD file (for post script
 printers anyway).
 
 For example, read page 101 of this document
 
 http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf

This means OOo seems to read it from the ppd. Won't be platform
independent in case I want to do it this way...

Thank you.

Greetings, Tobias

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



[api-dev] Java in Windows and OOo uses different Paper Tray names

2008-05-19 Thread Tobias Krais
Hi together,

at the moment I encounter a serious problem on Windows OS. I wrote a
little OOo dialogue allowing the user to print a document on a certain
tray of a printer. Now my Problem: for OOo does not offer an API to get
printer tray names, I use the API of Java. It returns me, for example
the Tray name Multi Purpose Feeder for a certain tray. OOo knows this
very tray, but it is named Multifunktionseinzug in the OOo print
dialogue. Thus OOo uses the German name and Java the English one. This
makes it impossible for me, to set a printer tray using OOo API. Here my
question:

1. Is anybody here on this list, encountering the same problem?

2. How does OOo retrieve the printer tray names? Maybe I can do it the
same way to get the tray names as OOo uses it.

3. Do you have any other hints how I can solve the problem?

I hope you have any suggestions on this issue!

Greetings, Tobias

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



Re: [api-dev] Java in Windows and OOo uses different Paper Tray names

2008-05-19 Thread Tobias Krais
Hi Cor,

 I have a Basic extension for the same job, but provide admins with a
 unhandy tool to copy/paste papertray names to an ini-file.

I thought about it. But it was mere a nightmare...

 What I do know: related issues are 87883 and 87495

Interesting. This would solve the issue. But in earlier mail discussions
about this theme, these themes were rejected.

Greetings, Tobias

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



[api-dev] Installing Extensions

2008-05-19 Thread Tobias Krais
Hi together,

I don't know, whether I am right in this list, please redirect me, if
necessary.

I have sometimes problems installing my OOo Extensions. Sometimes the
extension is not installed automatically. For fallback, I use two
mechanisms:
1. First I try to install via commandline:
/usr/lib/openoffice/program/unopkg add -f MyExtension.oxt
2. If this fails I try to install it via API.

My questions:
- Is it necessary (or better) to remove the installed component first
and then installing the new version?
- How do you solve the problem of distributing your extensions? How do
you ensure that it works?
- What can be reasons that updating the extension fails? Do I have to
close OOo first or anything like this?

Your comments are welcome!

Greetings, Tobias

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



Re: [api-dev] Java in Windows and OOo uses different Paper Tray names

2008-05-19 Thread Tobias Krais
Hallo Marc,

 Did you have a look at:
 
 $(user)/user/psprint/psprint.conf

This file does not exist here.

 $(inst)/share/psprint/psprint.conf

There is no tray information inside.

But thanks for the hint.

Greetings, Tobias

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



[api-dev] Supress warning dialog for saving sxw files

2008-05-19 Thread Tobias Krais
Hi together,

is it possible to supress the warning dialog when saving a sxw file? I
would like to supress the dialog via api (Java) for just this one dialog.

Any help is appreciated!

Greetings, Tobias

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



Re: [api-dev] Getting the path of the unopkg or soffice executable in java

2008-05-16 Thread Tobias Krais
Hi Cor,

 No Java-info from me.
 What I have in Basic might give a hint?
 
 sService = com.sun.star.deployment.PackageInformationProvider
 oPackageInfoProvider =
 GetDefaultContext.getValueByName(/singletons/ + sService)
 
 'you have to create an oxt with a description.xml and a unique
 identifier
 Dim sExtensionIdentifier$
 'change this with your extension's identifier
 sExtensionIdentifier = nl.nouenoff.xxx.oxt '
 org.openoffice.sdk.devguide.extensions.GenericOptionsPagesHandler
 
 Dim sPackageLocation$
 sPackageLocation =
 oPackageInfoProvider.getPackageLocation(sExtensionIdentifier)

this is a very interesting idea. I will look after it next week.

Greetings, Tobias

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



[api-dev] Getting the path of the unopkg or soffice executable in java

2008-05-15 Thread Tobias Krais
Hi together,

I need to get the path of the unopkg or soffice executable in Java. Is
there a platform independent way to get it? Does an API exist for it?

Thanks in advance!

Greetings, Tobias

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



Re: [api-dev] Getting the path of the unopkg or soffice executable in java

2008-05-15 Thread Tobias Krais
Hi Stephan,

thanks for these hints. Is there any way to do this with OOo 2.x?

Greetings, Tobias

Stephan Bergmann schrieb:
 Tobias Krais wrote:
 Hi together,

 I need to get the path of the unopkg or soffice executable in Java. Is
 there a platform independent way to get it? Does an API exist for it?
 
 In OOo 3, the bootstrap variable
 (http://wiki.services.openoffice.org/wiki/Uno/Binary/Spec/Bootstrapping)
 BRAND_BASE_DIR points to the base directory of the Brand Layer
 (http://wiki.services.openoffice.org/wiki/ODF_Toolkit/Efforts/Three-Layer_OOo),
 so expanding
 (http://api.openoffice.org/docs/common/ref/com/sun/star/util/MacroExpander.html)
 the string $BRAND_BASE_DIR/program should give a corresponding
 OOo-internal
 (http://api.openoffice.org/docs/common/ref/com/sun/star/uri/ExternalUriReferenceTranslator.html)
 file URL for the directory where unopkg and soffice are located, on all
 platforms.  However, whether unopkg is just unopkg or unopkg.com is
 platform dependent...
 
 -Stephan
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



[api-dev] How to supress the repair document dialogue?

2008-05-15 Thread Tobias Krais
Hi together,

I am opening documents using the API. Unfortunately, some documents seem
to be defect. Thus OOo wants to repair these documents on startup. How
can I automate this via API. The document should be repaired without
request and should not continue with a new file representant. Can anyone
tell me?

Greetings, Tobias

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



Re: [api-dev] Re: [Spam] Re: [api-dev] How to supress the repair document dialogue?

2008-05-15 Thread Tobias Krais
Hi Fernand,

 try by googling  Loading Documents - MediaDescriptor  RepairPackage

RepairPackage was the right Keyword:
http://api.openoffice.org/docs/common/ref/com/sun/star/document/MediaDescriptor.html

Adding the PropertyValue this way solved my problem:
// In case a document is defect
myProperties[1] = new PropertyValue();
myProperties[1].Name = RepairPackage;
myProperties[1].Value = true;

Greetings, Tobias

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



[api-dev] Adding a shortcut for a transient menu

2008-05-14 Thread Tobias Krais
Hi together,

I have a little application adding one transient menu to the main menu
bar. Is it possible to assign a keyboard shortcut (like Alt+?) for this
menu?

Thanks in advance!

Greetings, Tobias

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



Re: [api-dev] Adding a shortcut for a transient menu

2008-05-14 Thread Tobias Krais
Hi Carsten,

 Keyboard shortcuts starting with ALT are normally used to access the
 menu and menu items, e.g. ALT+F for file menu and afterwards ALT+O for
 open. These kind of shortcuts can be define by using '~' within the menu
 label (~Open). If you want to define a real keyboard shortcut (e.g.
 CTRL+O)  to directly access a function, that's not so easy. You have to
 use the UI configuration API to create a shortcut. Please be aware that
 the keyboard shortcut configuration doesn't support transient changes
 (the keyboard configuration is not frame based).

Thanks a lot for your help. This solved my issue!

Greetings, Tobias

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



Re: [api-dev] Naming a Toolbar Add-On

2008-04-07 Thread Tobias Krais
Hi Ariel,

 I've done a demo extension using the values you give here, and it DOES
 generate a toolbar with a custom name. I send it to your mail, check it
 and let me know if it works.

thank you for your great work. As the screenshot you sent me shows, it
works for you. But sadly not here. For I use Ubuntu, I think its a part
of this issue: https://bugs.launchpad.net/bugs/181700

Now I know that my code is correct and it helps me to implement it for
other systems!

Greetings, Tobias

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



Re: [api-dev] Naming a Toolbar Add-On

2008-04-07 Thread Tobias Krais
Hi Juergen,

 i don't know the exact state but from my point of view it is a bug or at
 least a missing feature that the title/name for a toolbar can't be
 defined in the addons.xcu where the toolbar itself is defined.

Same opinion. Should I file an issue?

Greetings, Tobias

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



Re: [api-dev] SystemShellExecute.execute(document) opens always Firefox in Linux

2008-04-07 Thread Tobias Krais
Hi together,

I filed an issue for this:
http://www.openoffice.org/issues/show_bug.cgi?id=87977

Greetings, Tobias

Tobias Krais schrieb:
 Hi Alexandro,
 
 thank you for your mail. Although it did not solve my problem, it was
 very interesting:
 
 - /usr/share/applications/defaults.list
 This file contains the applications which cause a double-click success.
 All Mime types will point to a desktop file.
 
 This file contains the line:
 -%-
 application/x-dia-diagram=dia-common.desktop
 -%-
 and is thus correct.
 
 - /usr/share/applications/[application_name].desktop
 This is the file where defaults.list will point to. One of the most
 important things inside this file is the entry MimeType=.
 
 The file dia-common.desktop exists and has correct information in it.
 
 - /usr/share/applications/mimeinfo.cache
 Contains information in similar form shown for file defaults.list in
 same directory. This file contains ALL associations given to a mime
 type. There is no need for a specified order of desktop files (see XMMS
 example lateron)
 
 This file again contains the line:
 -%-
 application/x-dia-diagram=dia-common.desktop
 -%-
 and is thus correct.
 
 - /usr/share/mime (Directory)
 This directory contains several information. The sub-directories -
 excluding packages - contain information about given mime types. You'll
 see that many mime types already exist.
 The packages directory contains the DATABASE calles freedesktop.org.xml!
 
 The corresponding file for Dia diagrams is
 /usr/share/mime/application/x-dia-diagram.xml exists and has correct
 contents.
 
 - /usr/share/mime/globs
 This file contains the file extensions, associated to the mime-types.
 
 Contains the line:
 -%-
 application/x-dia-diagram:*.dia
 -%-
 and is correct again.
 
 Nonetheless OpenOffice opens Firefox when trying to open a Dia diagram
 with the command SystemShellExecute.execute(document).
 
 But thanks for your hints. Has anybody some background information or
 should I file an issue?
 
 Greetings, Tobias
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



Re: [api-dev] Naming a Toolbar Add-On

2008-04-04 Thread Tobias Krais
Hi Ariel,

thank you for your help. I tested a lot but had no success...

First here the important part of the Addons.xcu:
-%-
?xml version='1.0' encoding='UTF-8'?
oor:component-data oor:name=Addons oor:package=org.openoffice.Office
xmlns:oor=http://openoffice.org/2001/registry;
xmlns:xs=http://www.w3.org/2001/XMLSchema;
node oor:name=AddonUI
node oor:name=OfficeToolBar
node oor:name=de.twc.oocom.comp oor:op=replace
node oor:name=m1 oor:op=replace
prop oor:name=URL oor:type=xs:string
value.Judas:Saveto/value
/prop
...
-%

 you have to create an OOoModuleNameWindowState.xcu configuration file
 and set the UIName property.

And here my complete WriterWindowsState.xcu file:
-%-
?xml version=1.0 encoding=UTF-8?
oor:component-data xmlns:oor=http://openoffice.org/2001/registry;
xmlns:xs=http://www.w3.org/2001/XMLSchema;
oor:name=WriterWindowState
oor:package=org.openoffice.Office.UI
node oor:name=UIElements
node oor:name=States
node
oor:name=private:resource/toolbar/addon_de.twc.oocom.comp 
oor:op=replace
prop oor:name=UIName oor:type=xs:string
valueJudas Toolbar/value
value xml:lang=deJudas Toolbar/value
/prop
/node
/node
/node
/oor:component-data
-%-

 This file must have an entry in the extension manifest, for example


Here my manifest.xml:
-%
?xml version=1.0 encoding=UTF-8?
!DOCTYPE manifest:manifest PUBLIC -//OpenOffice.org//DTD Manifest
1.0//EN Manifest.dtd
manifest:manifest xmlns:manifest=http://openoffice.org/2001/manifest;
manifest:file-entry
manifest:media-type=application/vnd.sun.star.uno-typelibrary;type=RDB
manifest:full-path=types.rdb/
manifest:file-entry
manifest:media-type=application/vnd.sun.star.uno-component;type=Java
manifest:full-path=JudasComponent.uno.jar/
manifest:file-entry
manifest:media-type=application/vnd.sun.star.configuration-data
manifest:full-path=Addons.xcu/
manifest:file-entry
manifest:media-type=application/vnd.sun.star.configuration-data
manifest:full-path=ProtocolHandler.xcu/
manifest:file-entry
manifest:media-type=application/vnd.sun.star.configuration-data
   manifest:full-path=WriterWindowState.xcu/
/manifest:manifest
-%-

Adding the WriterWindowState.xcu as you snt me added an additional
toolbar with no contents. Thus it seems the WriterWindowState.xcu seems
to be detected correctly. Changing the value node
oor:name=private:resource/toolbar/addon_de.twc.oocom.comp
oor:op=replace removes the new toolbar. Thus it seems the value is
also detected, but my toolbar is still named Addon 1.

Very helpful was also a link I found:
http://www.mail-archive.com/dev@api.openoffice.org/msg03055.html
It is the same as you wrote, but it did not help anyway.

Greetings, Tobias

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



[api-dev] Naming a Toolbar Add-On

2008-03-31 Thread Tobias Krais
Hi together,

I am creating a toolbar Add-On for OOo. Everything works perfect. Now I
would like to name the Toolbar itself. Currently it is named by OOo
Add-On 1. Can I rename it?

Here is my Addon.xcu:
-%-
?xml version='1.0' encoding='UTF-8'?
oor:component-data oor:name=Addons oor:package=org.openoffice.Office
xmlns:oor=http://openoffice.org/2001/registry;
xmlns:xs=http://www.w3.org/2001/XMLSchema;

node oor:name=AddonUI
node oor:name=OfficeToolBar
node oor:name=de.twc.oocom.comp oor:op=replace
prop oor:name=Title oor:type=xs:string
valueJudas Add-On/value
/prop
node oor:name=m0 oor:op=replace
prop oor:name=URL oor:typexs:string
value.Judas:Saveto/value
/prop
prop oor:name=Title 
oor:type=xs:string
value 
xml:lang=deSicherheitskopie erstellen/value
/prop
prop oor:name=ImageIdentifier 
oor:type=xs:string

value%origin%/images/JudasSaveto/value
/prop
prop oor:name=Target 
oor:type=xs:string
  value_self/value
/prop
prop oor:name=Context 
oor:type=xs:string
  value /
/prop
/node
node oor:name=m1 oor:op=replace
prop oor:name=URL 
oor:type=xs:string
value.Judas:PrintTrays/value
/prop
prop oor:name=Title 
oor:type=xs:string
value xml:lang=deErste 
Seite auf Briefpapier drucken/value
/prop
prop oor:name=ImageIdentifier 
oor:type=xs:string

value%origin%/images/JudasPrintTrays/value
/prop
prop oor:name=Target 
oor:type=xs:string
  value_self/value
/prop
prop oor:name=Context 
oor:type=xs:string
  value /
/prop
/node
/node
/node

/node
/oor:component-data

!-- End of file --
-%-

Greetings, Tobias

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



Re: [api-dev] SystemShellExecute.execute(document) opens always Firefox in Linux

2008-03-20 Thread Tobias Krais
Hi Alexandro,

thank you for your mail. Although it did not solve my problem, it was
very interesting:

 - /usr/share/applications/defaults.list
 This file contains the applications which cause a double-click success.
 All Mime types will point to a desktop file.

This file contains the line:
-%-
application/x-dia-diagram=dia-common.desktop
-%-
and is thus correct.

 - /usr/share/applications/[application_name].desktop
 This is the file where defaults.list will point to. One of the most
 important things inside this file is the entry MimeType=.

The file dia-common.desktop exists and has correct information in it.

 - /usr/share/applications/mimeinfo.cache
 Contains information in similar form shown for file defaults.list in
 same directory. This file contains ALL associations given to a mime
 type. There is no need for a specified order of desktop files (see XMMS
 example lateron)

This file again contains the line:
-%-
application/x-dia-diagram=dia-common.desktop
-%-
and is thus correct.

 - /usr/share/mime (Directory)
 This directory contains several information. The sub-directories -
 excluding packages - contain information about given mime types. You'll
 see that many mime types already exist.
 The packages directory contains the DATABASE calles freedesktop.org.xml!

The corresponding file for Dia diagrams is
/usr/share/mime/application/x-dia-diagram.xml exists and has correct
contents.

 - /usr/share/mime/globs
 This file contains the file extensions, associated to the mime-types.

Contains the line:
-%-
application/x-dia-diagram:*.dia
-%-
and is correct again.

Nonetheless OpenOffice opens Firefox when trying to open a Dia diagram
with the command SystemShellExecute.execute(document).

But thanks for your hints. Has anybody some background information or
should I file an issue?

Greetings, Tobias

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



Re: [api-dev] SystemShellExecute.execute(document) opens always Firefox in Linux

2008-03-07 Thread Tobias Krais
Hi Alexandro,

 Check your enviromental variables or your gnome variables. Usually there
 is a default app that will open for whatever format it doesnt have
 register. mine is mplayer. Changing that value or registering odf on ur
 system might change the behavior.

I checked it and the applications are registered correctly. But OOo
still opens all documents with firefox. Where exactly should I correct
the gnome variables?

Can someone tell me, where OOo looks up the application for opening the
document?

Greetings, Tobias

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



Re: [api-dev] SystemShellExecute.execute(document) opens always Firefox in Linux

2008-02-29 Thread Tobias Krais
Hi Matthias,

thanks for your reply.

 I want to use the SystemShellExecute.execute method to open Documents
 that OOo can not open. Giving the file location as the parameter
 aCommand opens the document with the default application in Windows. In
 Linux my Firefox is opened, which again opens the default application.
 Is there a way to tell the execute method to open the document directly?

 Why is it implemented to use the default browser? Can someone tell me
 the backgrounds?
 
 Please have a look at issue 84718 - it could be the same problem.

I don't think it's the same problem. I don't use parameters.

Greetings, Tobias

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



Re: [api-dev] xStorable.getLocation() return old MS-DOS style path - How to solve?

2008-02-28 Thread Tobias Krais
Hi together,

 I have a litte application and need to know the full path of the current
 document. Thus I use the XStorable interface. Using the
 xStorable.getLocation() method returns on a Windows XP system (using OOo
 2.3): file:/F:/DOKUME1/Tobias/EIGENE1/...
 Correct would be: file:/F:/Dokumente und Einstellungen/Tobias/Eigene
 Dateien/...
 Is there a way to get the REAL full path of the document?

I found the reason for the old style path: the application opening the
document calls OOo with an old style path. OOo then returns the old
style path. Calling OOo with an new style path will return the new style
one.

My question: should OOo not always return the new style path name?

Greetings, Tobias

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



Re: [api-dev] xStorable.getLocation() return old MS-DOS style path - How to solve?

2008-02-22 Thread Tobias Krais
Hi togehter,

thanks for your answers. I will reply soon. Currently I have an other
severe failure...

Greetings, Tobais

Tobias Krais schrieb:
 Hi together,
 
 I have a litte application and need to know the full path of the current
 document. Thus I use the XStorable interface. Using the
 xStorable.getLocation() method returns on a Windows XP system (using OOo
 2.3): file:/F:/DOKUME1/Tobias/EIGENE1/...
 Correct would be: file:/F:/Dokumente und Einstellungen/Tobias/Eigene
 Dateien/...
 Is there a way to get the REAL full path of the document?
 
 Please help!
 
 Greetings, Tobias
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



Re: [api-dev] Hiding buttons from a toolbar

2008-02-22 Thread Tobias Krais
Hi unknown name,

 I used you code for hide the Save button, now I need to understand which is
 the better way:
 a) hide the save, save as, print and export buttons and menu items
 b) intercept the events

we chose a). Here the snippet in Java:
http://codesnippets.services.openoffice.org/Office/Office.RemoveIterativeAndTransientMenubarItems.snip

Greetings, Tobias

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



Re: [api-dev] Removing Extension crashed OOo

2008-02-19 Thread Tobias Krais
Hi Stephan.

 Against which project should I file the issue?
 
 The Extension Manager is in the desktop module, part of the Framework
 project.  (You can assign the issue directly to jl, he will happily look
 into it...)

Done: http://www.openoffice.org/issues/show_bug.cgi?id=86220

Greetings, Tobias

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



[api-dev] xStorable.getLocation() return old MS-DOS style path - How to solve?

2008-02-19 Thread Tobias Krais
Hi together,

I have a litte application and need to know the full path of the current
document. Thus I use the XStorable interface. Using the
xStorable.getLocation() method returns on a Windows XP system (using OOo
2.3): file:/F:/DOKUME1/Tobias/EIGENE1/...
Correct would be: file:/F:/Dokumente und Einstellungen/Tobias/Eigene
Dateien/...
Is there a way to get the REAL full path of the document?

Please help!

Greetings, Tobias

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



[api-dev] Menu refreshes often and deadlocks OOo

2008-02-19 Thread Tobias Krais
Hi Carsten,

I think this is a special thing for you... I have an application adding
a transient menu to the menubar. This  works very like a charm on all
systems, out of one: its an Ubuntu Gutsy 32bit (OOo 2.3): the menu
refreshes several times and produces often a deadlock! The menu refresh
is extremly slow, it first adds the Datei menu, then the Bearbeiten
menu... Just before the deadlock happens, one of the toolbars
substitudes all icons with the titles.

This happened on the Ubuntu OOo. For I know that Ubuntu OOo is compiled
against GCJ Java and thus has several failures, I installed the Comunity
OOo deb packages (OOo 2.3.1) from the OpenOffice website. The deadlock
disappears. But the menus are updated again extremely slow and again,
several times.

Can you tell me why the menus are updated several times at OOo startup
and why this is extremely slow?

Greetings, Tobias

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



[api-dev] Removing Extension crashed OOo

2008-02-14 Thread Tobias Krais
Hi together,

I wanted to remove an OOo Extension I wrote and I always get the
following memory dump. I even cannot start OOo. Only removing my
.openoffice.org2/user/uno_packages/ folder solves the problem.

Is this a bug?

Greetings, Tobias

-%-
sudo /usr/lib/openoffice/program/unopkg -remove JudasComponent.oxt
*** glibc detected *** /usr/lib/openoffice/program/unopkg.bin:
free(): invalid pointer: 0x080837c0 ***
=== Backtrace: =
/lib/i686/cmov/libc.so.6[0xb72b9915]
/lib/i686/cmov/libc.so.6(cfree+0x90)[0xb72bd380]
/usr/lib/openoffice/program/libuno_sal.so.3(rtl_freeMemory+0x1d)[0xb7e207ad]
/usr/lib/openoffice/program/unopkg.bin[0x805c1ae]
/usr/lib/openoffice/program/unopkg.bin(_ZdlPv+0x26)[0x805c1e6]
/usr/lib/openoffice/program/libstore.so.3[0xb59de905]
/usr/lib/openoffice/program/libstore.so.3[0xb59d51fa]
/usr/lib/openoffice/program/libstore.so.3(store_openDirectory+0xfd)[0xb59e70fd]
/usr/lib/openoffice/program/libreg.so.3[0xb59f44cb]
/usr/lib/openoffice/program/libreg.so.3[0xb59f5620]
/usr/lib/openoffice/program/libreg.so.3[0xb59f7cfc]
/usr/lib/openoffice/program/libreg.so.3[0xb59ff202]
/usr/lib/openoffice/program/libreg.so.3[0xb59fd023]
/usr/lib/openoffice/program/simplereg.uno.so[0xb5971e84]
/usr/lib/openoffice/program/nestedreg.uno.so[0xb5961b3a]
/usr/lib/openoffice/program/nestedreg.uno.so[0xb5961e23]
/usr/lib/openoffice/program/nestedreg.uno.so[0xb5961b3a]
/usr/lib/openoffice/program/nestedreg.uno.so[0xb5961e23]
/usr/lib/openoffice/program/nestedreg.uno.so[0xb5961b3a]
/usr/lib/openoffice/program/nestedreg.uno.so[0xb5961e23]
/usr/lib/openoffice/program/nestedreg.uno.so[0xb5961b3a]
/usr/lib/openoffice/program/nestedreg.uno.so[0xb59646b3]
/usr/lib/openoffice/program/libuno_cppuhelpergcc3.so.3[0xb7d247bc]
/usr/lib/openoffice/program/libuno_cppuhelpergcc3.so.3[0xb7d41dd6]
/usr/lib/openoffice/program/libuno_cppuhelpergcc3.so.3(_ZN4cppu40defaultBootstrap_InitialComponentContextEv+0x29)[0xb7d425e9]
/usr/lib/openoffice/program/unopkg.bin[0x8051af7]
/usr/lib/openoffice/program/unopkg.bin(_ZN6unopkg6getUNOERNS_12DisposeGuardEbb+0x47)[0x8052257]
/usr/lib/openoffice/program/unopkg.bin(main+0x5ff)[0x8057e4f]
/lib/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0xb7264450]
/usr/lib/openoffice/program/unopkg.bin(_ZN6Window15SetPosSizePixelEt+0x1b1)[0x8050261]
=== Memory map: 
08048000-0806 r-xp  08:01 544192
/usr/lib/openoffice/program/unopkg.bin
0806-08061000 rw-p 00017000 08:01 544192
/usr/lib/openoffice/program/unopkg.bin
08061000-080a3000 rw-p 08061000 00:00 0  [heap]
b500-b5021000 rw-p b500 00:00 0
b5021000-b510 ---p b5021000 00:00 0
b51e5000-b5435000 r--s  08:01 544200
/usr/lib/openoffice/program/services.rdb
b5435000-b5436000 r--s  08:01 246075
/var/spool/openoffice/uno_packages/cache/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/Linux_x86_.rdb
b5436000-b543a000 r--s  08:01 246056
/var/spool/openoffice/uno_packages/cache/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/common_.rdb
b543a000-b543b000 r--s  08:01 1599718
/home/thorsten/.openoffice.org2/user/uno_packages/cache/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/Linux_x86_.rdb
b543b000-b5443000 r--s  08:01 1599564
/home/thorsten/.openoffice.org2/user/uno_packages/cache/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/common_.rdb
b5443000-b57e3000 r--s  08:01 544199
/usr/lib/openoffice/program/types.rdb
b57e3000-b5903000 r--s  08:01 544178
/usr/lib/openoffice/program/oovbaapi.rdb
b5903000-b591e000 r-xp  08:01 544728
/usr/lib/openoffice/program/security.uno.so
b591e000-b591f000 rw-p 0001b000 08:01 544728
/usr/lib/openoffice/program/security.uno.so
b591f000-b5932000 r-xp  08:01 544696
/usr/lib/openoffice/program/implreg.uno.so
b5932000-b5933000 rw-p 00013000 08:01 544696
/usr/lib/openoffice/program/implreg.uno.so
b5933000-b5959000 r-xp  08:01 544738
/usr/lib/openoffice/program/typemgr.uno.so
b5959000-b595b000 rw-p 00025000 08:01 544738
/usr/lib/openoffice/program/typemgr.uno.so
b595b000-b596a000 r-xp  08:01 544671
/usr/lib/openoffice/program/nestedreg.uno.so
b596a000-b596b000 rw-p e000 08:01 544671
/usr/lib/openoffice/program/nestedreg.uno.so
b596b000-b597b000 r-xp  08:01 544729
/usr/lib/openoffice/program/simplereg.uno.so
b597b000-b597c000 rw-p f000 08:01 544729
/usr/lib/openoffice/program/simplereg.uno.so
b597c000-b5981000 r-xp  08:01 544667
/usr/lib/openoffice/program/shlibloader.uno.so
b5981000-b5982000 rw-p 5000 08:01 544667
/usr/lib/openoffice/program/shlibloader.uno.so
b5982000-b59b2000 rw-p b5982000 00:00 0
b59b2000-b59d r-xp  08:01 544730
/usr/lib/openoffice/program/servicemgr.uno.so
b59d-b59d2000 rw-p 0001d000 08:01 544730
/usr/lib/openoffice/program/servicemgr.uno.so
b59d2000-b59ed000 r-xp  08:01 544733
/usr/lib/openoffice/program/libstore.so.3

Re: [api-dev] Removing Extension crashed OOo

2008-02-14 Thread Tobias Krais
Hi Stephan,

 Is this a bug?
 
 Yes, looks like a bug.  I would suggest you file an issue, ideally
 containing your extension for reproduction.

The extension caused the crash just in combination with a certain user
profile. Should I add the extension anyway?

Against which project should I file the issue?

Greetings, Tobias

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



Re: [api-dev] New intermediate version 1.1.1 of the OpenOffice.org API plugin available

2008-02-12 Thread Tobias Krais
Hi Wouter,

 Installation goes like a charm, building my first client app with it too.
 Running the app from within NetBeans doesn't work (no office executable 
 found)
 despite the plugin settings under Tools-Options-Misc. Running the jar with
 java -jar goes ok again.
 
 Is the behaviour with not able to run from within NetBeans expected or would 
 you
 like me to file a bug?

Please tell me which Linux distribution and version you use. This bug
seems to be the same we discussed last week.

Greetings, Tobias

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



Re: [api-dev] Error message trying to bootstrap OpenOffcie

2008-02-08 Thread Tobias Krais
Hi Wouter,

 Sorry to bother you again. I haven't created many jars outisde IDEs...

I don't mind. Thats the purpose of mailing lists...

 -
 Main-Class: com.sun.star.lib.loader.Loader
 
 Name: com/sun/star/lib/loader/Locader.class
 Application-Class: nl.reeven.van.test.ooo.MyOOoBootstrapper
 
 Application-Name: nl/reeven/van/test/ooo/MyOOoBootstrapper.class
 
 -
 The error message disappears when I remove the blank lines. Can you tell me 
 how
 you create the jar file?

Sure. I use Eclipse. I created manually the manifest and use the Eclipse
jar packager. Thats it and the output works.

Your mail does not tell me if you can successfully create jars. If not,
try using my manifest file, just changing the Application-Class.

Greetings, Tobias

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



Re: [api-dev] Error message trying to bootstrap OpenOffcie

2008-02-08 Thread Tobias Krais
Hi Wouter,

 Well, I use NetBeans 6.0 and it's kinda hard to change the default manifest 
 file
 that is being generated by NetBeans. So what I have done so far is to let
 NetBeans create the jar, then unpack it, copy over all the com and win classes
 from the SDK, put in a custom manifest file and recreate the jar. This all 
 works
 fine when I don't have blank lines in the custom manifest file. Whenever I put
 blank lines in the manifest file and try to create the jar, I get the error
 message I sent yesterday.

OK. NB is not my business. I suggest to join the NB Mailing list and
discuss the feature / bug and in case file an issue.

Greetings, Tobias

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



Re: [api-dev] Using Loader with windows does not work

2008-02-08 Thread Tobias Krais
Hi Christian,

 does this code snippet on 
 http://codesnippets.services.openoffice.org/Office/Office.BootstrapOpenOffice.snip
  
 only work with the OO-sdk installed? 

No.

Greetings, Tobias

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



Re: [api-dev] Using Loader with windows does not work

2008-02-08 Thread Tobias Krais
Hi Christian,

 When I try to use the jar-file on windows it says:
 
 C:\java -jar Test.jar
 Exception in thread main java.lang.UnsatisfiedLinkError: no unowinreg in
 java.library.path
 
 The unowinreg.dll is within the jar in the project folder, so the location 
 is /blub/unowinreg.dll. Does it have to be in another folder? Somewhere 
 win/unowinreg.dll maybe?

As described on the snippet page, it has to be in win/unowinreg.dll

Greetings and good luck,

Tobias

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



Re: [api-dev] Using Loader with windows does not work

2008-02-07 Thread Tobias Krais
Hi Christian,

 Can anyone help me how to solve this problem? Can I just somehow include this 
 unowinreg.dll somewhere within the program or is there another way to work 
 this out?

try following the instructions of this OOo Snippet:
http://codesnippets.services.openoffice.org/Office/Office.BootstrapOpenOffice.snip

If you need the unowinreg.dll file, you can find it here:
http://tools.openoffice.org/unowinreg_prebuild/680/

Greetings, Tobias

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



[api-dev] Enabling a XButton

2008-02-07 Thread Tobias Krais
Hi together,

I use Java and I created a dialog with a disabled XButton. Because of
some user interaction I now want to enable this button. But I don't know
how to do this. Can somebody help me?

Greetings, Tobias

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



Re: [api-dev] Enabling a XButton

2008-02-07 Thread Tobias Krais
Hi again,

 I use Java and I created a dialog with a disabled XButton. Because of
 some user interaction I now want to enable this button. But I don't know
 how to do this. Can somebody help me?

I found a solution:
-%-
XControlContainer xControlCont = ...;

Object objectEditButton = xControlCont.getControl(ButtonName);

XButton xEditButton = (XButton) UnoRuntime.queryInterface(
XButton.class, objectEditButton);

XControl xEditControl = (XControl) UnoRuntime.queryInterface(
XControl.class, xEditButton);

XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xEditControl.getModel());

try {
if (xPSet.getPropertySetInfo().hasPropertyByName(Enabled))
xPSet.setPropertyValue(Enabled, true);
} catch (Exception exception) {
exception.printStackTrace(System.out);
}
-%-

Greetings, Tobias

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



  1   2   3   4   >