Modify

Ticket #15 (closed enhancement: fixed)

Opened 4 years ago

Last modified 20 months ago

Provide a remote adapter for Mach-II event handling (Endpoints)

Reported by: sean@… Owned by: peterfarrell
Priority: major Milestone: Mach-II 1.9.0 Milestone 2
Component: framework - core Version: 1.9.0 - Framework
Keywords: remoteAdapter, AJAX, endpoint Cc: brianmeloche@…, kurt_wiersma, matt_woodward, brian_fitzgerald, mike_rogers, adrian_scott, doug.smith@…, jorge_loyo
Blocked By: Blocking: #452

Description

ColdBox? and Model-Glue both recently added a remote API that allows the event handling mechanism to be initiated by AJAX or Flex or a Web Service. They expose a remote API that acts as an alternative entry point for requests so that a Flex application, for example, can pass an event name and arguments and have them processed by the framework's existing event model.

The biggest decision to make is how results should be returned. I think the Model-Glue adapter returns a specific response object populated from the final event object (and it also catches any exceptions thrown so those can be returned cleanly to the client). I'm not sure how ColdBox? achieves this.

Attachments

Change History

comment:1 Changed 4 years ago by peterfarrell

  • Status changed from new to assigned
  • Version changed from 1.5.0 to Uncategorized

I'm accepting this ticket for consideration. I put it in the Uncategorized versions since if this came to be, I have no clue it would happen.

comment:2 Changed 4 years ago by Brian Meloche <brianmeloche@…>

+1 here. Like I said on the Google Group, we may end up building something to do this. If we do, and something is not built otherwise, I'll submit it for consideration.

comment:1 Changed 4 years ago by peterfarrell

  • Cc brianmeloche@… added
  • Version changed from Uncategorized to 2.0
  • Ticket cleanup and updated ticket
  • Assigned to version 2.0 for consideration

comment:1 Changed 4 years ago by peterfarrell

  • Owner peterfarrell deleted
  • Status changed from assigned to new

comment:1 Changed 4 years ago by peterfarrell

  • Version changed from 2.0.0 to Uncategorized

comment:1 Changed 3 years ago by peterfarrell

  • Cc kurtwiersma, mattwoodward, brianfitzgerald added
  • Keywords remoteAdapter, AJAX, added

Just bumping the ticket here. I'm not sure if Mach-II is the best place for Flex class (as I would assume most people use <mx:RemoteObject>), but AJAX integration is definitely something we are looking at. I'm not sure if will have enough time to fit this into the 1.8 release schedule. Brian did you guys ever end up implementing anything?

I have a few ideas of my own on this, but would rather hear how others have done it before (other than just calling a Mach-II event straight up and using filters etc).

comment:1 Changed 3 years ago by peterfarrell

FYI, check out ticket #99 which also requests better AJAX integration as well.

comment:2 Changed 3 years ago by kurtwiersma

  • hours set to 0
  • estimatedhours set to 0
  • totalhours set to 0
  • billable set to 1

I like Peter's idea of having a some type of request type indicator that would let us handle or at least detect ajax requests and then handle them in a special way that is helpful for developers. I find that when I develop ajax apps I usually end up having my ajax calls request a Mach II event and in that event I get a event arg and skip my main layout file if I just need to return html. If I need to return json or xml I find I have to setup a completely separate event handler or use CF 8's new abilities to return data from a cfc call directly rather then go through Mach II.

As for Flex I don't think Mach II needs to add support for handling Flex remoting calls. Those should be handled by your service layer. If you are returning xml to Flex then I think you could use what ever mechanism we come up with for handleing ajax or REST calls.

comment:3 Changed 2 years ago by peterfarrell

  • Status changed from new to assigned
  • Cc mikerogers, adrianscott added
  • Owner set to peterfarrell
  • Version changed from Uncategorized - Framework to 1.9.0 - Framework
  • Milestone set to Mach-II 1.9.0 alpha
  • Keywords endpoint added

I believe this issue will be solve by the addition of endpoints. We only have a rough working document currently, however we'll share more information on endpoints in near future as the details are become more worked out.

comment:4 Changed 2 years ago by peterfarrell

  • Blocking 452 added

(In #452) this will probably be solved by using Mach-II endpoints which we are architecting for Mach-II Integrity (1.9). See ticket #15 to track the progress.

comment:11 Changed 2 years ago by peterfarrell

  • Summary changed from Provide a remote adapter for Mach-II event handling to Provide a remote adapter for Mach-II event handling (Endpoints)

See our discussion for feature Endpoints

comment:12 Changed 2 years ago by peterfarrell

  • Milestone changed from Mach-II 1.9.0 Un-Targeted to Mach-II 1.9.0 Milestone 3

comment:13 Changed 2 years ago by peterfarrell

  • Cc doug.smith@… added

We've added a M2SFP document on MachII1.9Endpoints? for those your interested.

comment:14 Changed 2 years ago by peterfarrell

The link for that wiki article is endpoints.

comment:15 Changed 2 years ago by doug_smith

(In [2231]) Initial commit of functional REST Endpoint, with connections into RequestHandler?. refs #15

comment:16 Changed 2 years ago by doug_smith

(In [2234]) Fix REST class path references following Peter's refactoring. refs #15

comment:17 Changed 2 years ago by doug_smith

(In [2235]) Add raw HTTP request content to REST endpoint event args as rawContent. refs #15

comment:18 Changed 2 years ago by peterjfarrell

(In [2236]) - Got some better plumbing work in. Now endpoints respond to index.cfm/eventpoint/file/param1/value1 or index.cfm?eventpoint=file&param1=value1 or /api/index.cfm/value1/ (REST style). Only a simple re-write rule is required to rid yourself of that pesky index.cfm in the url. refs #15

comment:19 Changed 2 years ago by peterjfarrell

(In [2237]) Added support to have multiple tokens per "/" space for the REST RegEx?-ing patterns. So things like /api/content/{key}.{returnFormat} works. It appears from a general survey of REST based APIs that if multiple return formats are supported, that a lot of APIs "supported" it via a file extension (e.g. /api/content/abc123.json or /api/content/abc123.xml). I'm sure I broke something with default "format" that Doug put in, but I couldn't get that work in the first place. refs #15

comment:20 Changed 2 years ago by peterjfarrell

(In [2238]) refs #15

comment:21 Changed 2 years ago by peterjfarrell

(In [2240]) - Added additional request handling for endpoints

  • Added in "depends" and setter method injection for ColdSpring? into Endpoints
  • refs #15

comment:22 Changed 2 years ago by peterjfarrell

(In [2241]) Additional updates

comment:23 Changed 2 years ago by doug_smith

(In [2242]) Fix returnType on setters. refs #15

comment:24 Changed 23 months ago by doug_smith

(In [2243]) Change EndpointManager?.isEndpointRequest() so that it doesn't require a physical file, instead, it determins whether this is an endpoint request based on the first element of the PATH_INFO, or the endpointParameter. Other bug fixes & updated tests. refs #15

comment:25 Changed 23 months ago by doug_smith

(In [2245]) Add optional "throw" parameter to allow an exception to render in the browser. refs #15

comment:26 Changed 23 months ago by doug_smith

(In [2248]) Add logic that converts rawContent from binary/byte array to String, only add it when POST or PUT. refs #15

comment:27 Changed 23 months ago by doug_smith

(In [2252]) Improve logging in EndpointManager? refs #15

comment:28 Changed 22 months ago by doug_smith

(In [2265]) Support URIs with optional ending slash. refs #15

comment:29 Changed 22 months ago by doug_smith

(In [2266]) Move cleanPathInfo() where it should have been. refs #15

comment:30 Changed 22 months ago by peterjfarrell

  • Milestone changed from Mach-II 1.9.0 Milestone 3 to Mach-II 1.9.0 Milestone 2

comment:31 Changed 22 months ago by doug_smith

(In [2271]) Merge REST Endpoint development branch (/1-9-0/branches/20100619_rest) into Mach-II 1.9 trunk (revs 2230:2266). refs #15

comment:32 Changed 22 months ago by doug_smith

(In [2273]) Improve REST endpoint exception handling. refs #15

comment:33 Changed 22 months ago by doug_smith

(In [2296]) Use the new Util.getMimeTypeByFileExtension() method in the REST endpoint. refs #15

comment:34 Changed 22 months ago by doug_smith

(In [2304]) Connect endpoint exception handling method and add automatic content type header to the rest.BaseEndpoint?. refs #15

comment:35 Changed 20 months ago by peterjfarrell

  • Cc kurt_wiersma, matt_woodward, brian_fitzgerald, mike_rogers, adrian_scott, jorge_loyo added; kurtwiersma, mattwoodward, brianfitzgerald, mikerogers, adrianscott removed

Hey Doug, is the wiki entry for REST endpoints good enough to get Milestone 2 out? Or do it need work? Let me know -- I'm sure you're busy after the conference

Also, let me know if you record a presentation on REST. I'm willing to wait a week to get good documentation out on it.

comment:36 Changed 20 months ago by doug_smith

I think the Wiki entry covers the high points, but it also needs more work in some areas. It is probably good enough for Milestone 2, though.

I'm going be recording my presentation next Friday (9/24). I'll let you know how that goes, whether we get a good recording, and will plan to make it available.

comment:37 Changed 20 months ago by peterjfarrell

  • Status changed from assigned to closed
  • Resolution set to fixed

@Doug, sounds good. I'm going to close this ticket. Right now we only have refinements which we can just create new tickets for.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.