cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Gathering Data for the UI (a simple table)

avillanueva
22-Sapphire II

Gathering Data for the UI (a simple table)

Ok, I have a table defined, a bean class and logic on how to generate
the List of beans to display in the table. What I am struggling now is
proper setup to use "getModel" tag in the table model definition,
specifically "serviceName".



Page 13-31 says: "The name of the service class to use to get model
data. This property is mutually exclusive with the queryCommand or
statementSpec attributes. If this attribute is specified, then
methodName must be specified as well. Arguments to the method can be
specified with the addServiceArgument tag. The service class must either
be a registered Windchill service or implement wt.method.RemoteAccess."



Following other services, I created an interface with my method defined
and then wrote a class to implement that interface. In the getModel tab
for service name, I called out the interface and the method name. I
added a line to the services.properties as follows:

wt.services/svc/default/<fully qualified<br="/>interface>/null/java.lang.Object/0=<fully qualified=" implementing<br="/>class>/duplicate



Ok, then I get this error from the system:

java.lang.NoSuchMethodException: <interface class=">.new<interface<br/>class>()

So, it looks like the table just tried to find the class called out in
the service and look for a newClassName method to create the service and
then run it. What I don't understand is that the docs said I had to
register the service yet did not indicate how. I also could not find a
corresponding registration for any class used as an example for the
getModel tag. Those do call out an interface class when an
implementation of that interface in the same package.



My class does extend ServiceManager and does have a new<classname>
static method to create it like the PTC examples. Not sure what I
missed.

3 REPLIES 3

Hi Antonio, Did you register the service in wt.properties file? Put it
at the last with some number that is not already being used. That will make
the service to start during MethodServer startup. If there is a problem with
your service, MethodServer won't come up.
wt.services.service.100000=com.ptc.windchill.partslink.PartsLinkService/com.ptc.windchill.partslink.StandardPartsLinkService

Regards,
Prathap





On Thu, Jul 2, 2009 at 6:24 AM, Villanueva, Antonio <
-> wrote:

> Ok, I have a table defined, a bean class and logic on how to generate the
> List of beans to display in the table. What I am struggling now is proper
> setup to use “getModel” tag in the table model definition, specifically
> “serviceName”.
>
>
>
> Page 13-31 says: *“**The name of the service class to use to get model
> data. This property is mutually exclusive with the queryCommand or
> statementSpec attributes. If this attribute is specified, then methodName
> must be specified as well. Arguments to the method can be specified with the
> addServiceArgument tag. The service class must either be a registered
> Windchill service or implement wt.method.RemoteAccess.**“*
>
> * *
>
> Following other services, I created an interface with my method defined and
> then wrote a class to implement that interface. In the getModel tab for
> service name, I called out the interface and the method name. I added a line
> to the services.properties as follows:
>
> wt.services/svc/default*/<fully qualified=" interface=">/*
> null/java.lang.Object/0*=<fully qualified=" implementing=" class=">/*duplicate
>
>
>
> Ok, then I get this error from the system:
>
> *java.lang.NoSuchMethodException: <interface class=">.new<interface<br/>> class>()*
>
> So, it looks like the table just tried to find the class called out in the
> service and look for a newClassName method to create the service and then
> run it. What I don’t understand is that the docs said I had to register the
> service yet did not indicate how. I also could not find a corresponding
> registration for any class used as an example for the getModel tag. Those do
> call out an interface class when an implementation of that interface in the
> same package.
>
>
>
> My class does extend ServiceManager and does have a new<classname> static
> method to create it like the PTC examples. Not sure what I missed.
>
>
avillanueva
22-Sapphire II
(To:avillanueva)

You use that for listeners as far as I know. Take page 13-27. The
serviceName is "com.ptc.netmarkets.project.NmProjectService" which does
not appears as a numbered service in the wt.protperties file. Is it
defined somewhere else?



PTC Tech Support indicated that I should just call out the class
directly so long as it implements RemoteAccess. So, it would not call
out an interface, but rather a direct service class. Not sure why the
difference. Seems to be the ServiceManager's fall back mechanism.


Here is my understanding about the Windchill services.At a high level
two types of services.
1. Registered service such as the ones defined in the wt.properties file.
All these will start at the Windchill startup
wt.services.service.5=wt.audit.AuditService/wt.audit.StandardAuditService
wt.services.service.10=wt.session.SessionManager/wt.session.StandardSessionManager
wt.services.service.20=wt.fc.PersistenceManager/wt.fc.StandardPersistenceManager

2. Lightweight service - This can again be implemented in two ways.
a. Using Modeled Classes - Interface extends RemoteInterface and
implementation class extends StandardManager. RationalRose automatically
generates the required fwd class.
b. Using Inner Class - This doesn't require modelling . The inner class
needs to implement RemoteAccess interface and should be defined as "public
static class"

It looks to me NmProjectService is using the Modeled LightWeight
Mechanism(2a). If you are trying to use the same mechanism, make sure that
you have the fwd class generated properly with Rational Rose.

Regards,
Prathap





On Thu, Jul 2, 2009 at 11:49 AM, Villanueva, Antonio <
-> wrote:

> You use that for listeners as far as I know. Take page 13-27. The
> serviceName is “com.ptc.netmarkets.project.NmProjectService” which does not
> appears as a numbered service in the wt.protperties file. Is it defined
> somewhere else?
>
>
>
> PTC Tech Support indicated that I should just call out the class directly
> so long as it implements RemoteAccess. So, it would not call out an
> interface, but rather a direct service class. Not sure why the difference.
> Seems to be the ServiceManager’s fall back mechanism.
>
>
Announcements


Top Tags