Re: [dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(

2008-11-24 Thread Mathias Bauer
Marten Feldtmann wrote:

 I did some tests with that API call and whatever I do: the document is 
 always opened readOnly.
 
 - when I open the document using OpenOffice 3.0 via dialog, the document 
 opens the normal way: writeable
 - when using the API call I always get a write protected document
 - when I use the property ReadOnly and do set it to true I get a write 
 protected document (thats ok ...)
 - when I use the property ReadOnly and do set it to false I get a 
 VT_UNKNOWN value from the loadComponentFromURL call.
 
 Then I thought, that perhaps the parameter handling was wrong and 
 created an empty document (via factory) and used the attribute Hidden 
 and that work well. Therefore I think, that my parameter handling seems 
 to be correct.
 
 Any idea ???

It would perhaps help if you posted a code snippet showing the
parameters you use and the call itself. Besides that the only idea I
have is that the document might be open already.

Regards,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to [EMAIL PROTECTED].
I use it for the OOo lists and only rarely read other mails sent to it.


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



Re: [dev] Re: Adding an Instant Messenger to open office as a component or extension into the installer

2008-11-24 Thread Mathias Bauer
Hi Max,

M. Peterson wrote:

 Hello Mathias,
 
 thanks for the feedback. I personally want to see the users of course using
 this messenger.
 So we are interested to ship it with the OOo installer.

I understand that though I hesitate to recommend this to our release
team. The reason is that we try to avoid to enlarge our installation set
even more. Things that only a small majority of our users might want to
user should be provided as an extension - that was the number one reason
why we created the extension concept.

 Do you need SVN access to RetroMessenger SVN? want to change some code so
 that it better integrated into the OOo environment, gui api and code? Then
 tell me your sf.net ID and as well if you like to be added to our internal
 non public dev mailinglist for commits and ideas.

Honestly speaking ;-), my idea was that I can help you writing the code
to integrate into OOo yourself. As I assume, your messenger is an
application, so the easiest way to integrate it is writing some Basic
code to start the application and then provide the necessary
configuration file to add the macros to the OOo menu bar (or a tool bar).

If you want to integrate both applications (e.g. by accessing OOo
documents or part of it from inside the messenger), you have to do more.

Regards,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to [EMAIL PROTECTED].
I use it for the OOo lists and only rarely read other mails sent to it.


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



[dev] Contribution for OO.o

2008-11-24 Thread Svatopluk Bláha
Halo,
in my OO.o Base project I need to save into associated table a computed value, 
which was described in form numeric field. But this value is not shift into 
table by using icon in navigation bar, nor by push button with form refresh 
action, nor by macro using executeDispatch  service with statements  
.uno:RecSave and .uno.NewRecord, nor by SQL statement. But may be I did not 
find correct way how to do it. And Now:
1. Can you help me with this problem?
2. If his probem cannot be realized by actual OO.o Base  tools (as it is 
possible in database applications DB, Paradox, MS Access), I would like to try 
develop appropriate tool for OO.o Base or correct another current one.  In that 
case I would need help where to start. I be able to write code in OO.o Basic, 
Java and Java Script.
Svatopluk Bláha



[dev] Need Help with Listeners

2008-11-24 Thread [EMAIL PROTECTED]

Hello , 

I am trying to create a project doing the following 

1. First of all i am creating a menu dynamically - My menu consists of Menus
and Submenus
2. My goal is to catch an event when my new menu is clicked and then to add
code so as to print the menu Name in the document

BUT MY PROBLEM IS THAT IT NEVER GOES IN THE EVENTLISTENER!!! :-(

Here is my code
/

Code:
public class CreateMenu  {
   
private ArrayListString iuo_arraymenu;
private String[][] is_menus;
private XComponent xCurrentComponent;
private XMultiComponentFactory mxRemoteServiceManager = null;
private XComponentContext mxRemoteContext = null;
   
private XLayoutManager xLayoutManager =null;
private XModuleUIConfigurationManagerSupplier xCmSupplier = null;
private XUIConfigurationManager uiConfigManager = null;
private XIndexContainer oMenuBarSettings = null;
private XUIElementSettings xoMenuBarSettings = null;
private XIndexContainer[] oContainer = null;
   
private PropertyValue[] oMenuOTS= null;
   
private XIndexAccess settings;
   
String sMenuBar = private:resource/menubar/menubar;

public CreateMenu(ArrayListString iuo_arraymenu,
XComponent xCurrentComponent , 
XMultiComponentFactory mxRemoteServiceManager,
XComponentContext mxRemoteContext)
throws Exception {
   
this.iuo_arraymenu = iuo_arraymenu;
this.xCurrentComponent = xCurrentComponent;
this.mxRemoteServiceManager = mxRemoteServiceManager;
this.mxRemoteContext = mxRemoteContext;
this.ConvertArrayListToArray();
this.initialize();
this.createMenuMain();
this.getTopMenu();
oMenuMain[2].Name = ItemDescriptorContainer;
oMenuMain[2].Value = oContainer[0];
oMenuBarSettings.insertByIndex( oMenuBarSettings.getCount(),
oMenuMain);
xoMenuBarSettings.setSettings(oMenuBarSettings);
   
   
   
}

public void initialize() throws
WrappedTargetException,
UnknownPropertyException,
Exception{
   
XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class,
xCurrentComponent);
 
XController xController = xModel.getCurrentController();
XFrame xFrame = xController.getFrame();
xFrame.addEventListener(new com.sun.star.document.XEventListener() {

public void notifyEvent(com.sun.star.document.EventObject arg0)
{
System.out.print(IT NEVER GETS HERE);
}

public void disposing(EventObject arg0) {
System.out.print(IT NEVER GETS HERE);
}
});
   
XPropertySet xps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xFrame);
xLayoutManager = (XLayoutManager) UnoRuntime.queryInterface(
XLayoutManager.class,
xps.getPropertyValue(LayoutManager));
xCmSupplier = (XModuleUIConfigurationManagerSupplier) UnoRuntime.
  queryInterface(XModuleUIConfigurationManagerSupplier.class,
 
mxRemoteServiceManager.createInstanceWithContext(com.sun.star.ui.ModuleUIConfigurationManagerSupplier,mxRemoteContext));
uiConfigManager =
xCmSupplier.getUIConfigurationManager(com.sun.star.text.TextDocument);
oContainer = new XIndexContainer[this.getMenuContextSum()];
oContainer[0] = uiConfigManager.createSettings();
}
   
public int getMenuContextSum(){
   
int ll_sum = 0;
   
for (int i=0;iis_menus.length;i++ ){
if (is_menus[i][3].equals(0)) {
ll_sum= ll_sum + 1;
}
}
return ll_sum + 1;
   
}
   
public void createMenuMAIN() throws
NoSuchElementException,
IllegalArgumentException,
UnknownPropertyException,
PropertyVetoException,
WrappedTargetException,
IndexOutOfBoundsException{
   
settings = uiConfigManager.getSettings(sMenuBar, true);

// 2. init menu elements
XUIElement oMenuBar = xLayoutManager.getElement(sMenuBar);
XPropertySet props = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, oMenuBar);
props.setPropertyValue(Persistent, new Boolean(true));
xoMenuBarSettings = (XUIElementSettings) UnoRuntime
.queryInterface(XUIElementSettings.class, oMenuBar);
oMenuBarSettings = (XIndexContainer) UnoRuntime
.queryInterface(XIndexContainer.class, xoMenuBarSettings
.getSettings(true));

oMenuMAIN = createMenuOption(.uno:PickList, Main);
   
}
   
 public void ConvertArrayListToArray(){
int i , j;
   
if (!this.iuo_arraymenu.isEmpty()){
j=0;
is_menus = new  

[dev] File lock problem

2008-11-24 Thread Jakob Lechner
Hello,

We're using OOo for one of our products (Fabasoft Folio).
Folio is a document management system where documents of different types
can be stored. When editing a document, the document is copied to a
temporary directory and the appropriate application is started. If the
document is closed, the file is transfered back from the temporary
directory to the document store. In order to find out whether a document
is still in use, our application checks the file lock.

If an Excel file opened with OOo is saved, the file lock seems to be
removed during the save/conversion operation (this can take a long time
– depending on the file size). After the file has been saved the lock is
re-established. Unfortunately the intermediate removal of the file lock
can trigger our application too soon.

Does anybody know why the file lock is released during the saving
procedure? Is this a bug or intended (necessary) behaviour?

Any ideas how we can overcome/workaround this problem?

I've been told that OOo 3.0 creates special lock-files for opened
documents. Unfortunately this doesn't seem to be done for MS Office
documents. Why?

Thanks in advance!

Best regards
Jakob Lechner

-- 
Jakob Lechner
Research  Development
appl.strudl Software GmbH
Honauerstraße 4
A-4020 Linz
Tel.: [+43] (70) 60 61 62
Fax: [+43] (70) 60 61 62-609
E-Mail: [EMAIL PROTECTED]
Web: http://www.applstrudl.com
Handelsgericht Linz, FN 303988 t

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



Re: [dev] Need Help with Listeners

2008-11-24 Thread Carsten Driesner

[EMAIL PROTECTED] wrote:
Hello , 

I am trying to create a project doing the following 


1. First of all i am creating a menu dynamically - My menu consists of Menus
and Submenus
2. My goal is to catch an event when my new menu is clicked and then to add
code so as to print the menu Name in the document

BUT MY PROBLEM IS THAT IT NEVER GOES IN THE EVENTLISTENER!!! :-(

Here is my code
/

Code:
public class CreateMenu  {
   
private ArrayListString iuo_arraymenu;

private String[][] is_menus;
private XComponent xCurrentComponent;
private XMultiComponentFactory mxRemoteServiceManager = null;
private XComponentContext mxRemoteContext = null;
   
private XLayoutManager xLayoutManager =null;

private XModuleUIConfigurationManagerSupplier xCmSupplier = null;
private XUIConfigurationManager uiConfigManager = null;
private XIndexContainer oMenuBarSettings = null;
private XUIElementSettings xoMenuBarSettings = null;
private XIndexContainer[] oContainer = null;
   
private PropertyValue[] oMenuOTS= null;
   
private XIndexAccess settings;
   
String sMenuBar = private:resource/menubar/menubar;


public CreateMenu(ArrayListString iuo_arraymenu,
XComponent xCurrentComponent , 
XMultiComponentFactory mxRemoteServiceManager,

XComponentContext mxRemoteContext)
throws Exception {
   
this.iuo_arraymenu = iuo_arraymenu;

this.xCurrentComponent = xCurrentComponent;
this.mxRemoteServiceManager = mxRemoteServiceManager;
this.mxRemoteContext = mxRemoteContext;
this.ConvertArrayListToArray();
this.initialize();
this.createMenuMain();
this.getTopMenu();
oMenuMain[2].Name = ItemDescriptorContainer;
oMenuMain[2].Value = oContainer[0];
oMenuBarSettings.insertByIndex( oMenuBarSettings.getCount(),
oMenuMain);
xoMenuBarSettings.setSettings(oMenuBarSettings);
   
   
   
}


public void initialize() throws
WrappedTargetException,
UnknownPropertyException,
Exception{
   
XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class,

xCurrentComponent);
 
XController xController = xModel.getCurrentController();

XFrame xFrame = xController.getFrame();
xFrame.addEventListener(new com.sun.star.document.XEventListener() {

public void notifyEvent(com.sun.star.document.EventObject arg0)
{
System.out.print(IT NEVER GETS HERE);
}

public void disposing(EventObject arg0) {
System.out.print(IT NEVER GETS HERE);
}
});
   
XPropertySet xps = (XPropertySet) UnoRuntime.queryInterface(

XPropertySet.class, xFrame);
xLayoutManager = (XLayoutManager) UnoRuntime.queryInterface(
XLayoutManager.class,
xps.getPropertyValue(LayoutManager));
xCmSupplier = (XModuleUIConfigurationManagerSupplier) UnoRuntime.
  queryInterface(XModuleUIConfigurationManagerSupplier.class,
 
mxRemoteServiceManager.createInstanceWithContext(com.sun.star.ui.ModuleUIConfigurationManagerSupplier,mxRemoteContext));

uiConfigManager =
xCmSupplier.getUIConfigurationManager(com.sun.star.text.TextDocument);
oContainer = new XIndexContainer[this.getMenuContextSum()];
oContainer[0] = uiConfigManager.createSettings();
}
   
public int getMenuContextSum(){
   
int ll_sum = 0;
   
for (int i=0;iis_menus.length;i++ ){

if (is_menus[i][3].equals(0)) {
ll_sum= ll_sum + 1;
}
}
return ll_sum + 1;
   
}
   
public void createMenuMAIN() throws

NoSuchElementException,
IllegalArgumentException,
UnknownPropertyException,
PropertyVetoException,
WrappedTargetException,
IndexOutOfBoundsException{
   
settings = uiConfigManager.getSettings(sMenuBar, true);


// 2. init menu elements
XUIElement oMenuBar = xLayoutManager.getElement(sMenuBar);
XPropertySet props = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, oMenuBar);
props.setPropertyValue(Persistent, new Boolean(true));
xoMenuBarSettings = (XUIElementSettings) UnoRuntime
.queryInterface(XUIElementSettings.class, oMenuBar);
oMenuBarSettings = (XIndexContainer) UnoRuntime
.queryInterface(XIndexContainer.class, xoMenuBarSettings
.getSettings(true));

oMenuMAIN = createMenuOption(.uno:PickList, Main);
   
}
   
 public void ConvertArrayListToArray(){

int i , j;
   
if (!this.iuo_arraymenu.isEmpty()){

j=0;

Re: [dev] File lock problem

2008-11-24 Thread Mikhail Voitenko

Hi Jakob,

The file lock was temporary released during the saving was actually a 
bug in the OOo2.x system file locking implementation. I do not see a way 
to workaround the problem, except using UNO API to load the document. In 
this case you could register a listener that would be notified when the 
document is closed.


You are right, the OOo3.0 uses own file locking mechanics based on 
lock-file. The solution was introduced only for OOo documents, since the 
locking mechanics is recognized by OOo3.0 only. So the idea was that if 
only OOo3.0 would be used to edit the documents in network, the 
documents would be handled in OOo format.


The practice has shown that the alien formats indeed need the locking in 
this scenario as well. The documents of alien formats will be locked 
with the OOo file locking mechanics starting from OOo3.0.1 release.


Best regards,
Mikhail.

On 11/24/08 18:42, Jakob Lechner wrote:

Hello,

We're using OOo for one of our products (Fabasoft Folio).
Folio is a document management system where documents of different types
can be stored. When editing a document, the document is copied to a
temporary directory and the appropriate application is started. If the
document is closed, the file is transfered back from the temporary
directory to the document store. In order to find out whether a document
is still in use, our application checks the file lock.

If an Excel file opened with OOo is saved, the file lock seems to be
removed during the save/conversion operation (this can take a long time
– depending on the file size). After the file has been saved the lock is
re-established. Unfortunately the intermediate removal of the file lock
can trigger our application too soon.

Does anybody know why the file lock is released during the saving
procedure? Is this a bug or intended (necessary) behaviour?

Any ideas how we can overcome/workaround this problem?

I've been told that OOo 3.0 creates special lock-files for opened
documents. Unfortunately this doesn't seem to be done for MS Office
documents. Why?

Thanks in advance!

Best regards
Jakob Lechner



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



Re: [dev] Need Help with Listeners

2008-11-24 Thread [EMAIL PROTECTED]

Carsten , 
thank you very much for the hint...I really had misunderstood...
thank you for the links..I will study them and i will try to implement what
i need

THANK YOU!!:handshake:


Hi,

it looks like you misunderstood how menus in OpenOffice.org work. Menus 
are only containers for commands. There is no event listener concept for 
menus controlled by OpenOffice.org. These commands are dispatched and 
processed by a so called Dispatch Provider. For more information, 
please look into the following chapter of the Developer's Guide:
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Using_the_Dispatch_Framework

So there are two different ways to be called when a certain command is 
going to be dispatched. First, you can implement your own 
DispatchProvider which is responsible for your commands. A second way is 
to implement a dispatch interceptor, which intercept certain commands. 
For more information, please look into the following chapter of the 
Developer's Guide:
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Dispatch_Interception

Regards,
Carsten

-- 
Carsten Driesner (cd at openoffice.org) - Project Lead OpenOffice.org 
Framework
Framework wiki: http://wiki.services.openoffice.org/wiki/Framework
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS

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




-- 
View this message in context: 
http://www.nabble.com/Need-Help-with-Listeners-tp20660938p20675795.html
Sent from the openoffice - dev mailing list archive at Nabble.com.


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