Adding extra menu element to HELP menu that opens a document from samples

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding extra menu element to HELP menu that opens a document from samples

KAMI911
Hello!

Can you give me a hint how can I add an extra menu element to the help
menu. I would like to insert an menu element that opens  a document
(read only mode) from all available OpenOffice.org application. This is
because I want to show the OpenOffice.org Guide. Where can I read more
infos about this? How can I do it? Has someone a workin code snippet?

Thanks
KAMI

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adding extra menu element to HELP menu that opens a document from samples

Carsten Driesner
KAMI wrote:
> Hello!
>
> Can you give me a hint how can I add an extra menu element to the help
> menu. I would like to insert an menu element that opens  a document
> (read only mode) from all available OpenOffice.org application. This is
> because I want to show the OpenOffice.org Guide. Where can I read more
> infos about this? How can I do it? Has someone a workin code snippet?
>
Hi KAMI,

Just for your information this is an API question and you should better
ask it there. There is an easy way to add a single menu item to the help
menu. Just use an add-on and add a entry to the "OfficeHelp" set of the
Addons.xcu. You can find more information and snippets about add-ons in
the Developer's Guide, see chapter "4.7.3 Add-ons".

Just a short snippet from the Developer's Guide to add a menu item to
the help menu.

<?xml version='1.0' encoding='UTF-8'?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry"
xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Addons"
oor:package="org.openoffice.Office">
  <node oor:name="AddonUI">
   <node oor:name="OfficeHelp">
    <node oor:name="com.sun.star.comp.framework.addon" oor:op="replace">
     <prop oor:name="URL" oor:type="xs:string"
      <value>org.openoffice.Office.addon.example:Help</value>
     </prop>
     <prop oor:name="ImageIdentifier" oor:type="xs:string">
      <value/>
     </prop>
     <prop oor:name="Title" oor:type="xs:string">
      <value xml:lang="de">Über Add-On Beispiel</value>
      <value xml:lang="en-US">About Add-On Example</value>
     </prop>
     <prop oor:name="Target" oor:type="xs:string">
      <value>_self</value>
     </prop>
    </node>
   </node>
  </node>
</oor:component-data>

Regards,
Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adding extra menu element to HELP menu that opens a document from samples

KAMI911
In reply to this post by KAMI911
KAMI írta:

> Hello!
>
> Can you give me a hint how can I add an extra menu element to the help
> menu. I would like to insert an menu element that opens  a document
> (read only mode) from all available OpenOffice.org application. This
> is because I want to show the OpenOffice.org Guide. Where can I read
> more infos about this? How can I do it? Has someone a workin code
> snippet?
>
> Thanks
> KAMI
>
Anyone has idea how to do it?


KAMI

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adding extra menu element to HELP menu that opens a document from samples

Laurent Godard-3
Hi Kami

>> Can you give me a hint how can I add an extra menu element to the help
>> menu. I would like to insert an menu element that opens  a document
>> (read only mode) from all available OpenOffice.org application. This
>> is because I want to show the OpenOffice.org Guide. Where can I read
>> more infos about this? How can I do it? Has someone a workin code
>> snippet?
>>
>> Thanks
>> KAMI
>>
> Anyone has idea how to do it?

you may have a look at OooWikipedia Addon
it implements what you want
http://www.indesko.com/sites/en/downloads/ooowikipedia/view

look at the code for the help and the addon.xcu file

HTH

Laurent

--
Laurent Godard <[hidden email]> - Ingénierie OpenOffice.org
Indesko >> http://www.indesko.com
Nuxeo CPS >> http://www.nuxeo.com - http://www.cps-project.org
Livre "Programmation OpenOffice.org", Eyrolles 2004

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adding extra menu element to HELP menu that opens a document from samples

KAMI911
Laurent Godard írta:

> Hi Kami
>
>>> Can you give me a hint how can I add an extra menu element to the
>>> help menu. I would like to insert an menu element that opens  a
>>> document (read only mode) from all available OpenOffice.org
>>> application. This is because I want to show the OpenOffice.org
>>> Guide. Where can I read more infos about this? How can I do it? Has
>>> someone a workin code snippet?
>>>
>>> Thanks
>>> KAMI
>>>
>> Anyone has idea how to do it?
>
> you may have a look at OooWikipedia Addon
> it implements what you want
> http://www.indesko.com/sites/en/downloads/ooowikipedia/view
>
> look at the code for the help and the addon.xcu file
>
> HTH
>
> Laurent
>
Laurent!
Nice tool again :o) I thing all of your tools have to integrate to
OpenOffice.org. I hope you will love the Hungarian translation:

&apos;hu
CurLang=16
WikipediaConf(CurLang,0)=&quot;hu&quot;
WikipediaConf(CurLang,1)=&quot;Magyar&quot;
WikipediaConf(CurLang,2)=&quot;http://hu.wikipedia.org/wiki/Special:Search?search=&quot;
WikipediaConf(CurLang,3)=&quot;&amp;go=Keresés&quot;
WikipediaConf(CurLang,4)=&quot;Írja be a keresendő szót:&quot;
WikipediaConf(CurLang,5)=&quot;Nincs böngésző hozzárendelve az OOo-hoz&quot;
WikipediaConf(CurLang,6)=&quot;Adja meg a menüben a szükséges HTTP
beállításokat&quot;
WikipediaConf(CurLang,7)=&quot;Eszközök &gt; Beállítások &gt;
OpenOffice.org &gt; Programmes Auxiliaires&quot;
&apos;szükséges a telepítéshez
WikipediaConf(CurLang,8)=&quot;Az OOoWikipedia névjegye...&quot;
WikipediaConf(CurLang,9)=&quot;Ez az eszköz LGPL licenc alatt került
közzétételre.&quot;
WikipediaConf(CurLang,10)=&quot;OOoWikipedia Direkt&quot;
WikipediaConf(CurLang,11)=&quot;OOoWikipedia választás&quot;
WikipediaConf(CurLang,12)=&quot;Kész!&quot;
WikipediaConf(CurLang,13)=&quot;Köszönet a fordítóknak&quot;

I have small problems here:
&quot;Eszközök &gt; Beállítások &gt; OpenOffice.org &gt; Programmes
Auxiliaires&quot;
Programmes Auxiliaires - it is same in FR and EN locale - and I can not
find something similar in HU OpenOffic.org 2.0.2... Can you tell me the
correct answer and correct the English localization?

Thanks,
KAMI

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adding extra menu element to HELP menu that opens a document from samples

Laurent Godard-3
Hi Kami

>> you may have a look at OooWikipedia Addon
>> it implements what you want
>> http://www.indesko.com/sites/en/downloads/ooowikipedia/view
>>
>>
> Laurent!
> Nice tool again :o) I thing all of your tools have to integrate to
> OpenOffice.org. I hope you will love the Hungarian translation:
>

thanks :)

i'll try to have a look asap to the hungarian translation
you may also translate the documentation file

Thanks

Laurent

--
Laurent Godard <[hidden email]> - Ingénierie OpenOffice.org
Indesko >> http://www.indesko.com
Nuxeo CPS >> http://www.nuxeo.com - http://www.cps-project.org
Livre "Programmation OpenOffice.org", Eyrolles 2004

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adding extra menu element to HELP menu that opens a document from samples

KAMI911
Laurent Godard írta:

> Hi Kami
>
>>> you may have a look at OooWikipedia Addon
>>> it implements what you want
>>> http://www.indesko.com/sites/en/downloads/ooowikipedia/view
>>>
>>>
>> Laurent!
>> Nice tool again :o) I thing all of your tools have to integrate to
>> OpenOffice.org. I hope you will love the Hungarian translation:
>>
>
> thanks :)
>
> i'll try to have a look asap to the hungarian translation
> you may also translate the documentation file
>
> Thanks
>
> Laurent
>
YES, Sir!

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adding extra menu element to HELP menu that opens a document from samples

KAMI911
In reply to this post by Laurent Godard-3
Hello Laurent!

I started to write a macro to open Documentiation from help menu. I am
currently stay here:

REM  *****  BASIC  *****

Sub Main
  OpenHelpDocument
End Sub

Function OOoLangue() as string
  'Author : Laurent Godard
  'e-mail : [hidden email]

  Dim oSet, oConfigProvider
  Dim oParm(0) As New com.sun.star.beans.PropertyValue
  Dim sProvider$, sAccess$
  sProvider = "com.sun.star.configuration.ConfigurationProvider"
  sAccess   = "com.sun.star.configuration.ConfigurationAccess"
  oConfigProvider = createUnoService(sProvider)
  oParm(0).Name = "nodepath"
  oParm(0).Value = "/org.openoffice.Setup/L10N"
  oSet = oConfigProvider.createInstanceWithArguments(sAccess, oParm())

  Dim OOLangue as string
  OOLangue= oSet.getbyname("ooLocale")    'en-US
End Function

Sub OpenHelpDocument

REM Variables
  Dim mArgs(2) as New com.sun.star.beans.PropertyValue
  Dim oDoc
  Dim oFrame
  Dim s As String

REM Location of Help Document
  s = "file:///C|/Program Files/OpenOffice.org%202.0/share/samples/" &
OOoLangue( ) & "/Documentations/ooo2agy.odt"
REM PROBLEM!!!
  Print s
REM  c:\Program Files\OpenOffice.org 2.0\share\samples\hu\Documentations\

  mArgs(0).Name = "ReadOnly"
  mArgs(0).Value = True
  mArgs(1).Name = "MacroExecutionMode"
  mArgs(1).Value = 4
  mArgs(2).Name = "AsTemplate"
  mArgs(2).Value = FALSE

REM Open up, open up
  oDoc = StarDesktop.LoadComponentFromUrl(s, "_blank", 2, mArgs())

REM Error handling
  If IsNull(oDoc) OR IsEmpty(oDoc) Then
    Print "Unable to load " & s
  End If

End Sub

please check the string value REMMARKED with PROBLEM. I couln't get the
language of running OpenOffice.org... Why? What did I wrong? Also, how
can I  get the folder of OpenOffice.org (C:/Program Files/OpenOffice.org
2.0, /opet/OpenOffice.org 2.0/) ? I need these variables to locates
samples folder...

Regards,
KAMI

Laurent Godard írta:

> Hi Kami
>
>>> Can you give me a hint how can I add an extra menu element to the
>>> help menu. I would like to insert an menu element that opens  a
>>> document (read only mode) from all available OpenOffice.org
>>> application. This is because I want to show the OpenOffice.org
>>> Guide. Where can I read more infos about this? How can I do it? Has
>>> someone a workin code snippet?
>>>
>>> Thanks
>>> KAMI
>>>
>> Anyone has idea how to do it?
>
> you may have a look at OooWikipedia Addon
> it implements what you want
> http://www.indesko.com/sites/en/downloads/ooowikipedia/view
>
> look at the code for the help and the addon.xcu file
>
> HTH
>
> Laurent
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adding extra menu element to HELP menu that opens a document from samples

Laurent Godard-3
Hi Kami

>
> Function OOoLangue() as string
....
>
>  Dim OOLangue as string
>  OOLangue= oSet.getbyname("ooLocale")    'en-US
> End Function
>

the problem is
OOoLangue= oSet.getbyname("ooLocale")

>
> REM Location of Help Document
>  s = "file:///C|/Program Files/OpenOffice.org%202.0/share/samples/" &
> OOoLangue( ) & "/Documentations/ooo2agy.odt"
> REM PROBLEM!!!
>  Print s
> REM  c:\Program Files\OpenOffice.org 2.0\share\samples\hu\Documentations\
>

you may consider using the helpers
convertToURL and convertFromURL

> please check the string value REMMARKED with PROBLEM. I couln't get the
> language of running OpenOffice.org...

the finction is not returned correctly

Why? What did I wrong? Also, how
> can I  get the folder of OpenOffice.org (C:/Program Files/OpenOffice.org
> 2.0, /opet/OpenOffice.org 2.0/) ? I need these variables to locates
> samples folder...
>

try this

ServiceSubst = CreateUnoService("com.sun.star.util.PathSubstitution")
cheminOOO=ConvertFromURL(leServiceSubst.substituteVariables("$(insturl)",
true))

look at this
http://api.openoffice.org/docs/common/ref/com/sun/star/util/PathSubstitution.html

HTH

Laurent


--
Laurent Godard <[hidden email]> - Ingénierie OpenOffice.org
Indesko >> http://www.indesko.com
Nuxeo CPS >> http://www.nuxeo.com - http://www.cps-project.org
Livre "Programmation OpenOffice.org", Eyrolles 2004

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adding extra menu element to HELP menu that opens a document from samples

Laurent Godard-3
Hi kami

> ServiceSubst = CreateUnoService("com.sun.star.util.PathSubstitution")
> cheminOOO=ConvertFromURL(leServiceSubst.substituteVariables("$(insturl)",
> true))  
>
> look at this
> http://api.openoffice.org/docs/common/ref/com/sun/star/util/PathSubstitution.html 

i did not clean correctly
this should work

Sub Main

ServiceSubst = CreateUnoService("com.sun.star.util.PathSubstitution")
theOOoPath=ConvertFromURL(ServiceSubst.substituteVariables("$(insturl)",
true))
print theOOoPath

end sub

--
Laurent Godard <[hidden email]> - Ingénierie OpenOffice.org
Indesko >> http://www.indesko.com
Nuxeo CPS >> http://www.nuxeo.com - http://www.cps-project.org
Livre "Programmation OpenOffice.org", Eyrolles 2004

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]