You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Michael <mi...@destatis.de> on 2010/09/01 12:53:33 UTC

Re: Customization of service list page

Sergey,
I've come across the Jira issue (CXF-1630) and it looks like the stylesheet
is supposed to be CSS. I'm not exactly versed in CSS, but I think there's a
way to prevent content from being displayed. I'll give that a try, but I
assume that the undisplayed content will remain in the html source and thus
can be viewed easily.  

For Tomcat, we've found a workaround: setting proxyName and proxyPort on the
connector does the trick, but our app is deployed in a variety of
containers, so it's not ideal.

I will issue an enhancement request for a server-side solution. For the time
being, since the CXF servlet is supposed to handle the request, is there a
way to gain control over page generation by subclassing it, overriding a
method?

Thanks and Regards,
Michael








-- 
View this message in context: http://cxf.547215.n5.nabble.com/Customization-of-service-list-page-tp2797089p2799182.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Customization of service list page

Posted by lynnifer58 <gr...@upmc.edu>.
I was able to get the service list customized with cxf 2.4.0 thanks to
Sergey's ideas.
Here are some steps I took:

created MyOwnCXFServlet that extends CXFServlet - contains
MyOWnServletController
created MyOwnServletController that extends ServletController  - contains
MyOwnServiceListGeneratorServlet
created MyOwnServiceListGeneratorServlet that extends HttpServlet 
created MyOwnFormattedServiceListWriter that extends
FormattedServiceListWriter

I only modifed the method method createServletController - changed to return
MyOwnServletController in MyOwnCXFServlet
other methods stayed the same.
- init()
- loadBus()
- createSpringContext(ApplicationContext ctx, ServletConfig sc, String
location)
- DestinationRegistry getDestinationRegistryFromBus(Bus bus) 
- invoke(HttpServletRequest request, HttpServletResponse response)

In MyOwnServletController, 
init() now is called on MyOwnSeviceListGeneratorServlet
invoke() now uses MyOwnServiceListGeneratorServlet

In MyOwnServiceListGeneratorServlet, I overroad the service() method to
create a new MyOwnFormattedServiceListWriter.

In MyOwnFormattedServiceListWriter, I overroad the writeServiceList() to
present the service list as I wanted.

Hope this helps anyone trying to do the same thing.  
Thanks,
Lynn




Re: Customization of service list page 
Jun 14, 2011; 12:02pm— by  Sergey Beryozkin-5 
Hi, 
I can see serviceListGenerator code has been hidden behind HttpServlet 
now, so not sure what to advise now. 
Default  serviceListGenerator servlet can not be extended, so perhaps 
the simplest option is to override 
ServletController.invoke, check if it's /services and if yes then 
handle it otherwise delegate to superclass? 

Cheers, Sergey 



--
View this message in context: http://cxf.547215.n5.nabble.com/Customization-of-service-list-page-tp2797089p4529099.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Customization of service list page

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi,
I can see serviceListGenerator code has been hidden behind HttpServlet
now, so not sure what to advise now.
Default  serviceListGenerator servlet can not be extended, so perhaps
the simplest option is to override
ServletController.invoke, check if it's /services and if yes then
handle it otherwise delegate to superclass?

Cheers, Sergey

On Tue, Jun 14, 2011 at 3:34 PM, lynnifer58 <gr...@upmc.edu> wrote:
> I'm also trying to do as Sergey suggested above to customize the service list
> page.
>
> I'm using apache cxf 2.4.0 and I'm working on modifying the
> ServletController, but I'm not seeing a generateServiceList() or
> getServletDestinations() methods anymore in order to override them.
>
> Are there other classes/methods I should be using?   Any examples would be
> most helpful!
>
> thanks,
> Lynn
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Customization-of-service-list-page-tp2797089p4488030.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

Re: Customization of service list page

Posted by lynnifer58 <gr...@upmc.edu>.
I'm also trying to do as Sergey suggested above to customize the service list
page.

I'm using apache cxf 2.4.0 and I'm working on modifying the
ServletController, but I'm not seeing a generateServiceList() or
getServletDestinations() methods anymore in order to override them.

Are there other classes/methods I should be using?   Any examples would be
most helpful!

thanks,
Lynn





--
View this message in context: http://cxf.547215.n5.nabble.com/Customization-of-service-list-page-tp2797089p4488030.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Customization of service list page

Posted by myerscb <my...@upmc.edu>.
Hi,

has any one gotten anywhere with this?  I am wanting to do the same thing
and was looking for examples on how to accomplish it.

Thanks,

Chris

--
View this message in context: http://cxf.547215.n5.nabble.com/Customization-of-service-list-page-tp2797089p4484233.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Customization of service list page

Posted by Michael <mi...@destatis.de>.
Dan,


Daniel  Kulp wrote:
> 
> And patches are more than welcome to make any of this easier or more 
> configurable.  :-)
> 

I will see what I can do, first thing I'll trying to implement a solution
according to
Sergey's proposal. Since I use XSLT a lot, I may try to serialize content
into an
XML String and have that transformed by an XSLT stylesheet, using a default
instance that resides alongside the the CXFServlet subclass or one pointed
to
by 'service-list-stylesheet'.

But that's just one idea.

Michael

-- 
View this message in context: http://cxf.547215.n5.nabble.com/Customization-of-service-list-page-tp2797089p2800367.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Customization of service list page

Posted by Daniel Kulp <dk...@apache.org>.

Michael,

Sergey forgot to say:

And patches are more than welcome to make any of this easier or more 
configurable.  :-)

Dan


On Wednesday 01 September 2010 10:59:00 am Sergey Beryozkin wrote:
> Hi
> 
> On Wed, Sep 1, 2010 at 11:53 AM, Michael 
<mi...@destatis.de>wrote:
> > Sergey,
> > I've come across the Jira issue (CXF-1630) and it looks like the
> > stylesheet is supposed to be CSS. I'm not exactly versed in CSS, but I
> > think there's a way to prevent content from being displayed. I'll give
> > that a try, but I assume that the undisplayed content will remain in the
> > html source and thus can be viewed easily.
> > 
> > For Tomcat, we've found a workaround: setting proxyName and proxyPort on
> > the
> > connector does the trick, but our app is deployed in a variety of
> > containers, so it's not ideal.
> > 
> > I will issue an enhancement request for a server-side solution. For the
> > time
> > being, since the CXF servlet is supposed to handle the request, is there
> > a way to gain control over page generation by subclassing it, overriding
> > a method?
> > 
> > Yes, a bit of work is needed but this can be done.
> 
> First, CXFServlet's createServletController needs to be overridden and a
> custom ServletController delegating to the one created by superclass be
> introduced. This custom controller needs to override generateServiceList
> and use getServletDestinations() to get a list of destinations inside that
> method, this list will let you get to endpoint details...
> 
> hope it helps a bit
> Sergey
> 
> > Thanks and Regards,
> > Michael
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > --
> > View this message in context:
> > http://cxf.547215.n5.nabble.com/Customization-of-service-list-page-tp2797
> > 089p2799182.html Sent from the cxf-user mailing list archive at
> > Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: Customization of service list page

Posted by Michael <mi...@destatis.de>.
Sergey,
this doesn't sound too complicated, not even to me.. I'll try that out and
let you know
about the outcome, however, this will not be before November, since we have
a
workaround so other things take priority.
Thanks a lot,
Michael

-- 
View this message in context: http://cxf.547215.n5.nabble.com/Customization-of-service-list-page-tp2797089p2800356.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Customization of service list page

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

On Wed, Sep 1, 2010 at 11:53 AM, Michael <mi...@destatis.de>wrote:

>
> Sergey,
> I've come across the Jira issue (CXF-1630) and it looks like the stylesheet
> is supposed to be CSS. I'm not exactly versed in CSS, but I think there's a
> way to prevent content from being displayed. I'll give that a try, but I
> assume that the undisplayed content will remain in the html source and thus
> can be viewed easily.
>
> For Tomcat, we've found a workaround: setting proxyName and proxyPort on
> the
> connector does the trick, but our app is deployed in a variety of
> containers, so it's not ideal.
>
> I will issue an enhancement request for a server-side solution. For the
> time
> being, since the CXF servlet is supposed to handle the request, is there a
> way to gain control over page generation by subclassing it, overriding a
> method?
>
> Yes, a bit of work is needed but this can be done.
First, CXFServlet's createServletController needs to be overridden and a
custom ServletController delegating to the one created by superclass be
introduced. This custom controller needs to override generateServiceList and
use getServletDestinations() to get a list of destinations inside that
method, this list will let you get to endpoint details...

hope it helps a bit
Sergey


> Thanks and Regards,
> Michael
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Customization-of-service-list-page-tp2797089p2799182.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>