|
View:
New views
16 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
Openoffice automation using a serviceHi all, I'm trying to do some openoffice automation using a service running as LOCAL_SYSTEM on XP so that it runs without needing a login. However, the program seems to get stuck at bootstrap command: cppu::bootstrap(). It does not throw any exception and it does not crash. Soffice.bin/Soffice.exe is run as LOCAL_SYSTEM as well which means bootstrap is able to run soffice at least... Another abnormality is that if i try to rerun the service, an additional copy of soffice will be run which shouldn't be the case because it usually searches for an existing instance. Has anyone encountered a similar problem before? How can i resolve this? Thanks. Cheers, Wei Min _________________________________________________________________ With Windows Live, you can organize, edit, and share your photos. http://www.microsoft.com/singapore/windows/windowslive/products/photo-gallery-edit.aspx |
|
|
Re: [dev] Openoffice automation using a serviceHi,
How do you start the first instance of soffice.exe? You mentioned "a service running as LOCAL_SYSTEM." Could you give us a little bit details about that? What command line options do you give to the soffice.exe? What user account is being used for the process of soffice.exe? etc... I guess that behavior is well-known and its solution is described somewhere. Does anyone know that? Cheers, Tora Wei Min Teo wrote: > Hi all, > > I'm trying to do some openoffice automation using a service running as LOCAL_SYSTEM on XP so that it runs without needing a login. However, the program seems to get stuck at bootstrap command: cppu::bootstrap(). It does not throw any exception and it does not crash. > > Soffice.bin/Soffice.exe is run as LOCAL_SYSTEM as well which means bootstrap is able to run soffice at least... Another abnormality is that if i try to rerun the service, an additional copy of soffice will be run which shouldn't be the case because it usually searches for an existing instance. > > Has anyone encountered a similar problem before? How can i resolve this? > > Thanks. > > Cheers, > Wei Min --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
RE: [dev] Openoffice automation using a serviceHi, The first instance of soffice.exe is start by the bootstrap command, it is ran as SYSTEM. I did not use any command line options just the default bootstrap function cppu::bootstrap(). > Date: Mon, 14 Sep 2009 13:18:15 +0900 > From: tora@... > To: dev@... > CC: dev@... > Subject: Re: [dev] Openoffice automation using a service > > Hi, > > How do you start the first instance of soffice.exe? > You mentioned "a service running as LOCAL_SYSTEM." > > Could you give us a little bit details about that? > What command line options do you give to the soffice.exe? > What user account is being used for the process of soffice.exe? > etc... > > I guess that behavior is well-known and its solution is described somewhere. > Does anyone know that? > > Cheers, > Tora > > Wei Min Teo wrote: > > Hi all, > > > > I'm trying to do some openoffice automation using a service running as LOCAL_SYSTEM on XP so that it runs without needing a login. However, the program seems to get stuck at bootstrap command: cppu::bootstrap(). It does not throw any exception and it does not crash. > > > > Soffice.bin/Soffice.exe is run as LOCAL_SYSTEM as well which means bootstrap is able to run soffice at least... Another abnormality is that if i try to rerun the service, an additional copy of soffice will be run which shouldn't be the case because it usually searches for an existing instance. > > > > Has anyone encountered a similar problem before? How can i resolve this? > > > > Thanks. > > > > Cheers, > > Wei Min > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@... > For additional commands, e-mail: dev-help@... > _________________________________________________________________ With Windows Live, you can organize, edit, and share your photos. http://www.microsoft.com/singapore/windows/windowslive/products/photo-gallery-edit.aspx |
|
|
Re: [dev] Openoffice automation using a serviceHi,
Wei Min Teo wrote: > The first instance of soffice.exe is start by the bootstrap command, it is ran as SYSTEM. I did not use any command line options just the default bootstrap function cppu::bootstrap(). I am sorry, but I cannot understand what you are saying. "bootstrap command", "bootstrap function cppu::bootstrap()", ... Maybe, I would need to study about that more. Possible recommended command line options could be found in this file, which is a source code of .jar file frequently used in the SDK to start and/or connect to the process of soffice.bin through a named pipe. http://svn.services.openoffice.org/ooo/branches/OOO310/javaunohelper/com/sun/star/comp/helper/Bootstrap.java Running soffice.bin as an account SYSTEM might be discouraged since the OpenOffice.org is a huge software and is not bug-free. There are possibilities to harm your system caused by a bug and/or security hole. > Another abnormality is that if i try to rerun the service, > an additional copy of soffice will be run which shouldn't > be the case because it usually searches for an existing instance. The phenomenon can be often observed, if a running user account has not yet accepted the license agreement. The first instance of soffice.bin is just waiting for user's actions, i.e. clicking on the 'OK' button behind the scene. The second one has established a connection to the first one and is waiting for its response. Ciao, Tora --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
RE: [dev] Openoffice automation using a serviceHi, Sorry for the confusion, I meant using the bootstrap function instead of the bootstrap command. This is in a program ran as local system. I used C++ for coding. I used the sample code from this url :http://wiki.services.openoffice.org/wiki/UNO_registery_and_Bootstrapping under "The new ::cppu::bootstrap() function". Reference <XComponentContext> x_component_context(::cppu::bootstrap()); _x_multi_component_factory_client = Reference <XMultiComponentFactory> (x_component_context->getServiceManager()); _x_interface = Reference <XInterface>(_x_multi_component_factory_client->createInstanceWithContext(OUString::createFromAscii("com.sun.star.bridge.UnoUrlResolver" ), x_component_context)); Reference <XUnoUrlResolver> resolver(_x_interface, UNO_QUERY); _x_interface = Reference <XInterface> (resolver->resolve(connection_string), UNO_QUERY); Reference <XPropertySet> x_prop_set(_x_interface, UNO_QUERY); x_prop_set->getPropertyValue(OUString::createFromAscii("DefaultContext")) >>= x_component_context; Reference <XMultiComponentFactory> x_multi_component_factory_server(x_component_context->getServiceManager()); _x_component_loader = Reference <XComponentLoader>(x_multi_component_factory_server->createInstanceWithContext(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")), x_component_context), UNO_QUERY); > Date: Mon, 14 Sep 2009 16:02:21 +0900 > From: tora@... > To: dev@... > CC: dev@... > Subject: Re: [dev] Openoffice automation using a service > > Hi, > > Wei Min Teo wrote: > > The first instance of soffice.exe is start by the bootstrap command, it is ran as SYSTEM. I did not use any command line options just the default bootstrap function cppu::bootstrap(). > > I am sorry, but I cannot understand what you are saying. > "bootstrap command", "bootstrap function cppu::bootstrap()", ... > Maybe, I would need to study about that more. > > Possible recommended command line options could be found in this file, > which is a source code of .jar file frequently used in the SDK to start and/or connect to the process of soffice.bin through a named pipe. > http://svn.services.openoffice.org/ooo/branches/OOO310/javaunohelper/com/sun/star/comp/helper/Bootstrap.java > > Running soffice.bin as an account SYSTEM might be discouraged > since the OpenOffice.org is a huge software and is not bug-free. > There are possibilities to harm your system caused by a bug and/or security hole. > > > > Another abnormality is that if i try to rerun the service, > > an additional copy of soffice will be run which shouldn't > > be the case because it usually searches for an existing instance. > > The phenomenon can be often observed, if a running user account > has not yet accepted the license agreement. The first instance > of soffice.bin is just waiting for user's actions, i.e. clicking > on the 'OK' button behind the scene. The second one has established > a connection to the first one and is waiting for its response. > > Ciao, > Tora > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@... > For additional commands, e-mail: dev-help@... > _________________________________________________________________ See all the ways you can stay connected to friends and family http://www.microsoft.com/windows/windowslive/default.aspx |
|
|
Re: [dev] Openoffice automation using a serviceHi Wei,
Wei Min Teo wrote: > I used the sample code from this url :http://wiki.services.openoffice.org/wiki/UNO_registery_and_Bootstrapping under "The new ::cppu::bootstrap() function". Thank you for the information. Now I understand. What I have just learned from that are It seems that ::cppu::bootstrap() (a) will not give an option "-nofirststartwizard" to soffice.exe Therefore, you, in behalf of the user account, will need to accept the license agreement first. (b) is intended to be used by a program from which soffice.bin will be remotely controlled. bootstrap() will create a random pipe name, which cannot be guessed by other program. So, what shall we do? I am not sure. Here is just one idea. (1) Start soffice.exe as normal user account with the following command line options. soffice.exe -nofirststartwizard -nologo -nodefault -norestore -nocrashreport -nolockcheck "-accept=pipe,name=MY_FAVORITE_NAME;urp;" (2) And then use a conventional way to establish a connection to the process of soffice.bin which is listening to the named pipe MY_FAVORITE_NAME. ======================================================================== http://svn.services.openoffice.org/ooo/trunk/cppuhelper/source/bootstrap.cxx namespace cppu { Reference< XComponentContext > SAL_CALL bootstrap() { // create a random pipe name ... OUString sPipeName( buf.makeStringAndClear() ); // accept string OSL_ASSERT( buf.getLength() == 0 ); buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "-accept=pipe,name=" ) ); buf.append( sPipeName ); buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( ";urp;" ) ); // arguments OUString args [] = { OUSTR( "-nologo" ), OUSTR( "-nodefault" ), OUSTR( "-norestore" ), OUSTR( "-nocrashreport" ), OUSTR( "-nolockcheck" ), ======================================================================== http://svn.services.openoffice.org/ooo/trunk/desktop/source/app/app.cxx // First Start Wizard allowed ? if ( ! pCmdLineArgs->IsNoFirstStartWizard()) ======================================================================== http://svn.services.openoffice.org/ooo/trunk/desktop/source/app/cmdlineargs.cxx sal_Bool CommandLineArgs::IsNoFirstStartWizard() const { osl::MutexGuard aMutexGuard( m_aMutex ); return m_aBoolParams[ CMD_BOOLPARAM_NOFIRSTSTARTWIZARD ]; } else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-nofirststartwizard" )) == sal_True ) { SetBoolParam_Impl( CMD_BOOLPARAM_NOFIRSTSTARTWIZARD, sal_True ); return sal_True; } ======================================================================== Tora --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: [dev] Openoffice automation using a serviceAnother possible way (still, I am not sure, though):
(1) Start soffice.exe as a normal user account with the following command line options. soffice.exe -nofirststartwizard -nologo -nodefault -norestore -nocrashreport -nolockcheck (2) And then use a recent way such as ::cppu::bootstrap() to connect to the process of soffice.bin. Tora --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: [dev] Openoffice automation using a serviceSorry for multiple emails.
If you attempt to use the following way, the user account for (1) and (2) must be identical. Otherwise, (2) will start another instance of soffice.bin from the scratch even though (1) is already running. The reason is that (1) will be waiting at its own named pipe, whose name will be created based on a folder name for the user account or like that - I forgot -, and (2) will also use the identical named pipe. So they will be able to handshake each other. Please correct me if anyone finds misunderstandings. Tora tora - Takamichi Akiyama wrote: > Another possible way (still, I am not sure, though): > > (1) Start soffice.exe as a normal user account with the following command line options. > soffice.exe -nofirststartwizard -nologo -nodefault -norestore -nocrashreport -nolockcheck > > (2) And then use a recent way such as ::cppu::bootstrap() to connect to the process of soffice.bin. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: Accessing the Calc Formula Bar Input Linerashi dhing wrote:
> Hello Dev Team, > > I have been trying to extend the functionality of the Calc formula bar input > line. > > Let me explain the scenario first : > > I have defined a function that takes in a single argument which is a string > and contains, apart from other tokens, range names. I would like to > highlight > these range names in different colors. So i need to access the text font in > the > formula bar and change the font color for only certain portions of my string > argument. > > In excel, when you select different ranges in a formula (arguments that > are range objects) , the formula bar highlights the range names as well > as the actual cell ranges present on the sheet in different colors. > I am trying to attempt something similar but in a string argument > as opposed to range arguments. > > I found out that all the standard tools bars have resource urls that follow > the > format : "private:resource/toolbar/" but could not find one for the formula > bar. > And I also know that to focus on the input line you can execute a > dispatch command with the url ".uno:FocusInputLine". > > Someone suggested using a text cursor but i believe that it only for > text objects. How can I modify and format the text in the formula bar and > not the cell. > > Previously I was trying to do this in excel in which you can access the > formula > bar through Windows API but found out that in edit mode it is impossible to > run > any macro and so gave up and migrated to openoffice ! > > Any leads will be highly appreciated. I would like to attempt it through > the API and not the source code as I an not a java or c++ expert. > I code in OOBasic. Any suggestions !! > > Many many thanks ! I am sorry but this is not possible. The implementation of the Calc Formula bar input line is completely done in C++. There are no UNO based APIs to influence this control. Regards, Carsten --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: Accessing the Calc Formula Bar Input LineThanks Carsten, have decided to take a plunge into the source code and see what
i can fish out ! Best, Rashi On 9/15/09, Carsten Driesner <carsten.driesner@...> wrote: > rashi dhing wrote: >> Hello Dev Team, >> >> I have been trying to extend the functionality of the Calc formula bar >> input >> line. >> >> Let me explain the scenario first : >> >> I have defined a function that takes in a single argument which is a >> string >> and contains, apart from other tokens, range names. I would like to >> highlight >> these range names in different colors. So i need to access the text font >> in >> the >> formula bar and change the font color for only certain portions of my >> string >> argument. >> >> In excel, when you select different ranges in a formula (arguments that >> are range objects) , the formula bar highlights the range names as well >> as the actual cell ranges present on the sheet in different colors. >> I am trying to attempt something similar but in a string argument >> as opposed to range arguments. >> >> I found out that all the standard tools bars have resource urls that >> follow >> the >> format : "private:resource/toolbar/" but could not find one for the >> formula >> bar. >> And I also know that to focus on the input line you can execute a >> dispatch command with the url ".uno:FocusInputLine". >> >> Someone suggested using a text cursor but i believe that it only for >> text objects. How can I modify and format the text in the formula bar and >> not the cell. >> >> Previously I was trying to do this in excel in which you can access the >> formula >> bar through Windows API but found out that in edit mode it is impossible >> to >> run >> any macro and so gave up and migrated to openoffice ! >> >> Any leads will be highly appreciated. I would like to attempt it through >> the API and not the source code as I an not a java or c++ expert. >> I code in OOBasic. Any suggestions !! >> >> Many many thanks ! > Hi Rashi, > > I am sorry but this is not possible. The implementation of the Calc > Formula bar input line is completely done in C++. There are no UNO based > APIs to influence this control. > > Regards, > Carsten > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@... > For additional commands, e-mail: dev-help@... > > -- " Happiness makes up in height for what it lacks in length." (Robert Frost) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
RE: Re: [dev] Openoffice automation using a serviceHi Tora, Thanks for your replies and suggestions. However, I do not want to start soffice.exe as a normal user account as I would need the user account password or wait for a user logon. I realised the problem running a OO service as SYSTEM is that: "the service runs as a special account and OpenOffice.org will try to show the license agreement dialog as if it was a new user instead of starting the application." "To avoid this, you need to edit share\registry\data\org\openoffice\Setup.xcu (it's an XML file) inside the OpenOffice.org installation directory and replace this bit" This is the article that explains it: http://www.artofsolving.com/node/11 Cheers, Wei Min > Date: Mon, 14 Sep 2009 20:09:00 +0900 > From: tora@... > To: dev@... > CC: dev@... > Subject: [api-dev] Re: [dev] Openoffice automation using a service > > Sorry for multiple emails. > > If you attempt to use the following way, the user account for (1) and (2) must be identical. Otherwise, (2) will start another instance of soffice.bin from the scratch even though (1) is already running. > > The reason is that (1) will be waiting at its own named pipe, whose name will be created based on a folder name for the user account or like that - I forgot -, and (2) will also use the identical named pipe. So they will be able to handshake each other. > > Please correct me if anyone finds misunderstandings. > > Tora > > tora - Takamichi Akiyama wrote: > > Another possible way (still, I am not sure, though): > > > > (1) Start soffice.exe as a normal user account with the following command line options. > > soffice.exe -nofirststartwizard -nologo -nodefault -norestore -nocrashreport -nolockcheck > > > > (2) And then use a recent way such as ::cppu::bootstrap() to connect to the process of soffice.bin. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@... > For additional commands, e-mail: dev-help@... > _________________________________________________________________ Share your memories online with anyone you want. http://www.microsoft.com/singapore/windows/windowslive/products/photos-share.aspx?tab=1 |
|
|
Long file namesHi all, It seems that openoffice has a maximum path name of 260 chars? However, I think the maximum path name for windows is 32,767 and file name is 260 in unicode. Is it possible to pass in to the loadComponentFromUrl function using a relative path instead of an absolute path? Are there any other workarounds? I can only think of making a copying to a temp file, do your work and copy back. Thanks. Cheers, Wei Min With Windows Live, you can organize, edit, and share your photos. _________________________________________________________________ NEW! Get Windows Live FREE. http://www.get.live.com/wl/all |
|
|
Re: [dev] Long file namesOn 09/30/2009 11:38 PM, Wei Min Teo wrote:
> > > Hi all, > > It seems that openoffice has a maximum path name of 260 chars? > > However, I think the maximum path name for windows is 32,767 and file name is 260 in unicode. > > > > Is it possible to pass in to the loadComponentFromUrl function using a relative path instead of an absolute path? > > Are there any other workarounds? I can only think of making a copying to a temp file, do your work and copy back. > > Thanks. > bumped into this limit many times. There are some unicode extensions that allow for longer path names, as discussed here: http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx I have never bothered to pursue them, because although I have created path/filename combinations that exceed this, most of the other tools start failing in very bad ways (Windows explorer, command line tools, etc. ) -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.odt My Book: http://www.hentzenwerke.com/catalog/oome.htm Info: http://www.pitonyak.org/oo.php See Also: http://documentation.openoffice.org/HOW_TO/index.html --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: [dev] Long file namesHi,
In what situation do you currently encounter the problem? What do you do? What do you expect? What your OpenOffice.org actually does despite your expectations. One possible, interesting topic: Generally speaking, one Chinese, including most Far East Asian languages, characters will be internally converted into 9 ASCII characters ( three occurrences of % followed by two hex-decimal digits ) in a certain situation because of UTF-8 hex-decimal encoded URL. If the length of text is limited up to 256 bytes somewhere, in the worst case, the limitation for the number of Chinese characters might become 28, not 256. (256 / 9 = 28.4). For example, Chinese characters: 中国 Corresponding URL: %E4%B8%AD%E5%9B%BD (forcedly encoded) ASCII letters: China Corresponding URL: China (no need to be encoded) Tora Wei Min Teo wrote: > It seems that openoffice has a maximum path name of 260 chars? > > However, I think the maximum path name for windows is 32,767 and file name is 260 in unicode. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: [dev] Long file namesOn 10/05/09 03:35, tora - Takamichi Akiyama wrote:
> Generally speaking, one Chinese, including most Far East Asian languages, characters will be > internally converted into 9 ASCII characters ( three occurrences of % followed by two hex-decimal > digits ) in a certain situation because of UTF-8 hex-decimal encoded URL. > > If the length of text is limited up to 256 bytes somewhere, in the worst case, the limitation > for the number of Chinese characters might become 28, not 256. (256 / 9 = 28.4). The limitation is on Windows pathnames, not on URLs (that are mapped to pathnames, by replacing sequences of escape-encoded bytes with sequences of pathname characters), so the ratio of "human readable" characters to pathname characters is usually much smaller than 9, typically 1--3 (depending on the character encoding used by Windows). -Stephan --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
| Free embeddable forum powered by Nabble | Forum Help |