Re: Are there changes to the resourceURL 's ?

Carsten Driesner <[email protected]> Wed, 05 Jan 2011 11:58:57 +0100
Newsgroups gmane.comp.openoffice.devel.api
Message-ID <[email protected]>
On 22.12.2010 10:25, Fernand Vanrie wrote:
> Ariel ,
>
> Thanks for this extended explaination, now i now where to look and go.
>
> But no the namings are correct, and the relevant to the xml files in the
> places you told.
>
> the code start with making a emnumration for the resourceURL's par module:
>
> For Each x in oFrame.LayoutManager.getElements()>> gives me all the
> correct ResourceURL's
>
> then is choose manualy the right one, in my case
> "private:resource/toolbar/standardbar"
>
> then i follow the code and
>
> oToolbarSettings =
> oCfgManager.getSettings("private:resource/toolbar/standardbar", true)
>
> gives me the error that there is no such element in the container ??
>
> so what is the resourceURL for oCfgManager.getSettings(
> "private:resource/toolbar/standardbar" , true)
>
> the DEVguide says:
>
> a resource URL which identifies the user interface element. A resourcce
> URL must
> meet the following syntax: "private:resource/$type/$name. It is only
> allowed to
> use ascii characters for type and name.
>
> here $type = "toolbar" and $name = "standardbar"
>
> smiles like a bug (i run OOO330m17 on Windows)

Hi Fernand,

This is not a bug but you use the wrong UI configuration manager. 
oCfgManager = oDoc.getUIConfigurationManager() provides you the UI 
configuration manager of the DOCUMENT! Normally the document contains no 
UI configuration element data. You have to retrieve the module UI 
configuration manager or you can go the way via the Layout Manager.

Regards,
Carsten

--
Example to retrieve the module UI configuration manager.
REM *** Retrieve the module configuration manager from central module 
configuration manager supplier
oModuleCfgMgrSupplier = 
createUnoService("com.sun.star.ui.ModuleUIConfigurationManagerSupplier")

REM *** Retrieve the module configuration manager with module identifier
REM *** See com.sun.star.frame.ModuleManager for more information
oModuleCfgMgr = oModuleCfgMgrSupplier.getUIConfigurationManager( 
"com.sun.star.text.TextDocument" )
oSettings = oModuleCfgMgr.getSettings( 
"private:resource/toolbar/standardbar", true )