On Mon, Dec 27, 2010 at 4:52 PM, Douglas Hubler <[email protected]> wrote:
> On Mon, Dec 27, 2010 at 8:18 AM, George Niculae <[email protected]> wrote:
>> On Mon, Dec 27, 2010 at 3:08 PM, Levend Sayar <[email protected]> wrote:
>>> Hi, all.
>>> I
>>> followed http://wiki.sipfoundry.org/display/sipXecs/How+to+create+a+simple+page+in+sipXconfig
>>> and added a page.
>>> On my page, I have a textbox that must be filled with a data read from a usb
>>> hardware. I have the java class that can access that hardware.
>>> I do not know any beans, tapestry, spring etc. technology used in
>>> sipxconfig.
>>> So can you help me for adding my java class in sipxconfig and use it in
>>> sipxconfig context ?
>>
>> Declare your class that access hardware as a spring bean (in one of
>> the xml files used by spring to create the context, see
>> sipxconfig-web/context/WEB-INF/web.xml, contextConfigLocation
>> param-value), e.g. :
>> <bean id="classThatAccessHardware"
>> class="org.sipfoundry.sipxconfig.common.MyClass"/>
>>
>> then inject it in Tapestry page as:
>>
>>   �...@injectobject("spring:classThatAccessHardware")
>>    public abstract MyClass getMyClass();
>>
>> Then populate your textbox as: getMyClass().callMyMethod()
>
> What about if the page is not part of sipxconfig, but inside a plugin
> jar?  Is there a way to dynamically register pages w/tapestry? or even
> store files in separate locations?

Yes, we can add a Tapestry  ISpecificationResolverDelegate to look in
classpath for such plugin pages:
http://tapestry.apache.org/tapestry4/tapestry/apidocs/org/apache/tapestry/resolver/ISpecificationResolverDelegate.html

George
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev/

Reply via email to