Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365633 - Register entrypoints by path instead of name
Summary: Register entrypoints by path instead of name
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.5   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-05 11:58 EST by Ralf Sternberg CLA
Modified: 2012-02-18 15:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Sternberg CLA 2011-12-05 11:58:05 EST
Usually, application entrypoints should be available at a certain path. Currently, for an entrypoint to be available at the path "/context/dashboard" (with "/context" being the application's path), it has to be registered like this:

  public void configure( ApplicationConfiguration configuration ) {
    configuration.addEntryPoint( "default", EntryPoint.class );
    configuration.addBranding( new AbstractBranding() {
      public String getServletName() {
        return "dashboard";
      }
    } );
  }

I think that the registration path is more a matter of the entrypoint registration than of the branding. Therefore, I would propose to change the semantics of the addEntryPoint methods to accept the path as their first parameter:

  void addEntryPoint( String path, Class<? extends IEntryPoint> entryPointType );
  void addEntryPoint( String path, IEntryPointFactory entryPointFactory );

This would reduce the above code to:

  public void configure( ApplicationConfiguration configuration ) {
    configuration.addEntryPoint( "dashboard", EntryPoint.class );
  }

If we follow this proposal, this would render some methods in AbstractBranding obsolete. I'd suggest to address this in a separate bug.
Comment 1 Ralf Sternberg CLA 2012-02-18 15:04:56 EST
Changed ApplicationConfiguration to accept *paths instead of names* in registerEntryPoint().  The paths must follow the same pattern as used in HttpService's register methods. They must begin with a slash, but not end with a slash. Currently, neither the root path ("/") nor nested paths are supported. Here's an example of registering an entry point to be accessible at http://host/dashboard :

public void configure( ApplicationConfiguration configuration ) {
  configuration.addEntryPoint( "/dashboard", DashboardEntryPoint.class );
}

Added a "path" attribute to the entrypoint extension point and deprecated the old "parameter" attribute.

With these changes in place, entry points should not be registered by name anymore (see also bug 371935).