Beispiel #1
0
        internal string CreateActionUrl(string relativeUrl)
        {
            relativeUrl = ResolveClientUrlInternal(relativeUrl);

            FacesContext faces = getFacesContext();

            if (faces == null)
            {
                return(relativeUrl);
            }

            string url;

            if (relativeUrl.IndexOf(':') >= 0)
            {
                url = ResolveAppRelativeFromFullPath(relativeUrl);
            }
            else if (VirtualPathUtility.IsAbsolute(relativeUrl))
            {
                url = VirtualPathUtility.ToAppRelative(relativeUrl);
            }
            else
            {
                return(faces.getApplication().getViewHandler().getActionURL(faces, relativeUrl));
            }


            if (VirtualPathUtility.IsAppRelative(url))
            {
                url = url.Substring(1);
                url = url.Length == 0 ? "/" : url;
                return(faces.getApplication().getViewHandler().getActionURL(faces, url));
            }
            return(relativeUrl);
        }
        public override void writeState(FacesContext facesContext)
        {
            StateManager manager = facesContext.getApplication().getStateManager();

            StateManager.SerializedView serializedView = manager.saveSerializedView(facesContext);
            manager.writeState(facesContext, serializedView);
        }
		protected override void restoreComponentState (FacesContext facesContext,
												  javax.faces.component.UIViewRoot uiViewRoot,
												  String renderKitId) {

			Trace.WriteLine ("Entering restoreComponentState");

			Object serializedComponentStates;
			if (isSavingStateInClient (facesContext)) {
				serializedComponentStates = GetStateFromClient (facesContext, uiViewRoot.getViewId(), renderKitId);
			}
			else {
				HttpSession session = (HttpSession) facesContext.getExternalContext ().getSession (false);
				if (session == null)
					serializedComponentStates = null;
				else {
					string key = ((IExtendedViewHandler) facesContext.getApplication ().getViewHandler ()).EncodeNamespace (facesContext, VIEWSTATE);
					SerializedView serializedView = session.getAttribute (key) as SerializedView;
					if (serializedView == null)
						serializedComponentStates = null;
					else
						serializedComponentStates = serializedView.getState ();
				}
			}
			((UIComponent) uiViewRoot.getChildren ().get (0)).processRestoreState (facesContext, serializedComponentStates);

			Trace.WriteLine ("Exiting restoreComponentState");
		}
		public override void writeState (FacesContext facesContext, StateManager.SerializedView serializedView) {
			Trace.WriteLine ("Entering writeState");

			if (serializedView != null) {
				if (isSavingStateInClient (facesContext)) {
					SaveStateInClient (facesContext, serializedView);
				}
				else {
					HttpSession session = (HttpSession) facesContext.getExternalContext ().getSession (true);
					string key = ((IExtendedViewHandler) facesContext.getApplication ().getViewHandler ()).EncodeNamespace (facesContext, VIEWSTATE);
					session.setAttribute (key, serializedView);
				}
			}

			Trace.WriteLine ("Exiting writeState");
		}
        public override void writeState(FacesContext facesContext, StateManager.SerializedView serializedView)
        {
            Trace.WriteLine("Entering writeState");

            if (serializedView != null)
            {
                if (isSavingStateInClient(facesContext))
                {
                    SaveStateInClient(facesContext, serializedView);
                }
                else
                {
                    HttpSession session = (HttpSession)facesContext.getExternalContext().getSession(true);
                    string      key     = ((IExtendedViewHandler)facesContext.getApplication().getViewHandler()).EncodeNamespace(facesContext, VIEWSTATE);
                    session.setAttribute(key, serializedView);
                }
            }

            Trace.WriteLine("Exiting writeState");
        }
        protected override void restoreComponentState(FacesContext facesContext,
                                                      javax.faces.component.UIViewRoot uiViewRoot,
                                                      String renderKitId)
        {
            Trace.WriteLine("Entering restoreComponentState");

            Object serializedComponentStates;

            if (isSavingStateInClient(facesContext))
            {
                serializedComponentStates = GetStateFromClient(facesContext, uiViewRoot.getViewId(), renderKitId);
            }
            else
            {
                HttpSession session = (HttpSession)facesContext.getExternalContext().getSession(false);
                if (session == null)
                {
                    serializedComponentStates = null;
                }
                else
                {
                    string         key            = ((IExtendedViewHandler)facesContext.getApplication().getViewHandler()).EncodeNamespace(facesContext, VIEWSTATE);
                    SerializedView serializedView = session.getAttribute(key) as SerializedView;
                    if (serializedView == null)
                    {
                        serializedComponentStates = null;
                    }
                    else
                    {
                        serializedComponentStates = serializedView.getState();
                    }
                }
            }
            ((UIComponent)uiViewRoot.getChildren().get(0)).processRestoreState(facesContext, serializedComponentStates);

            Trace.WriteLine("Exiting restoreComponentState");
        }
Beispiel #7
0
		public override void writeState (FacesContext facesContext) {
			StateManager manager = facesContext.getApplication ().getStateManager ();
			StateManager.SerializedView serializedView = manager.saveSerializedView (facesContext);
			manager.writeState (facesContext, serializedView);
		}
Beispiel #8
0
 protected override sealed UIViewRoot restoreTreeStructure(FacesContext facesContext, string viewId, string renderKitId)
 {
     return(facesContext.getApplication().getViewHandler().createView(facesContext, viewId));
 }
Beispiel #9
0
 public override javax.faces.application.Application getApplication()
 {
     return(_facesContex.getApplication());
 }
Beispiel #10
0
		protected override sealed UIViewRoot restoreTreeStructure (FacesContext facesContext, string viewId, string renderKitId) {
			return facesContext.getApplication ().getViewHandler ().createView (facesContext, viewId);
		}