Example #1
0
 public HttpActionFuture(IHttpAction action)
     : base(action.Listener)
 {
     _httpAction              = action;
     _httpAction.Listener     = Listener;
     _httpAction.ActionFuture = this;
 }
Example #2
0
 public HttpActor(HttpActorType type, QQContext context, IHttpAction action, QQHttpResponse response)
 {
     _type     = type;
     _context  = context;
     _action   = action;
     _response = response;
 }
Example #3
0
 public HttpActionFuture(IHttpAction action)
     : base(action.Listener)
 {
     _httpAction = action;
     _httpAction.Listener = Listener;
     _httpAction.ActionFuture = this;
 }
Example #4
0
        public IQQActionFuture PushHttpAction(IHttpAction action)
        {
            var future = new HttpActionFuture(action);          //替换掉原始的QQActionListener

            Context.PushActor(new HttpActor(HttpActorType.BuildRequest, Context, action));
            return(future);
        }
Example #5
0
        public QQActionFuture PushHttpAction(IHttpAction action)
        {
            QQActionFuture future = new HttpActionFuture(action);               //替换掉原始的QQActionListener

            this.Context.PushActor(new HttpActor(HttpActorType.BUILD_REQUEST, this.Context, action));
            return(future);
        }
Example #6
0
 public HttpActionFuture(IHttpAction action)
     : base(action.Listener)
 {
     this.httpAction = action;
     this.httpAction.Listener = this.Listener;
     this.httpAction.ActionFuture = this;
 }
Example #7
0
 public HttpActionFuture(IHttpAction action)
     : base(action.Listener)
 {
     this.httpAction              = action;
     this.httpAction.Listener     = this.Listener;
     this.httpAction.ActionFuture = this;
 }
Example #8
0
 public HttpActor(HttpActorType type, QQContext context, IHttpAction action, Exception throwable)
 {
     _type      = type;
     _context   = context;
     _action    = action;
     _throwable = throwable;
 }
Example #9
0
 public HttpActor(HttpActorType type, QQContext context, IHttpAction action, long current, long total)
 {
     _type    = type;
     _context = context;
     _action  = action;
     _current = current;
     _total   = total;
 }
Example #10
0
        public byte[] GetResponse(IHttpAction httpAction)
        {
            if (httpAction.Object != null)
            {
                var serializer = SerializerRegistry.Get(Request.GetField("Accept"));

                var datareq = Encoding.UTF8.GetBytes(serializer.Serialize(httpAction.Object, httpAction.Object.GetType()));

                Response = new Response(ResponseStatus.Get(httpAction.Code), datareq);
                Response.Fields.Add("Content-Type", serializer.Mime);
            }
            else
            {
                Response = new Response(ResponseStatus.Get(httpAction.Code), null);
            }

            return(CreateByteResponse());
        }
Example #11
0
 public HttpActor(HttpActorType type, IQQContext context, IHttpAction action)
 {
     _type = type;
     _context = context;
     _action = action;
 }
Example #12
0
        private static IHttpAction CreateActionPrivate(IHttpActionContext actionContext, IHttpActionFactory actionFactory, NodeHead requestedNode, string requestedActionName, string requestedApplicationNodePath, string requestedDevice)
        {
            IHttpAction action = null;

            var factory       = actionFactory ?? actionContext.GetActionFactory();
            var contextNode   = requestedNode ?? actionContext.GetRequestedNode();
            var actionName    = requestedActionName ?? actionContext.RequestedActionName;
            var appNodePath   = requestedApplicationNodePath ?? actionContext.RequestedApplicationNodePath;
            var portalContext = (PortalContext)actionContext;

            // ================================================= #1: preconditions

            action = GetODataAction(factory, portalContext, contextNode);
            if (action != null)
            {
                return(action);
            }

            // webdav request?
            action = GetWebdavAction(factory, portalContext, contextNode);
            if (action != null)
            {
                return(action);
            }

            // ----------------------------------------------- forward to start page if context is a Site

            action = GetSiteStartPageAction(factory, portalContext, contextNode);
            if (action != null)
            {
                return(action);
            }

            // ----------------------------------------------- smart url

            action = GetSmartUrlAction(factory, portalContext, contextNode);
            if (action != null)
            {
                return(action);
            }

            // ----------------------------------------------- outer resource

            action = GetExternalResourceAction(factory, portalContext, contextNode);
            if (action != null)
            {
                return(action);
            }

            // ----------------------------------------------- context is external page

            action = GetExternalPageAction(factory, portalContext, contextNode, actionName, appNodePath);
            if (action != null)
            {
                return(action);
            }

            // ----------------------------------------------- context is IHttpHandlerNode

            if (string.IsNullOrEmpty(actionName))
            {
                action = GetIHttpHandlerAction(factory, portalContext, contextNode, contextNode);
                if (action != null)
                {
                    return(action);
                }
            }

            // ----------------------------------------------- default context action

            action = GetDefaultContextAction(factory, portalContext, contextNode, actionName, appNodePath);
            if (action != null)
            {
                return(action);
            }

            // ================================================= #2: FindApplication(node, action);

            var appNode = FindApplication(contextNode, actionName, appNodePath, actionContext.DeviceName);

            if (appNode == null)
            {
                return(factory.CreateRewriteAction(actionContext, contextNode, null, GetRewritePath(contextNode, portalContext)));
            }

            // ----------------------------------------------- AppNode is IHttpHandlerNode

            action = GetIHttpHandlerAction(factory, portalContext, contextNode, appNode);
            if (action != null)
            {
                return(action);
            }

            // ----------------------------------------------- page and site

            return(factory.CreateRewriteAction(actionContext, contextNode, appNode, GetRewritePath(appNode, portalContext)));
        }
 protected BaseSaveDocumentCollection( IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer ) 
     : base( action, configuration, serializer )
 {
 }
Example #14
0
 public ChangeStreamCommand(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer)
     : base(action, configuration, serializer)
 {
 }
Example #15
0
 public IQQActionFuture PushHttpAction(IHttpAction action)
 {
     var future = new HttpActionFuture(action);	 	//替换掉原始的QQActionListener
     Context.PushActor(new HttpActor(HttpActorType.BuildRequest, Context, action));
     return future;
 }
 public GetFromViewCommand(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer)
     : base(action, configuration, serializer)
 {
 }
Example #17
0
 public HttpAdaptor(IQQContext context, IHttpAction action)
 {
     _context = context;
     _action  = action;
 }
Example #18
0
 public HttpActor(HttpActorType type, QQContext context, IHttpAction action)
 {
     _type    = type;
     _context = context;
     _action  = action;
 }
Example #19
0
 protected static void WireUpCommandMock(IHttpAction commandMock)
 {
     var mock = Assimilate.GetAllInstancesOf<IHttpAction>();
     
     Assimilate.Dependencies( x => x.For<IHttpAction>().Use( commandMock ) );
 }
 public DeleteAttachmentCommand(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer)
     : base(action, configuration, serializer)
 {
 }
Example #21
0
        private static IHttpAction CreateActionPrivate(IHttpActionContext actionContext, IHttpActionFactory actionFactory, NodeHead requestedNode, string requestedActionName, string requestedApplicationNodePath, string requestedDevice)
        {
            IHttpAction action = null;

            var factory       = actionFactory ?? actionContext.GetActionFactory();
            var contextNode   = requestedNode ?? actionContext.GetRequestedNode();
            var actionName    = requestedActionName ?? actionContext.RequestedActionName;
            var appNodePath   = requestedApplicationNodePath ?? actionContext.RequestedApplicationNodePath;
            var portalContext = (PortalContext)actionContext;

            //================================================= #1: preconditions

            action = GetFirstRunAction(factory, portalContext, contextNode);
            if (action != null)
            {
                return(action);
            }

            // webdav request?
            action = GetWebdavAction(factory, portalContext, contextNode);
            if (action != null)
            {
                return(action);
            }

            /*
             * //---- Uncomment and recompile to support *.SVC on IIS5.1
             * action = (GetIIS5SVCRequestAction(portalContext, httpContext));
             * if (action != null)
             *  return action;
             */

            //----------------------------------------------- forward to start page if context is a Site

            action = GetSiteStartPageAction(factory, portalContext, contextNode);
            if (action != null)
            {
                return(action);
            }

            //----------------------------------------------- smart url

            action = GetSmartUrlAction(factory, portalContext, contextNode);
            if (action != null)
            {
                return(action);
            }

            //----------------------------------------------- outer resource

            action = GetExternalResourceAction(factory, portalContext, contextNode);
            if (action != null)
            {
                return(action);
            }

            //----------------------------------------------- context is external page

            action = GetExternalPageAction(factory, portalContext, contextNode, actionName, appNodePath);
            if (action != null)
            {
                return(action);
            }

            //----------------------------------------------- context is IHttpHandlerNode

            if (string.IsNullOrEmpty(actionName))
            {
                action = GetIHttpHandlerAction(factory, portalContext, contextNode, contextNode);
                if (action != null)
                {
                    return(action);
                }
            }

            //----------------------------------------------- default context action

            action = GetDefaultContextAction(factory, portalContext, contextNode, actionName, appNodePath);
            if (action != null)
            {
                return(action);
            }

            //================================================= #2: FindApplication(node, action);

            var appNode = FindApplication(contextNode, actionName, appNodePath, actionContext.DeviceName);

            if (appNode == null)
            {
                return(factory.CreateRewriteAction(actionContext, contextNode, null, GetRewritePath(contextNode, portalContext)));
            }

            portalContext.BackwardCompatibility_SetPageRepositoryPath(appNode.Path);

            //-----------------------------------------------

            //TODO: appNode external page check?

            //----------------------------------------------- AppNode is IHttpHandlerNode

            action = GetIHttpHandlerAction(factory, portalContext, contextNode, appNode);
            if (action != null)
            {
                return(action);
            }

            //----------------------------------------------- page and site

            return(factory.CreateRewriteAction(actionContext, contextNode, appNode, GetRewritePath(appNode, portalContext)));
        }
Example #22
0
 public HttpAdaptor(IQQContext context, IHttpAction action)
 {
     _context = context;
     _action = action;
 }
Example #23
0
 public HttpActor(HttpActorType type, IQQContext context, IHttpAction action, long current, long total)
 {
     _type = type;
     _context = context;
     _action = action;
     _current = current;
     _total = total;
 }
Example #24
0
 public HttpActor(HttpActorType type, IQQContext context, IHttpAction action, Exception throwable)
 {
     _type = type;
     _context = context;
     _action = action;
     _throwable = throwable;
 }
Example #25
0
 protected BaseSaveDocumentCollection(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer)
     : base(action, configuration, serializer)
 {
 }
Example #26
0
 public HttpActor(HttpActorType type, IQQContext context, IHttpAction action, QQHttpResponse response)
 {
     _type = type;
     _context = context;
     _action = action;
     _response = response;
 }
Example #27
0
 public HttpAdaptor(QQContext context, IHttpAction action)
 {
     this.context = context;
     this.action  = action;
 }
Example #28
0
 public SaveDocumentListCommand(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer)
     : base(action, configuration, serializer)
 {
 }
Example #29
0
        protected static void WireUpCommandMock(IHttpAction commandMock)
        {
            var mock = Assimilate.GetAllInstancesOf <IHttpAction>();

            Assimilate.Dependencies(x => x.For <IHttpAction>().Use(commandMock));
        }
Example #30
0
 protected BaseCouchCommand(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer)
 {
     this.action        = action;
     this.configuration = configuration;
     this.serializer    = serializer;
 }
 public GetAllDocumentsCommand(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer)
     : base(action, configuration, serializer)
 {
 }
Example #32
0
 public QQActionFuture PushHttpAction(IHttpAction action)
 {
     QQActionFuture future = new HttpActionFuture(action);	 	//替换掉原始的QQActionListener
     this.Context.PushActor(new HttpActor(HttpActorType.BUILD_REQUEST, this.Context, action));
     return future;
 }