Re: [api-dev] [Announcement] Xray 5.2

2006-12-11 Thread Laurent Godard

Hi Bernard

Xray is a Basic macro which displays the contents of an API object and 
helps you understand the API. It can also display the content of most 
Basic variables. Xray runs in OpenOffice.org versions 1.1.x or 2.x.




Thansk a lot for this new version
I'll add a screenshot at
http://wiki.services.openoffice.org/wiki/Extensions_development_basic#X-Ray_tool

Bernard, what do you think having an a-own page for Xray starting guide 
in the extensions wiki ?


Thanks again

Laurent

--
Laurent Godard [EMAIL PROTECTED] - Ingénierie OpenOffice.org - 
http://www.indesko.com
Nuxeo Enterprise Content Management  http://www.nuxeo.com - 
http://www.nuxeo.org

Livre Programmation OpenOffice.org, Eyrolles 2004-2006

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



Re: [api-dev] Update Conversion Snippet

2006-12-11 Thread Tom Schindl
Hi Tobias,

Thanks I've integrated and released to CVS.

Tom

Tobias Krais schrieb:
 Hi Tom,
 
 please update this snippet. It was too large and now everything needed
 is linked :-)
 
 Greetings, Tobias
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




signature.asc
Description: OpenPGP digital signature


[api-dev] Please update one more snippet

2006-12-11 Thread Tobias Krais
Hi Tom,

here one more Snippet with linking at its best.

Greetings, Tobias
?xml version=1.0?
!--
$RCSfile: $
last change: $Revision: $ $Author: $ $Date: $

(c)2003 by the copyright holders listed with the author-tags.
If no explicit copyright holder is mentioned with a certain author,
the author him-/herself is the copyright holder. All rights reserved.

Public Documentation License Notice:

The contents of this Documentation are subject to the
Public Documentation License Version 1.0 (the License);
you may only use this Documentation if you comply with
the terms of this License. A copy of the License is
available at http://www.openoffice.org/licenses/PDL.html

The Original Documentation can be found in the CVS archives
of openoffice.org at the place specified by RCSfile: in this header.

The Initial Writer(s) of the Original Documentation are listed
with the author-tags below.

The Contributor(s) are listed with the author-tags below
without the marker for being an initial author.

All Rights Reserved.
--

snippet language=Java application=Office

keywords
	keywordbootstrap/keyword
	keywordstart/keyword
/keywords

authors
	author id=tobiaskrais initial=true email=[EMAIL PROTECTED] copyright=GPLTobias Krais (www.design-to-use.de)/author
/authors

question heading=Bootstrap OpenOfficeHow to bootstrap OpenOffice.org?
/question

answer
pThis method bootstraps OpenOffice./p
pIf you donapos;t want to add all the UNO jars to your classpath do following:/p
p1. Add these files to your jar (you find them in a SDK subfolder):/p
pcom/sun/star/lib/loader/Loader$CustomURLClassLoader.class/p
pcom/sun/star/lib/loader/Loader.class/p
pcom/sun/star/lib/loader/InstallationFinder$StreamGobbler.class/p
pcom/sun/star/lib/loader/InstallationFinder.class/p
pcom/sun/star/lib/loader/WinRegKey.class/p
pcom/sun/star/lib/loader/WinRegKeyException.class/p
pwin/unowinreg.dll/p
p/p
p2. Create a MANIFEST.MF file for your jar and use it when creating/p
pthe jar. The MANIFEST.MF must look like:/p
pMain-Class: com.sun.star.lib.loader.Loader/p
p/p
pName: com/sun/star/lib/loader/Loader.class/p
pApplication-Class: my.package.MyClass/p
pApplication-Name: my/package/MyClass.class/p
p/p
p3. Start your application using e.g. this command:/p
pjava -jar myjar.jar/p
listingimport {%see com.sun.star.comp.helper.Bootstrap};
import {%see com.sun.star.comp.helper.BootstrapException};
import {%see com.sun.star.lang.XMultiComponentFactory};
import {%see com.sun.star.uno.XComponentContext};

/**
 * This method bootstraps a OpenOffice and returns itapos;s Desktop.
 * 
 * @return
 */
public void bootstrapOpenOffice()
{
	XComponentContext xRemoteContext = null;
	try
	{
		// Connect or start a OpenOffice instance
		xRemoteContext = Bootstrap.bootstrap();
	}
	catch (BootstrapException e) {
	}

	// get OO desktop
	XMultiComponentFactory xRemoteServiceManager = 
			xRemoteContext.getServiceManager();

	Object desktop = null;
	try	{
		desktop = xRemoteServiceManager.createInstanceWithContext(
quot;com.sun.star.frame.Desktopquot;, xRemoteContext
		);
	}
	catch (Exception e)	{
	}
}/listing
/answer

versions
	version number=2.0.x status=tested/
/versions

operating-systems
operating-system name=All/
/operating-systems

changelog
	change author-id=tobiaskrais date=2006-12-11Linked resources./change
	change author-id=tobiaskrais date=2006-03-27Added the hints for usage without classpath./change
	change author-id= date=2006-03-20Initial version/change
/changelog

/snippet

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

Re: [api-dev] Update loading document Snippet

2006-12-11 Thread Tom Schindl
Tobias Krais schrieb:
 Hi Tom,
 
 and another snippet from me is updated now. Please put in in the Snippet
 Base.
 
 Greetings, Tobias
 

Done



signature.asc
Description: OpenPGP digital signature


[api-dev] One more Snippet

2006-12-11 Thread Tobias Krais
Hi Tom,

don't wonder, why I produce so many snippets today. I quit working at my
company and change to an other one. But before I leave, I give back the
comunity, what it gave to me.

More Snippets will follow.

Should I send other snippets coming soon as PM?

Greetings, Tobias
?xml version=1.0?
!--
$RCSfile: $
last change: $Revision: $ $Author: $ $Date: $

(c)2003 by the copyright holders listed with the author-tags.
If no explicit copyright holder is mentioned with a certain author,
the author him-/herself is the copyright holder. All rights reserved.

Public Documentation License Notice:

The contents of this Documentation are subject to the
Public Documentation License Version 1.0 (the License);
you may only use this Documentation if you comply with
the terms of this License. A copy of the License is
available at http://www.openoffice.org/licenses/PDL.html

The Original Documentation can be found in the CVS archives
of openoffice.org at the place specified by RCSfile: in this header.

The Initial Writer(s) of the Original Documentation are listed
with the author-tags below.

The Contributor(s) are listed with the author-tags below
without the marker for being an initial author.

All Rights Reserved.
--

snippet language=Java application=Office

keywords
	keywordbootstrap/keyword
	keywordconnect/keyword
/keywords

authors
	author id=tobiaskrais initial=true email=[EMAIL PROTECTED] copyright=GPLTobias Krais (www.design-to-use.de)/author
/authors

question heading=Connect to Listening OpenOfficeHow to connect to a already listening OpenOffice?

pYou can start a OpenOffice in listening mode with e.g. this command:/p
pooffice -accept=quot;socket,host=localhost,port=9000;urp;StarOffice.ServiceManagerquot;/p
pThis commandline starts OpenOffice listening on port 9000/p
/question

answer
pThis method connect to a listening OpenOffice./p
listingimport {%see com.sun.star.beans.XPropertySet};
import {%see com.sun.star.bridge.UnoUrlResolver};
import {%see com.sun.star.bridge.XUnoUrlResolver};
import {%see com.sun.star.comp.helper.Bootstrap};
import {%see com.sun.star.lang.XMultiComponentFactory};
import {%see com.sun.star.uno.UnoRuntime};
import {%see com.sun.star.uno.XComponentContext};

/**
 * This method connects to a running OpenOffice. This OpenOffice is
 * listening on a specific port. It connects to this port.
 * 
 * @param ooport
 * @return
 */
public void connectListeningOpenOffice(String ooport)
{
	try{
		// Create an OO Component Context
		XComponentContext xCC = 
Bootstrap.createInitialComponentContext(null);

		// create a connector, so that it can contact the office
		XUnoUrlResolver urlResolver = UnoUrlResolver.create(xCC);

		Object initialObject = urlResolver.resolve(
quot;uno:socket,host=localhost,port=quot; + ooport
+ quot;;urp;StarOffice.ServiceManagerquot;);

		XMultiComponentFactory xMCF = (XMultiComponentFactory)
UnoRuntime.queryInterface(XMultiComponentFactory.class,
			initialObject);

		// retrieve the component context as property (it is not yet
		// exported from the office). Query for the XPropertySet interface.
		XPropertySet xProperySet = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xMCF);

		// Get the default context from the office server.
		Object oDefaultContext = xProperySet.getPropertyValue(quot;DefaultContextquot;);

		// Query for the interface XComponentContext.
		xCC = (XComponentContext)
		UnoRuntime.queryInterface(XComponentContext.class, oDefaultContext);

		// now create the desktop service
		// NOTE: use the office component context here!
		Object desktop = xMCF.createInstanceWithContext(
quot;com.sun.star.frame.Desktopquot;, xCC);
	}
	catch(Exception e){
	}
}/listing
/answer

versions
	version number=2.0.x status=tested/
	version number=1.1.x status=tested/
/versions

operating-systems
operating-system name=All/
/operating-systems

changelog
	change author-id=tobiaskrais date=2006-12-11Linking imports/change
	change author-id=tobiaskrais date=2006-03-20Initial version/change
/changelog

/snippet

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

Re: [api-dev] One more Snippet

2006-12-11 Thread Tom Schindl
Tobias Krais schrieb:
 Hi Tom,
 
 don't wonder, why I produce so many snippets today. I quit working at my
 company and change to an other one. But before I leave, I give back the
 comunity, what it gave to me.
 
 More Snippets will follow.
 
 Should I send other snippets coming soon as PM?

I prefer having them on the mailing list so that I don't miss one.

Tom



signature.asc
Description: OpenPGP digital signature


Re: [api-dev] One more Snippet

2006-12-11 Thread Tom Schindl
Tobias Krais schrieb:
 Hi Tom,
 
 don't wonder, why I produce so many snippets today. I quit working at my
 company and change to an other one. But before I leave, I give back the
 comunity, what it gave to me.
 
 More Snippets will follow.
 
 Should I send other snippets coming soon as PM?
 
 Greetings, Tobias
 

Done.



signature.asc
Description: OpenPGP digital signature


[api-dev] A new Snippet

2006-12-11 Thread Tobias Krais
Hi Tom,

here a new Snippet.

Greetings, Tobias
?xml version=1.0?
!--
$RCSfile: $
last change: $Revision: $ $Author: $ $Date: $

(c)2003 by the copyright holders listed with the author-tags.
If no explicit copyright holder is mentioned with a certain author,
the author him-/herself is the copyright holder. All rights reserved.

Public Documentation License Notice:

The contents of this Documentation are subject to the
Public Documentation License Version 1.0 (the License);
you may only use this Documentation if you comply with
the terms of this License. A copy of the License is
available at http://www.openoffice.org/licenses/PDL.html

The Original Documentation can be found in the CVS archives
of openoffice.org at the place specified by RCSfile: in this header.

The Initial Writer(s) of the Original Documentation are listed
with the author-tags below.

The Contributor(s) are listed with the author-tags below
without the marker for being an initial author.

All Rights Reserved.
--

snippet language=Java application=Office

keywords
	keywordapplication name/keyword
	keywordXComponent/keyword
	keywordcom.sun.star.text.TextDocument/keyword
/keywords

authors
	author id=tobiaskrais initial=true email=[EMAIL PROTECTED] copyright=GPLTobias Krais (www.design-to-use.de)/author
/authors

question heading=Get the Application  Name of a documentHow to get the Application Name of a document?
/question

answer
listingimport {%see com.sun.star.frame.XModuleManager};
import {%see com.sun.star.lang.XComponent};
import {%see com.sun.star.lang.XMultiComponentFactory};
import {%see com.sun.star.uno.UnoRuntime};
import {%see com.sun.star.uno.XComponentContext};

public class Snippets {
/**
 * Component context to be passed to a component via
 * com.sun.star.lang.XSingleComponentFactory . Arbitrary values
 * (e.g. deployment values) can be retrieved from the context.
 * 
 * How to get this Object, see {%internal ../Office/Office.BootstrapOpenOffice.snip}
 * or {%internal ../Office/Office.ConnectToListeningOpenOffice.snip}
 */
private static XComponentContext xComponentContext;

/**
 * Factory interface for creating component instances giving a context from
 * which to retrieve deployment values.
 * 
 * How to get this Object, see {%internal ../Office/Office.BootstrapOpenOffice.snip}
 * or {%internal ../Office/Office.ConnectToListeningOpenOffice.snip}
 */
private static XMultiComponentFactory xMCF; 

	
	/**
 * Get the application name of a document. E.g. for a writer document
 * quot;com.sun.star.text.TextDocumentquot;
 * 
 * @param myXComponent UNO Representativ of the opened document.
 * @return The OpenOffice application name. It looks like
 * quot;com.sun.star.text.TextDocumentquot;.
 */
public static String getApplicationName(XComponent myXComponent) {
XModuleManager xMM = null;
try {
xMM = (XModuleManager)UnoRuntime.queryInterface(
XModuleManager.class,
xMCF.createInstanceWithContext(
quot;com.sun.star.frame.ModuleManagerquot;,
xComponentContext));
}
catch (com.sun.star.uno.Exception e) {
return null;
}

String sOOoApp = null;
try{
// Getting the application name of the document,
// e.g. quot;com.sun.star.text.TextDocumentquot; for writer
sOOoApp = xMM.identify(myXComponent);
}
catch(com.sun.star.uno.Exception e)
{
return null;
}
return sOOoApp;
}
}/listing
/answer

versions
	version number=2.0.x status=tested/
	version number=1.1.x status=untested/
/versions

operating-systems
operating-system name=All/
/operating-systems

changelog
	change author-id=tobiaskrais date=2006-12-11Initial version/change
/changelog

/snippet

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

Re: [api-dev] [Announcement] Xray 5.2

2006-12-11 Thread Bernard Marcelly

Bonjour Laurent,
Message du 2006-12-11 09:59:

Hi Bernard

Thansk a lot for this new version
I'll add a screenshot at
http://wiki.services.openoffice.org/wiki/Extensions_development_basic#X-Ray_tool 



Thanks :)



Bernard, what do you think having an a-own page for Xray starting guide 
in the extensions wiki ?




Xray comes with its own documentation :) So there is no need to 
duplicate information.
But it would be advisable in this wiki page to suppress the old way of 
calling Xray ( xray.xray, used twice in the page, and load of Xray 
library instead of XrayTool library ). This has been obsolete since more 
than a year, and it is confusing.


Regards
   Bernard

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