Re: [dev] Re: XML Import Filter

2009-08-14 Thread Jakob Mandalka
Ok thanks, i figured it out. But now the next Problem.

How I can register a filter using this API?

At the moment I added my filter via the menu in Open Office but I want
to change that.

2009/8/11 tora - Takamichi Akiyama t...@openoffice.org:
 Hi,

 Looking up those key words - application, getDocumentService, and
 loadDocument - in the Internet gives us information on what you are using.
 That type of helper classes developed by a third party could be one of the
 ways to handle document files.

 To understand OpenOffice.org's original API, I guess, many people here would
 recommend use of Software Development Kit of OpenOffice.org first. Once you
 have understood the API, then try to use such helper classes offered by
 third parties.

 SDK can be downloaded from a link Download in the navigator SDK at
 http://api.openoffice.org/

 There are many example codes available in the SDK. They could help you
 understand the API.

 API documentation of the method I mentioned is also available in the SDK and
 a web site at
 http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html#loadComponentFromURL

 Tora

 Jakob Mandalka wrote:

 But this I don't understand.

 At the moment I open my document this way

 document = application.getDocumentService().loadDocument(iFrame,
 location + \\ + file.getFullPath().toOSString(),
 DocumentDescriptor.DEFAULT);

 This will open a document.

 And now? How I spezifiy here now a Filter and and file which have to
 be imported? Sry for this stupid question but I am not the best in
 this case. :(

 2009/8/11 tora - Takamichi Akiyama t...@openoffice.org:

 It would not be hard to do that. There might be lots of solutions.

 This is one of the examples:

 http://distribution.openoffice.org/source/browse/distribution/mirrors/repository/production/tools/Calc/

 The key you might have been looking for would be:

  1. Name the filter as you like and fill Filter name field with it
   during XSLT installation to your OpenOffice.org.

  2. Specify the exact same filter name as a value of FilterName
   property which will be passed to loadComponentFromURL().


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



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



Re: [dev] Re: XML Import Filter

2009-08-14 Thread tora - Takamichi Akiyama

If you will need to use several XSLT templates on demand, I am not
sure, though, but the section Importer Filtering and Parsing
the Result in [1] could be one of the possible solutions.
[1] 
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/The_Importer

 1. Create a stream (1) which will read the target file.
 2. Create a stream (2) which will read the XSLT file.
 3. Create a XSLT transformer (3) with (2).
 4. Create a pipe (4),(5).
 5. Transform (1) with (3) and write results to (4).
 6. Let the OpenOffice.org to read (5) coming from (4).

So, it could be no need to use a XSLT function embedded in OpenOffice.org.
Just use available XSLT such as javax.xml.transform, instead and
give the result to the OpenOffice.org.

Examples (also available in the SDK; actually its source code)
[2] 
http://svn.services.openoffice.org/ooo/tags/OpenOffice_3_1_0/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/

Any cool ideas?


Jakob Mandalka wrote:

Ok thanks, i figured it out. But now the next Problem.

How I can register a filter using this API?

At the moment I added my filter via the menu in Open Office but I want
to change that.



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



Re: [dev] Re: XML Import Filter

2009-08-14 Thread tora - Takamichi Akiyama

For better performance, here is another idea.

 0. Register a simple XSLT template as an input filter
to your OpenOffice.org.

 1. Do the XSLT transformation with Java or any other command
such as a xsltproc command alone and save the result as a
temporary file.

 2. Let the OpenOffice.org to read the temporary file through
the simple XSLT template which will just do xsl:copy.

In the step 6 below would make a bad performance if the external
Java program is running separately from OpenOffice.org and connecting
to the OpenOffice.org through TCP/IP or named pipe.

It would be possible to let the Java program run as a process
of OpenOffice.org which could dynamically load a Java VM into
a process of OpenOffice.org so that the Java program would be
running more efficiently. To do so, however, you would need to
develop your Java program as a UNO component and deploy it to
your OpenOffice.org.

As you know, Java classes could be packed into .war file and
be deployed to an application server, you can deploy your
Java classes to your OpenOffice.org as a UNO component.
However, I guess, it might be far beyond your expectation.

Any much cooler idea?
Tora

tora - Takamichi Akiyama wrote:

If you will need to use several XSLT templates on demand, I am not
sure, though, but the section Importer Filtering and Parsing
the Result in [1] could be one of the possible solutions.
[1] 
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/The_Importer 



 1. Create a stream (1) which will read the target file.
 2. Create a stream (2) which will read the XSLT file.
 3. Create a XSLT transformer (3) with (2).
 4. Create a pipe (4),(5).
 5. Transform (1) with (3) and write results to (4).
 6. Let the OpenOffice.org to read (5) coming from (4).

So, it could be no need to use a XSLT function embedded in OpenOffice.org.
Just use available XSLT such as javax.xml.transform, instead and
give the result to the OpenOffice.org.

Examples (also available in the SDK; actually its source code)
[2] 
http://svn.services.openoffice.org/ooo/tags/OpenOffice_3_1_0/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/ 



Any cool ideas?


Jakob Mandalka wrote:

Ok thanks, i figured it out. But now the next Problem.

How I can register a filter using this API?

At the moment I added my filter via the menu in Open Office but I want
to change that.




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



Re: [dev] Re: XML Import Filter

2009-08-11 Thread Juergen Schmidt

Hi Jakob,

Jakob Mandalka wrote:

Noone any Idea how to make this?

2009/8/6 Jakob Mandalka jakob.manda...@googlemail.com:

Hello everyone, i am new here and i have a question to ask which might be a
little complicated.
What i want to do is to develop a component such as a button in open office
which , when pressed, imports an xml file which can be selected by a file
dialog and apply an already installed xslt import filter -which basically
transforms the XML file and fits its data to a simple table-.So the result
is a report-like .odt file with data provided by my xml file.
(this is the final goal,for the moment i want to just do it from command
line java program)

I am stuck at how can i use the api to load a filter package i installed
before opening the document,so that when the page opens you see the .odt
file with the table and my data..
i am able to do so from openoffice interface , the traditional way, but how
can i do it programmatically..?For the moment i open a file from java using
the NOA API but i dont find any info on how to apply a filter prior to opening
it.
if the xslt based filter is installed correctly it has a name and should 
be usable via the normal API. See the code snippet base or the SDK for 
examples how to load a document with a specific filter.


For the UI integration you can implement an addon. If you are using Java 
you can do it quite easy by using our NetBean plugin.


Juergen



thank you very much



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




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



Re: [dev] Re: XML Import Filter

2009-08-11 Thread tora - Takamichi Akiyama

It would not be hard to do that. There might be lots of solutions.

This is one of the examples:
http://distribution.openoffice.org/source/browse/distribution/mirrors/repository/production/tools/Calc/

The key you might have been looking for would be:

 1. Name the filter as you like and fill Filter name field with it
during XSLT installation to your OpenOffice.org.

 2. Specify the exact same filter name as a value of FilterName
property which will be passed to loadComponentFromURL().

Tora

Jakob Mandalka wrote:

Noone any Idea how to make this?

2009/8/6 Jakob Mandalka jakob.manda...@googlemail.com:

Hello everyone, i am new here and i have a question to ask which might be a
little complicated.
What i want to do is to develop a component such as a button in open office
which , when pressed, imports an xml file which can be selected by a file
dialog and apply an already installed xslt import filter -which basically
transforms the XML file and fits its data to a simple table-.So the result
is a report-like .odt file with data provided by my xml file.
(this is the final goal,for the moment i want to just do it from command
line java program)

I am stuck at how can i use the api to load a filter package i installed
before opening the document,so that when the page opens you see the .odt
file with the table and my data..
i am able to do so from openoffice interface , the traditional way, but how
can i do it programmatically..?For the moment i open a file from java using
the NOA API but i dont find any info on how to apply a filter prior to opening
it.


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



Re: [dev] Re: XML Import Filter

2009-08-11 Thread Jakob Mandalka
But this I don't understand.

At the moment I open my document this way

document = application.getDocumentService().loadDocument(iFrame,
location + \\ + file.getFullPath().toOSString(),
DocumentDescriptor.DEFAULT);

This will open a document.

And now? How I spezifiy here now a Filter and and file which have to
be imported? Sry for this stupid question but I am not the best in
this case. :(

2009/8/11 tora - Takamichi Akiyama t...@openoffice.org:
 It would not be hard to do that. There might be lots of solutions.

 This is one of the examples:
 http://distribution.openoffice.org/source/browse/distribution/mirrors/repository/production/tools/Calc/

 The key you might have been looking for would be:

  1. Name the filter as you like and fill Filter name field with it
    during XSLT installation to your OpenOffice.org.

  2. Specify the exact same filter name as a value of FilterName
    property which will be passed to loadComponentFromURL().

 Tora

 Jakob Mandalka wrote:

 Noone any Idea how to make this?

 2009/8/6 Jakob Mandalka jakob.manda...@googlemail.com:

 Hello everyone, i am new here and i have a question to ask which might be
 a
 little complicated.
 What i want to do is to develop a component such as a button in open
 office
 which , when pressed, imports an xml file which can be selected by a file
 dialog and apply an already installed xslt import filter -which basically
 transforms the XML file and fits its data to a simple table-.So the
 result
 is a report-like .odt file with data provided by my xml file.
 (this is the final goal,for the moment i want to just do it from command
 line java program)

 I am stuck at how can i use the api to load a filter package i installed
 before opening the document,so that when the page opens you see the .odt
 file with the table and my data..
 i am able to do so from openoffice interface , the traditional way, but
 how
 can i do it programmatically..?For the moment i open a file from java
 using
 the NOA API but i dont find any info on how to apply a filter prior to
 opening
 it.

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



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