Re: [api-dev] Embedding data files in Calc and extracting on need

2010-03-18 Thread Bernard Marcelly

Message de Madhur Kashyap  date 2010-03-18 05:35 :

Hi,

I have built an application on top of openoffice calc using the Macro
programming techniques. Now, some part of my application is in a compiled
executable in a separate file which I invoke through a shell command.

I want to distribute a single OO calc doc as the application, kind of self
contained. In order to do that I need a mechanism to keep this executable
embedded / kept inside the calc document itself. Also, a way to extract it
out when needed during the use of application.

Please guide me on how to do that. My users are on Windows as well as Linux.


I think a simpler solution would be to create and distribute an extension.
An extension may include any number of documents of any kind. You can easily 
find the path of the installed extension folder and then the address of the 
document.



Regards
  Bernard


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



Re: [api-dev] deploying images in extensions, to be loaded without extension code

2010-03-18 Thread Frank Schoenheit, Sun Microsystems Germany
Hi Paolo,

>> But nowadays, dialogs in documents can embed their images, can't they? I
>> remember Noel Power having implemented this a while ago. Admittedly, the
>> only thing I am sure of is that this works for form controls, but IIRC,
>> he also did this for dialogs in documents ...
> 
> I must say that I was not aware of this feature however it seems more a 
> workaround.

Hmm - why? If we talk about dialogs and documents, then the document
itself is a good place to store images which are needed in the dialog.
If you disagree here, then I still do not understand your needs.

>> Even if this does not work currently - those two problems are unrelated.
>> I think image controls in dialogs in documents should just have the
>> possibility to access the images in the document, just like form image
>> controls have.
> 
> Why unrelated?

Because the problem I originally raised has nothing to do with dialogs.
I want to deploy an extension, which adds some feature, and in some
place in the UI, I want to display an image for this extension. There is
no dialog at all here, I need a ways to specify an image by an URL
which, at runtime, can be resolved to point to a file within the
deployed extension.

> A dialog is a dialog and a binary resource is a binary resource, so, 
> what is the reason for using a special technique only for dialogs that 
> live into documents?
> Why not having an unified solution?

I fear I do not know enough about dialogs to discuss this in-depth ...

In my understanding, dialogs can live in documents, or in the
application-wide dialog library. Also, they can be exported from within
the dialog editor as extension (can they?).

Conceptually, those are completely different things, and having a common
solution might be pretty complex. (Where "solution" reminds me that I am
not even sure I have an understanding of the problem. I don't even think
that the problem statement can be worded in a way that it applies to all
three above cases.)

>>> An alternative approach would be to extend the image control (and any 
>>> other image-aware control) with the possbility to store itself the image.
>> Well, there's a place in ODF for images, I don't think that image
>> controls in dialogs in documents should invent another location. As said
>> above, they should simply be able to use document-embedded images.
> 
> I respect your opinion but as i said before I find this approach not 
> consistent

Why? If you insert an image in Write, and tell it to be not linked, then
it is embedded into the document. If you insert an image form control,
and tell it to not link, then the image is embedded in the document. If
you put a dialog into a document, and in this dialog, have an image
control, and tell it to not link its image, then the image is embedded
in the document.

I don't see an inconsistency here.

> AWT controls and dialogs can live into documents, in shared libraries or 
> into extensions but the problem of the resource storage is the same.

I don't think the problem is the same. Conceptually, documents, intended
to be easily moved around, are different from extensions, intended to
deployed into an OOo installation, and again different from the shared
dialog libraries belonging to a given fixed OOo installation.

In all three cases, the "non-resource" files are stored in completely
different ways, so it is pretty difficult to find a common storage
concept for the associated resources, /me thinks.

I'd say that for shared libraries, the problem does not really exist.
Those libraries are not intended to be moved around, so there's no need
for some kind of embedding.

For documents, I still think that embedding the images (or other
resources, that is) into the document is the way to go, since the
document file itself is what the user will move around.

For extensions, I'd say that the .oxt format really is only a container
which comes into existence when you want to deploy the extension. During
development of the extension, it doesn't matter at all where the
resources are located. But you actually create the .oxt file, then it
needs to be ensured that it is self-contained, i.e. contains all
resources, and correct references to it. And this brings us back to the
"extension IDE": No matter which approach we would choose for storing
and referring images and other resources, the "export as extension"
functionality needs to know about it. And that's the crucial and missing
point, IMO.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer frank.schoenh...@sun.com -
- Sun Microsystems  http://www.sun.com/staroffice -
- OpenOffice.org Base   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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



Re: [api-dev] deploying images in extensions, to be loaded without extension code

2010-03-18 Thread Noel Power

Hi Frank, Paolo
Frank Schoenheit, Sun Microsystems Germany wrote:

Hi Paolo,

  
But nowadays, dialogs in documents can embed their images, can't they? I

remember Noel Power having implemented this a while ago. Admittedly, the
only thing I am sure of is that this works for form controls, but IIRC,
he also did this for dialogs in documents ...
  
guilty, currently for 'form' controls you can now 'uncheck' the 'link' 
option when choosing the graphic, doing that the image will be embedded 
in the document.
as for dialogs this currently is not enabled, however in the cws 
'container_controls' 
http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fcontainer_controls 
this is fixed ( see 
http://www.openoffice.org/issues/show_bug.cgi?id=108949 )
However this cws has additional issues that I await feedback from 
upstream in order to progress things, so when it will be integrated is 
uncertain ( and currently most people are busy with feature freeze etc )

Even if this does not work currently - those two problems are unrelated.
I think image controls in dialogs in documents should just have the
possibility to access the images in the document, just like form image
controls have.
  
true, but if you have the access to the XStorage for the  extension 
package I think you can leverage the existing services 
com.sun.star.comp.Svx.GraphicImportHelper & 
com.sun.star.comp.Svx.GraphicExportHelper which will work with the 
vnd.sun.star.GraphicObject: url scheme.


thanks,
Noel

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



[api-dev] Tools and documentation for help file generation

2010-03-18 Thread Patrick Bernard
Hi

Are there any tools (besides ExtensionCompiler) that can generate the help 
files for extensions ?

Is there any up-to-date documentation about the help file formats ?


Patrick



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



Re: [api-dev] Tools and documentation for help file generation

2010-03-18 Thread Juergen Schmidt

Hi Patrick,

please ensure that you are subscribed correctly!

http://api.openoffice.org/servlets/ProjectMailingListList

Juergen

On 3/18/10 11:00 AM, Patrick Bernard wrote:

Hi

Are there any tools (besides ExtensionCompiler) that can generate the help
files for extensions ?

Is there any up-to-date documentation about the help file formats ?


Patrick



-
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] deploying images in extensions, to be loaded without extension code

2010-03-18 Thread Frank Schoenheit, Sun Microsystems Germany
Hi Noel,

> guilty, currently for 'form' controls you can now 'uncheck' the 'link' 
> option when choosing the graphic, doing that the image will be embedded 
> in the document.
> as for dialogs this currently is not enabled, however in the cws 
> 'container_controls' 
> http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fcontainer_controls
>  
> this is fixed ( see 
> http://www.openoffice.org/issues/show_bug.cgi?id=108949 )
> However this cws has additional issues that I await feedback from 
> upstream in order to progress things,

guilty, too. I know that I am one of the people you're awaiting feedback
from ... Sorry, will try to find your mails on this, and see if I can
put this on my list.

> true, but if you have the access to the XStorage for the  extension 
> package I think you can

True (probably :) ), but that's a lot of manual work, to be done by
everybody who needs this. An UCP as suggested by Stephan is a nice and
clean solution, which allows to reduce the problem on the extension site
to "write an URL into the configuration", and on client site to "pass
this URL to the GraphicProvider".

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer frank.schoenh...@sun.com -
- Sun Microsystems  http://www.sun.com/staroffice -
- OpenOffice.org Base   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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



Re: [api-dev] Tools and documentation for help file generation

2010-03-18 Thread bvollmer
Hello Patrick,

Leif Lodahl has written a macro to export writer documents to .xhp file
format.

http://lodahl.blogspot.com/2009/09/extension-help-content.html

regards
Benjamin


On Thu, 18 Mar 2010 11:00:46 +0100, Patrick Bernard 
wrote:
> Hi
> 
> Are there any tools (besides ExtensionCompiler) that can generate the
help 
> files for extensions ?
> 
> Is there any up-to-date documentation about the help file formats ?
> 
> 
> Patrick
> 
> 
> 
> -
> 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] Windows and Linux portability queries

2010-03-18 Thread Madhur Kashyap
Hi,

My calc application has users on both Windows and linux. The application
deals with loading of files from disk and hence the manner in which I
construct the path strings should be portable. I am avid user of TCL and it
supports a command namely "file join" "file dirname" "file tail" etc.

Do we have similar commands in OO Basic? If not natively, has some one
written those commands and willing to share? It will save some effort at my
end.

Also, I am not able to find out a neat way to identify the operating system
I am operating on. I am using Environ runtime command to poll OS and OSTYPE
variables.

Regards
Thanks


Re: [api-dev] deploying images in extensions, to be loaded without extension code

2010-03-18 Thread Noel Power

Hi Frank
Frank Schoenheit, Sun Microsystems Germany wrote:

Hi Noel,

  
guilty, currently for 'form' controls you can now 'uncheck' the 'link' 
option when choosing the graphic, doing that the image will be embedded 
in the document.
as for dialogs this currently is not enabled, however in the cws 
'container_controls' 
http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fcontainer_controls 
this is fixed ( see 
http://www.openoffice.org/issues/show_bug.cgi?id=108949 )
However this cws has additional issues that I await feedback from 
upstream in order to progress things,



guilty, too. I know that I am one of the people you're awaiting feedback
from ... Sorry, will try to find your mails on this, and see if I can
put this on my list.
  
sure and I do understand ( like I said ) that people are busy, 
especially right now ( and I include myself who at the moment may not 
even be so responsive to feedback :-( )
  
true, but if you have the access to the XStorage for the  extension 
package I think you can



True (probably :) ), but that's a lot of manual work, to be done by
everybody who needs this. An UCP as suggested by Stephan is a nice and
clean solution, which allows to reduce the problem on the extension site
to "write an URL into the configuration", and on client site to "pass
this URL to the GraphicProvider".
  
absolutely agree :-) ( but thought you were also looking for an 
immediate solution :-) )

thanks,

Noel

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



Re: [api-dev] deploying images in extensions, to be loaded without extension code

2010-03-18 Thread Juergen Schmidt

Hi Noel,

are you sure that you are subscribed correct? Please check it! At least 
your Novell address seems to be not subscribed.


http://api.openoffice.org/servlets/ProjectMailingListList

Juergen

On 3/18/10 12:02 PM, Noel Power wrote:

Hi Frank
Frank Schoenheit, Sun Microsystems Germany wrote:

Hi Noel,


guilty, currently for 'form' controls you can now 'uncheck' the
'link' option when choosing the graphic, doing that the image will be
embedded in the document.
as for dialogs this currently is not enabled, however in the cws
'container_controls'
http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fcontainer_controls
this is fixed ( see
http://www.openoffice.org/issues/show_bug.cgi?id=108949 )
However this cws has additional issues that I await feedback from
upstream in order to progress things,


guilty, too. I know that I am one of the people you're awaiting feedback
from ... Sorry, will try to find your mails on this, and see if I can
put this on my list.

sure and I do understand ( like I said ) that people are busy,
especially right now ( and I include myself who at the moment may not
even be so responsive to feedback :-( )

true, but if you have the access to the XStorage for the extension
package I think you can


True (probably :) ), but that's a lot of manual work, to be done by
everybody who needs this. An UCP as suggested by Stephan is a nice and
clean solution, which allows to reduce the problem on the extension site
to "write an URL into the configuration", and on client site to "pass
this URL to the GraphicProvider".

absolutely agree :-) ( but thought you were also looking for an
immediate solution :-) )
thanks,

Noel

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




--
Sun Microsystems GmbHJuergen Schmidt
Nagelsweg 55 Technical Lead Programmability
20097 Hamburg, Germany

Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schröder

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



[api-dev] Tools and documentation for help file generation

2010-03-18 Thread Patrick Bernard
Hi

I've just joined the mailing list, so I post my message again (sorry for the 
annoyance).

Are there any tools (besides ExtensionCompiler) that can generate the help 
files for extensions ?

Is there any up-to-date documentation about the help file formats ?


Patrick


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



Re: [api-dev] deploying images in extensions, to be loaded without extension code

2010-03-18 Thread Paolo Mantovani

Hi Frank,

Frank Schoenheit, Sun Microsystems Germany ha scritto:
[...]

Because the problem I originally raised has nothing to do with dialogs.


OK, the problem is "binary resources for extensions" I recognize that.
BUT, some versions ago, when the problem was "text resources for
extensions" the solution was "dialog centric", even if the problem is
more general.


[...]

In my understanding, dialogs can live in documents, or in the
application-wide dialog library. Also, they can be exported from within
the dialog editor as extension (can they?).


Recently this button has been removed but the possibility is still there
at API level:
http://api.openoffice.org/docs/common/ref/com/sun/star/deployment/XPackage.html#exportTo




Conceptually, those are completely different things, and having a common
solution might be pretty complex. 


I can't evaluate the complexity of such an implementation but the
infrastructure for text resources is already there:
would it be so difficult adding binary resources?

(Where "solution" reminds me that I am

not even sure I have an understanding of the problem. I don't even think
that the problem statement can be worded in a way that it applies to all
three above cases.)


IMHO you can express the idea in that way:

"adding the capability of embedding images into UNO controls" (only for
controls that can display images, of course)

The reason for having an unique solution (for example storing the image
in the dialog library container) is simple:
when you start with an extension design, especially if you work in
starbasic, you will start from a basic library into a document (or at
application level) and only after you will export the library.

An approach "extension centric" will force the developer to modify
control properties after creating and installing the extension or, even
worse, to provide code for loading images into controls at runtime, that
should be the problem that you intended to solve.


An alternative approach would be to extend the image control (and any 
other image-aware control) with the possbility to store itself the image.

Well, there's a place in ODF for images, I don't think that image
controls in dialogs in documents should invent another location. As said
above, they should simply be able to use document-embedded images.
I respect your opinion but as i said before I find this approach not 
consistent


Why? If you insert an image in Write, and tell it to be not linked, then
it is embedded into the document. If you insert an image form control,
and tell it to not link, then the image is embedded in the document. If
you put a dialog into a document, and in this dialog, have an image
control, and tell it to not link its image, then the image is embedded
in the document.

I don't see an inconsistency here.


You are evaluating the consistency from the developer's point of view.
I am in the user shoes instead, so my evaluation may be slightly
different :-)

IMHO the inconsistency here is that you can easily copy/move a whole
library (or a single dialog) from a document to another or to the
application level (and viceversa) and this clearly will break any
embedded image in a way that will be totally unexpected for the user.

"Consistency" from the user POV would be:
I design a dialog into a document embedding some images.
Then, I copy/paste the dialog (or even the single image control) into
another library (e.g. into a different document or into a shared
library) and images are still there, just like other properties.

ciao
Paolo

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



[api-dev] Inserting GraphicObjects into XTextFrame

2010-03-18 Thread Steffen Boersig

Hi guys,

I'm currently stuck with the insertion of pictures into a XTextFrame. My 
goal is to insert a GraphicObject at a cursor position. If the cursor 
resides inside an XTextFrame, the size of the XTextFrame should be 
queried and the image should be scaled accordingly to fit the size of 
the XTextFrame. This behaviour can be done with "Insert -> Graphic" in 
the OO GUI while the cursor resides in a XTextFrame.


What I can do by now is:
- Embed a GraphicObject into an XTextContent. The method can of course 
also insert into the XTextFrame if the cursor was placed there.

- Get the XTextFrame via the XTextFramesSupplier
- Query the XServiceInfo for supported Services. ( XTextCursor, 
XTextRange and XTextViewCursor seem to not support 
com.sun.star.text.XTextFrame , so what should i use here?)


What I cannot do by now is:
- Getting the "surrounding content" of the XTextCursor, therefor I'm 
also not able to determine if the cursor is currently inside a 
XTextFrame. I need to find out if I'm inside a XTextFrame to query for 
the size of the XTextFrame to be able to resize the picture.


Am I on the right track with the XServiceInfo or do I have to use a 
different approach? And if there is an easier solution to embed 
GraphicObjects into a XTextFrame( and resize it accordingly), please 
tell me.


Regards,
Steffen Boersig

Offtopic: I solved my previous problem , with executing the same code 
several times, by upgrading to OO 3.2.


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



Re: [api-dev] Inserting GraphicObjects into XTextFrame

2010-03-18 Thread Fernand Vanrie

Steffen ,

thats pretty simple: I use some basic  code to find out if the Cursor in 
a Table, Frame or Document


   oViewCursor = oDocument.getCurrentController().getViewCursor()
   If Not isEmpty(oViewCursor.TextTable) then  ' Cursor is in een Tabel
   sFrameofTabel = "TABEL"
   ' rather complex to find the cell dimensions
  otext = oViewCursor.text
 elseIf Not isEmpty(oViewCursor.TextFrame) then  ' Cursor is in een Frame
sFrameofTabel = "FRAME"
inFrameofTabel = true
 RasterofCursor = False
  iFotW = oViewCursor.TextFrame.width
  iFotH = oViewCursor.TextFrame.height
 otext = oViewCursor.text
endif
Hope it helps

Hi guys,

I'm currently stuck with the insertion of pictures into a XTextFrame. 
My goal is to insert a GraphicObject at a cursor position. If the 
cursor resides inside an XTextFrame, the size of the XTextFrame should 
be queried and the image should be scaled accordingly to fit the size 
of the XTextFrame. This behaviour can be done with "Insert -> Graphic" 
in the OO GUI while the cursor resides in a XTextFrame.


What I can do by now is:
- Embed a GraphicObject into an XTextContent. The method can of course 
also insert into the XTextFrame if the cursor was placed there.

- Get the XTextFrame via the XTextFramesSupplier
- Query the XServiceInfo for supported Services. ( XTextCursor, 
XTextRange and XTextViewCursor seem to not support 
com.sun.star.text.XTextFrame , so what should i use here?)


What I cannot do by now is:
- Getting the "surrounding content" of the XTextCursor, therefor I'm 
also not able to determine if the cursor is currently inside a 
XTextFrame. I need to find out if I'm inside a XTextFrame to query for 
the size of the XTextFrame to be able to resize the picture.


Am I on the right track with the XServiceInfo or do I have to use a 
different approach? And if there is an easier solution to embed 
GraphicObjects into a XTextFrame( and resize it accordingly), please 
tell me.


Regards,
Steffen Boersig

Offtopic: I solved my previous problem , with executing the same code 
several times, by upgrading to OO 3.2.


-
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] Inserting GraphicObjects into XTextFrame

2010-03-18 Thread Juergen Schmidt

Hi Steffen,

you are not subscribed with this email address, please ensure that you 
either use an email address that is subscribed correctly or subscribe 
under http://api.openoffice.org/servlets/ProjectMailingListList


Thanks

Juergen

On 3/18/10 5:16 PM, Steffen Boersig wrote:

Hi guys,

I'm currently stuck with the insertion of pictures into a XTextFrame. My
goal is to insert a GraphicObject at a cursor position. If the cursor
resides inside an XTextFrame, the size of the XTextFrame should be
queried and the image should be scaled accordingly to fit the size of
the XTextFrame. This behaviour can be done with "Insert -> Graphic" in
the OO GUI while the cursor resides in a XTextFrame.

What I can do by now is:
- Embed a GraphicObject into an XTextContent. The method can of course
also insert into the XTextFrame if the cursor was placed there.
- Get the XTextFrame via the XTextFramesSupplier
- Query the XServiceInfo for supported Services. ( XTextCursor,
XTextRange and XTextViewCursor seem to not support
com.sun.star.text.XTextFrame , so what should i use here?)

What I cannot do by now is:
- Getting the "surrounding content" of the XTextCursor, therefor I'm
also not able to determine if the cursor is currently inside a
XTextFrame. I need to find out if I'm inside a XTextFrame to query for
the size of the XTextFrame to be able to resize the picture.

Am I on the right track with the XServiceInfo or do I have to use a
different approach? And if there is an easier solution to embed
GraphicObjects into a XTextFrame( and resize it accordingly), please
tell me.

Regards,
Steffen Boersig

Offtopic: I solved my previous problem , with executing the same code
several times, by upgrading to OO 3.2.

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




--
Sun Microsystems GmbHJuergen Schmidt
Nagelsweg 55 Technical Lead Programmability
20097 Hamburg, Germany

Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schröder

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