Example #1
0
        protected void SaveStateInClient(FacesContext facesContext, StateManager.SerializedView serializedView)
        {
            //UIViewRoot uiViewRoot = facesContext.getViewRoot ();
            ////save state in response (client-side: full state; server-side: sequence)
            //RenderKit renderKit = RenderKitFactory.getRenderKit (facesContext, uiViewRoot.getRenderKitId ());
            //// not us.
            //renderKit.getResponseStateManager ().writeState (facesContext, serializedView);

            java.io.ByteArrayOutputStream bytearrayoutputstream = new java.io.ByteArrayOutputStream();
            java.io.ObjectOutputStream    objectoutputstream    = new java.io.ObjectOutputStream(bytearrayoutputstream);

            //ignore tree structure
            //objectoutputstream.writeObject (serializedView.getStructure ());
            objectoutputstream.writeObject(serializedView.getState());
            objectoutputstream.close();
            bytearrayoutputstream.close();

            string s =
                @"<div>
	<input type=""hidden"" name="""     + VIEWSTATE + "\" id=\"" + VIEWSTATE + "\" value=\"" +
                Convert.ToBase64String((byte [])vmw.common.TypeUtils.ToByteArray(bytearrayoutputstream.toByteArray())) + @""" />
</div>";

            facesContext.getResponseWriter().write(s);
        }
Example #2
0
 public void Save(Stream stream)
 {
     //FileOutputStream _javastream = new FileOutputStream(filePath);
     java.io.ByteArrayOutputStream byteStream = new java.io.ByteArrayOutputStream();
     java.io.ObjectOutput          objOut     = new DotnetObjectOutputStream(byteStream);
     ((ReteooRuleBase)this._javaRuleBase).writeExternal(objOut);
     stream.Write(byteStream.toByteArray(), 0, byteStream.toByteArray().Length);
     byteStream.close();
 }
Example #3
0
            public override void close()
            {
                int size = _out.size();

                _out.close();

                if (size < _contentLength)
                {
                    throw new IOException("Cannot close stream until all bytes are written.");
                }
            }
Example #4
0
		protected void SaveStateInClient (FacesContext facesContext, StateManager.SerializedView serializedView) {
			//UIViewRoot uiViewRoot = facesContext.getViewRoot ();
			////save state in response (client-side: full state; server-side: sequence)
			//RenderKit renderKit = RenderKitFactory.getRenderKit (facesContext, uiViewRoot.getRenderKitId ());
			//// not us.
			//renderKit.getResponseStateManager ().writeState (facesContext, serializedView);

			java.io.ByteArrayOutputStream bytearrayoutputstream = new java.io.ByteArrayOutputStream ();
			java.io.ObjectOutputStream objectoutputstream = new java.io.ObjectOutputStream (bytearrayoutputstream);

			//ignore tree structure
			//objectoutputstream.writeObject (serializedView.getStructure ());
			objectoutputstream.writeObject (serializedView.getState ());
			objectoutputstream.close ();
			bytearrayoutputstream.close ();

			string s = 
@"<div>
	<input type=""hidden"" name=""" + VIEWSTATE + "\" id=\"" + VIEWSTATE + "\" value=\"" +
				Convert.ToBase64String ((byte []) vmw.common.TypeUtils.ToByteArray (bytearrayoutputstream.toByteArray ())) + @""" />
</div>";
			facesContext.getResponseWriter ().write (s);
		}
Example #5
0
 public void Save(Stream stream)
 {
     //FileOutputStream _javastream = new FileOutputStream(filePath);
     java.io.ByteArrayOutputStream byteStream = new java.io.ByteArrayOutputStream();
     java.io.ObjectOutput objOut = new DotnetObjectOutputStream(byteStream);
     ((ReteooRuleBase)this._javaRuleBase).writeExternal(objOut);
     stream.Write(byteStream.toByteArray(), 0, byteStream.toByteArray().Length);
     byteStream.close();
 }