Thnak you Jürgen,
You reminded me to register the interceptor so I got the interceptor to work 
by reflection by just adding an intercep() method to the original code of 
the OOoViewer.

The method is really quite simple, along the lines of
....
// Set the master dispatcher provider of the interceptor
methSetMaster.invoke(m_objInterceptor, new Object[] {m_objOrgDispatcher});

// Set the frame into the interceptor
methSetFrame.invoke(m_objInterceptor, new Object[] {m_objFrame, 
m_objComponent});

// Register the interceptor
// xRegistration.registerDispatchProviderInterceptor(inter); -- per Jürgen
methRegisterInterceptor.invoke(m_objDispatch, new Object[] 
{m_objInterceptor});

"Jürgen Schmidt" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> ramboid wrote:
>> Joachim Lingner <joachim.lingner <at> sun.com> writes:
>>
>>> ramboid wrote:
>>>> Joachim Lingner <joachim.lingner <at> sun.com> writes:
>>>>
>>>>> Clovis Wichoski wrote:
>>>>>
>>>>> Joachim
>>>>>> TIA
>>>>>>
>>>>>> Clóvis
>>>>>>
>>>> This class also worked very well for me and it appears to provide the
>> solution
>>>> that we were looking for.  How would you suggest that we apply the
>> policies,
>>>> that you uploaded to this project, without having to set the applet
>> runttime
>>>> settings of every PC that will run the applet?
>>>>
>>> There is probably no other way to set the policy manually in the control 
>>> panel. This cannot be done programmatically, because this would allow 
>>> all applets to set access rights as they like.
>>> Maybe a signed applet is the solution. For more information look here:
>>>
>> http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/rsa_signing.ht
>> ml
>>> Joachim
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe <at> openoffice.org
>>>> For additional commands, e-mail: dev-help <at> openoffice.org
>>>>
>> Thank you Joaquim,
>> How would you suggest that I implement an Interceptor for the OOoViewer? 
>> I am running the applet by adding the three classes to a signed jar: two 
>> from the OOoVier and one for the interceptor.  I can invoke the 
>> interceptor by reflection and add the OOoViewer XFrame to the Inerceptor. 
>> However, the Interceptor seems to fail in intercepting events.  When the 
>> applet starts, I see that the icon for the Save button is dimmed (I am 
>> intercepting every event).  I type a few words in the Writer and several 
>> properties are outputted in the Java console.  Afterwards the Save button 
>> is active again and the Save event saves files in the hard disk.
>>
>> I am thinking that I should write my own OOBean with an interceptor 
>> included.  Perhaps I can extend the OOBean and attached the extended 
>> OOBean to an interceptor.  The OOoViewer would work with the custom 
>> OOoBean.
> Thats one solution. You can get the current frame you wanted to intercept, 
> query for XDispatchProviderInterception and register your own Interceptor 
> object, for example something like
>
> XDispatchProvider orgdispatcher = 
> (XDispatchProvider)UnoRuntime.queryInterface(XDispatchProvider.class, 
> frame);
>
> XDispatchProviderInterception xRegistration = 
> (XDispatchProviderInterception)UnoRuntime.queryInterface(XDispatchProviderInterception.class,
>  
> frame);
>
> MyInterceptor inter = new MyInterceptor(/*maybe parameters*/);
>
> // you should store the original dispatcher
> inter.setMasterDispatchProvider(orgdispatcher);
> xRegistration.registerDispatchProviderInterceptor(inter);
>
> ....
>
>
> Juergen
>
>>
>> By the way, I certified the applet and the OOoViewer is working  fine.  I 
>> also altered the policy file that you uploaded to the Attic as follows:
>>
>> grant {
>>   permission java.lang.RuntimePermission "loadLibrary.*";
>>   permission java.io.FilePermission "C:\\Program Files\\OpenOffice.org 
>> 2.0
>> \\program\\*", "read";
>>   permission java.io.FilePermission "C:\\Program Files\\OpenOffice.org 
>> 2.0
>> \\program\\classes\\*", "read";
>>   permission java.util.PropertyPermission "*", "read";
>> };
>>
>> The applet works fine with the less permissive policy.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 



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

Reply via email to