From c243ae43f23be20ec3388ed30e8b7b806ad2a2a7 Mon Sep 17 00:00:00 2001
From: Teravus Ovares
Date: Tue, 21 Jul 2009 06:47:29 +0000
Subject: * Updated C# WebServer to the latest available source download
(r19869) and applied a few mods from the old version (now up on opensim-libs
(VS 3.5 project). * Made various changes to BaseHttpServer to accommodate the
new interfaces. * This version has been significantly re-architected and may
fail in unusual and insidious ways. * Please pay attention to any errors you
get and post a Mantis if you can reproduce an issue with the HTTPServer. I'm
including the pdb and having the http server compiled in debug for a few
weeks so that when an error occurs, it'll print the pertenant data. * Once
again, this is the full C# WebServer, not the lite branch that is included in
LibOMV (we need SSL!)
---
bin/HttpServer_OpenSim.xml | 8168 ++++++++++++++++++--------------------------
1 file changed, 3300 insertions(+), 4868 deletions(-)
(limited to 'bin/HttpServer_OpenSim.xml')
diff --git a/bin/HttpServer_OpenSim.xml b/bin/HttpServer_OpenSim.xml
index 747f35d..22cc1c0 100644
--- a/bin/HttpServer_OpenSim.xml
+++ b/bin/HttpServer_OpenSim.xml
@@ -4,1814 +4,1686 @@
HttpServer_OpenSim
-
+
- Cookies that should be set.
+ Interface for sessions
-
+
- Adds a cookie in the collection.
+ Remove everything from the session
- cookie to add
- cookie is null
-
+
- Copy a request cookie
+ Remove everything from the session
-
- When the cookie should expire
+ True if the session is cleared due to expiration
-
+
- Gets a collection enumerator on the cookie list.
+ Session id
- collection enumerator
-
+
- Remove all cookies
+ Should
+ Name of the session variable
+ null if it's not set
+ If the object cant be serialized.
-
+
- Returns an enumerator that iterates through the collection.
+ When the session was last accessed.
+ This property is touched by the http server each time the
+ session is requested.
-
-
- A that can be used to iterate through the collection.
-
- 1
-
+
- Gets the count of cookies in the collection.
+ Number of session variables.
-
+
- Gets the cookie of a given identifier (null if not existing).
+ Event triggered upon clearing the session
-
+
- Generates C#/HTML from HAML code.
+ Arguments sent when a is cleared
- HAML documentation: http://haml.hamptoncatlin.com/docs/rdoc/classes/Haml.html
-
+
- A code generator is used to convert template code to something that we can
- work with, as HTML or c# code.
+ Instantiates the arguments for the event
-
+ True if the session is cleared due to expiration
-
+
- Generate C# code from the template.
+ Returns true if the session is cleared due to expiration
- A that the generated code will be written to.
- If the template have not been parsed first.
- If template is incorrect
-
+
- Parse a file and convert into to our own template object code.
+ Delegate for when a IHttpSession is cleared
- Path and filename to a template
- If something is incorrect in the template.
-
-
-
-
-
+ this is being cleared.
+ Arguments for the clearing
-
+
- Parse a file and convert into to our own template object code.
+ Contains a listener that doesn't do anything with the connections.
- A containing our template
- If something is incorrect in the template.
-
+
- Initializes a new instance of the class.
+ Listen for regular HTTP connections
+ IP Address to accept connections on
+ TCP Port to listen on, default HTTP port is 80.
+ Factory used to create es.
+ address is null.
+ Port must be a positive number.
-
+
- Initializes a new instance of the class.
+ Initializes a new instance of the class.
- The log writer.
+ IP Address to accept connections on
+ TCP Port to listen on, default HTTPS port is 443
+ Factory used to create es.
+ Certificate to use
-
+
- Check and validate indentation
+ Initializes a new instance of the class.
- line to check
- number of white spaces
- number of indentations (2 white spaces = 1 intend, 1 tab = 1 intend)
+ IP Address to accept connections on
+ TCP Port to listen on, default HTTPS port is 443
+ Factory used to create es.
+ Certificate to use
+ which HTTPS protocol to use, default is TLS.
-
+
+ Exception.
+
+
- Check indentation
+ Will try to accept connections one more time.
- fills line with intend info
+ If any exceptions is thrown.
-
+
- check if current line is a multi line
+ Can be used to create filtering of new connections.
- previous line
- current line
+ Accepted socket
+ true if connection can be accepted; otherwise false.
-
+
- Generate HTML code from the template.
- Code is encapsulated in <% and <%=
+ Start listen for new connections
- A that the generated code will be written to.
- If the template have not been parsed first.
- If template is incorrect
+ Number of connections that can stand in a queue to be accepted.
+ Listener have already been started.
-
+
- Get the first word (letters and digits only) from the specified offset.
+ Stop the listener
-
-
-
+
-
+
- Check indentation / node placement
+ Gives you a change to receive log entries for all internals of the HTTP library.
+
+ You may not switch log writer after starting the listener.
+
-
+
- Parse a node
- todo: improve doc
+ True if we should turn on trace logs.
-
-
-
-
-
+
- PreParse goes through the text add handles indentation
- and all multi line cases.
+ Catch exceptions not handled by the listener.
- Reader containing the text
+
+ Exceptions will be thrown during debug mode if this event is not used,
+ exceptions will be printed to console and suppressed during release mode.
+
-
+
- print the entire document
+ A request have been received from a .
-
+
- Print line information to the console
+ The server encountered an unexpected condition which prevented it from fulfilling the request.
-
-
+
- Read next line from file
+ All HTTP based exceptions will derive this class.
- true if line could be read; false if EOF.
-
+
- Generates a string with spaces.
+ Create a new HttpException
- number of spaces.
- string of spaces.
+ http status code (sent in the response)
+ error description
-
+
- Parse a file and convert into to our own template object code.
+ Create a new HttpException
- Path and filename to a template
- If something is incorrect in the template.
-
-
-
-
-
-
+ http status code (sent in the response)
+ error description
+ inner exception
-
+
- Parse a file and convert into to our own template object code.
+ status code to use in the response.
- A containing our template
- If something is incorrect in the template.
-
+
- Generate C# code from the template.
+ Initializes a new instance of the class.
- A that the generated code will be written to.
- If the template have not been parsed first.
- If template is incorrect
-
+
- Property to retrieve the root node for the latest parsed document
+ Initializes a new instance of the class.
+ error message.
-
+
- Class to make dynamic binding of redirects. Instead of having to specify a number of similar redirect rules
- a regular expression can be used to identify redirect urls and thier targets.
+ Initializes a new instance of the class.
-
- [a-z0-9]+)", "/users/${target}?find=true", RegexOptions.IgnoreCase)
- ]]>
-
+ error message.
+ inner exception.
-
+
- redirects from one url to another.
+ Used to inform http server that
-
+
- Rules are used to perform operations before a request is being handled.
- Rules can be used to create routing etc.
+ Eventarguments used when an exception is thrown by a module
+ the exception
-
+
- Process the incoming request.
+ Exception thrown in a module
- incoming http request
- outgoing http response
- true if response should be sent to the browser directly (no other rules or modules will be processed).
-
- returning true means that no modules will get the request. Returning true is typically being done
- for redirects.
-
- If request or response is null.
-
+
- Initializes a new instance of the class.
+ Container to bind resource names to assemblies
- Absolute path (no servername)
- Absolute path (no servername)
-
- server.Add(new RedirectRule("/", "/user/index"));
-
-
+
- Initializes a new instance of the class.
+ Instantiates an instance of
- Absolute path (no servername)
- Absolute path (no servername)
- true if request should be redirected, false if the request uri should be replaced.
-
- server.Add(new RedirectRule("/", "/user/index"));
-
+ The dot seperated uri the resource maps to
+ The full resource name
+ The assembly the resource exists in
-
+
- Process the incoming request.
+ Retrieves a stream to the resource
- incoming http request
- outgoing http response
- true if response should be sent to the browser directly (no other rules or modules will be processed).
-
- returning true means that no modules will get the request. Returning true is typically being done
- for redirects.
-
+ Null if the resource couldn't be located somehow
-
+
- string to match request url with.
+ Retrieves the assembly the resource resides in
- Is compared to request.Uri.AbsolutePath
-
+
- Where to redirect.
+ Retrieves the full name/path of the assembly
-
+
- true if we should redirect.
+ Retrieves the extension of the resource
-
- false means that the rule will replace
- the current request uri with the new one from this class.
-
-
+
+ Returns the Uri without extension
+
+
+ Retrieves the full path name to the resource file
+
+
- Initializes a new instance of the class.
+
- Expression to match url
- Expression to generate url
-
- [a-zA-Z0-9]+)", "/user/${first}"));
- Result of ie. /employee1 will then be /user/employee1
- ]]>
-
+
+
+
-
+
+ Represents a field in a multipart form
+
+
- Initializes a new instance of the class.
+ Event arguments used when a new header have been parsed.
- Expression to match url
- Expression to generate url
- Regular expression options to use, can be null
-
- [a-zA-Z0-9]+)", "/user/{first}", RegexOptions.IgnoreCase));
- Result of ie. /employee1 will then be /user/employee1
- ]]>
-
-
+
- Initializes a new instance of the class.
+ Initializes a new instance of the class.
- Expression to match url
- Expression to generate url
- Regular expression options to apply
- true if request should be redirected, false if the request uri should be replaced.
-
- [a-zA-Z0-9]+)", "/user/${first}", RegexOptions.None));
- Result of ie. /employee1 will then be /user/employee1
- ]]>
-
+ Name of header.
+ Header value.
-
+
- Process the incoming request.
+ Initializes a new instance of the class.
- incoming http request
- outgoing http response
- true if response should be sent to the browser directly (no other rules or modules will be processed).
-
- returning true means that no modules will get the request. Returning true is typically being done
- for redirects.
-
- If request or response is null
-
+
- Interface used to load templates from different sources.
+ Gets or sets header name.
-
+
- Load a template into a and return it.
+ Gets or sets header value.
- Relative path (and filename) to template.
- a if file was found; otherwise null.
-
+
- Fetch all files from the resource that matches the specified arguments.
+ New implementation of the HTTP listener.
- Where the file should reside.
- Files to check
- a list of files if found; or an empty array if no files are found.
+
+ Use the Create methods to create a default listener.
+
-
+
- Check's whether a template should be reloaded or not.
+ Initializes a new instance of the class.
- template information
- true if template is OK; false if it do not exist or are old.
+ IP Address to accept connections on
+ TCP Port to listen on, default HTTP port is 80.
+ Factory used to create es.
+ address is null.
+ Port must be a positive number.
-
+
- Returns whether or not the loader has an instance of the file requested
+ Initializes a new instance of the class.
- The name of the template/file
- True if the loader can provide the file
+ The address.
+ The port.
+ The factory.
+ The certificate.
-
+
- Webhelper provides helpers for common tasks in HTML.
+ Initializes a new instance of the class.
+ The address.
+ The port.
+ The factory.
+ The certificate.
+ The protocol.
-
+
- Used to let the website use different javascript libraries.
- Default is
+ Creates a new instance with default factories.
+ Address that the listener should accept connections on.
+ Port that listener should accept connections on.
+ Created HTTP listener.
-
+
- Creates a link that invokes through ajax.
+ Creates a new instance with default factories.
- url to fetch
- link title
-
- optional options in format "key, value, key, value".
- Javascript options starts with ':'.
-
- a link tag
-
- WebHelper.AjaxRequest("/users/add/", "Add user", "method:", "post", "onclick", "validate('this');");
-
+ Address that the listener should accept connections on.
+ Port that listener should accept connections on.
+ Certificate to use
+ Created HTTP listener.
-
+
- Builds a link that updates an element with the fetched ajax content.
+ Creates a new instance with default factories.
- Url to fetch content from
- link title
- html element to update with the results of the ajax request.
- optional options in format "key, value, key, value"
- A link tag.
+ Address that the listener should accept connections on.
+ Port that listener should accept connections on.
+ Certificate to use
+ which HTTPS protocol to use, default is TLS.
+ Created HTTP listener.
-
+
- A link that pop ups a Dialog (overlay div)
+ Can be used to create filtering of new connections.
- url to contents of dialog
- link title
- name/value of html attributes.
- A "a"-tag that popups a dialog when clicked
-
- WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');");
-
-
-
-
- Create/Open a dialog box using ajax
-
-
-
-
-
+ Accepted socket
+
+ true if connection can be accepted; otherwise false.
+
-
+
- Close a javascript dialog window/div.
+ A client have been accepted, but not handled, by the listener.
- javascript for closing a dialog.
-
-
+
- Create a <form> tag.
+ This decoder converts XML documents to form items.
+ Each element becomes a subitem in the form, and each attribute becomes an item.
- name of form
- action to invoke on submit
- form should be posted as ajax
- html code
- WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax);
+ // xml: somethingdata
+ // result:
+ // form["hello"].Value = "something"
+ // form["hello"]["id"].Value = 1
+ // form["hello"]["world]["id"].Value = 1
+ // form["hello"]["world"].Value = "data"
+
+ The original xml document is stored in form["__xml__"].Value.
+
-
+
- Create a link tag.
+ Interface for form content decoders.
- url to go to
- link title (text that is displayed)
- html attributes, name, value, name, value
- html code
-
- WebHelper.Link("/user/show/1", "Show user", "id", "showUser", "onclick", "return confirm('Are you shure?');");
-
-
+
- Build a link
+
- url to go to.
- title of link (displayed text)
- extra html attributes.
- a complete link
+ Stream containing the content
+ Content type (with any additional info like boundry). Content type is always supplied in lower case
+ Stream enconding
+ A http form, or null if content could not be parsed.
+ If contents in the stream is not valid input data.
-
+
- Build a link
+ Checks if the decoder can handle the mime type
- url to go to.
- title of link (displayed text)
- extra html attributes.
- a complete link
- more options
+ Content type (with any additional info like boundry). Content type is always supplied in lower case.
+ True if the decoder can parse the specified content type
-
+
- Obsolete
+
- Obsolete
- Obsolete
- Obsolete
- Obsolete
- Obsolete
- Obsolete
+ Stream containing the content
+ Content type (with any additional info like boundry). Content type is always supplied in lower case
+ Stream encoding
+ Note: contentType and encoding are not used?
+ A http form, or null if content could not be parsed.
+
-
+
- Obsolete
+ Recursive function that will go through an xml element and store it's content
+ to the form item.
- Obsolete
- Obsolete
- Obsolete
- Obsolete
- Obsolete
- Obsolete
- Obsolete
+ (parent) Item in form that content should be added to.
+ Node that should be parsed.
-
+
- Render errors into a UL with class "errors"
+ Checks if the decoder can handle the mime type
- class used by UL-tag.
- items to list
- an unordered html list.
+ Content type (with any additional info like boundry). Content type is always supplied in lower case.
+ True if the decoder can parse the specified content type
-
+
- Render errors into a UL with class "errors"
+ We dont want to let the server to die due to exceptions thrown in worker threads.
+ therefore we use this delegate to give you a change to handle uncaught exceptions.
- class used by UL-tag.
- items to list
- an unordered html list.
+ Class that the exception was thrown in.
+ Exception
+
+ Server will throw a InternalServerException in release version if you dont
+ handle this delegate.
+
-
+
- Render errors into a UL with class "errors"
+ Implements HTTP Digest authentication. It's more secure than Basic auth since password is
+ encrypted with a "key" from the server.
-
-
+
+ Keep in mind that the password is encrypted with MD5. Use a combination of SSL and digest auth to be secure.
+
-
+
- Generates a list with html attributes.
+ Authentication modules are used to implement different
+ kind of HTTP authentication.
- StringBuilder that the options should be added to.
- attributes set by user.
- attributes set by any of the helper classes.
-
+
- Generates a list with html attributes.
+ Tag used for authentication.
- StringBuilder that the options should be added to.
-
-
+
- Purpose of this class is to create a javascript toolkit independent javascript helper.
+ Initializes a new instance of the class.
+ Delegate used to provide information used during authentication.
+ Delegate used to determine if authentication is required (may be null).
-
+
- Generates a list with JS options.
+ Initializes a new instance of the class.
- StringBuilder that the options should be added to.
- the javascript options. name, value pairs. each string value should be escaped by YOU!
- true if we should start with a comma.
+ Delegate used to provide information used during authentication.
-
+
- Removes any javascript parameters from an array of parameters
+ Create a response that can be sent in the WWW-Authenticate header.
- The array of parameters to remove javascript params from
- An array of html parameters
+ Realm that the user should authenticate in
+ Array with optional options.
+ A correct authentication request.
+ If realm is empty or null.
-
+
- javascript action that should be added to the "onsubmit" event in the form tag.
+ An authentication response have been received from the web browser.
+ Check if it's correct
-
- All javascript option names should end with colon.
-
-
- JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);");
-
-
+ Contents from the Authorization header
+ Realm that should be authenticated
+ GET/POST/PUT/DELETE etc.
+ options to specific implementations
+ Authentication object that is stored for the request. A user class or something like that.
+ if is invalid
+ If any of the parameters is empty or null.
-
+
- Requests a url through ajax
+ Used to invoke the authentication delegate that is used to lookup the user name/realm.
- url to fetch
- optional options in format "key, value, key, value", used in JS request object.
- a link tag
- All javascript option names should end with colon.
-
-
- JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);");
-
-
+ Realm (domain) that user want to authenticate in
+ User name
+ Password used for validation. Some implementations got password in clear text, they are then sent to client.
+ object that will be stored in the request to help you identify the user if authentication was successful.
+ true if authentication was successful
-
+
- Ajax requests that updates an element with
- the fetched content
+ Determines if authentication is required.
- Url to fetch content from
- element to update
- optional options in format "key, value, key, value", used in JS updater object.
- A link tag.
- All javascript option names should end with colon.
-
-
- JSHelper.AjaxUpdater("/user/show/1", "userInfo", "onsuccess:", "alert('Successful!');");
-
-
+ HTTP request from browser
+ true if user should be authenticated.
+ throw from your delegate if no more attempts are allowed.
+ If no more attempts are allowed
-
+
- A link that pop ups a Dialog (overlay div)
+ name used in HTTP request.
- url to contents of dialog
- link title
- A "a"-tag that popups a dialog when clicked
- name/value of html attributes
-
- WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');");
-
-
+
- Close a javascript dialog window/div.
+ Initializes a new instance of the class.
- javascript for closing a dialog.
-
+ Delegate used to provide information used during authentication.
+ Delegate used to determine if authentication is required (may be null).
-
+
- Creates a new modal dialog window
+ Initializes a new instance of the class.
- url to open in window.
- window title (may not be supported by all js implementations)
-
-
+ Delegate used to provide information used during authentication.
-
+
- Contains a connection to a browser/client.
+ Used by test classes to be able to use hardcoded values
-
+
- Contains a connection to a browser/client.
+ An authentication response have been received from the web browser.
+ Check if it's correct
+ Contents from the Authorization header
+ Realm that should be authenticated
+ GET/POST/PUT/DELETE etc.
+ First option: true if username/password is correct but not cnonce
+
+ Authentication object that is stored for the request. A user class or something like that.
+
+ if authenticationHeader is invalid
+ If any of the paramters is empty or null.
-
+
- Disconnect from client
+ Encrypts parameters into a Digest string
- error to report in the delegate.
+ Realm that the user want to log into.
+ User logging in
+ Users password.
+ HTTP method.
+ Uri/domain that generated the login prompt.
+ Quality of Protection.
+ "Number used ONCE"
+ Hexadecimal request counter.
+ "Client Number used ONCE"
+ Digest encrypted string
-
+
- Send a response.
+
- Either HttpHelper.HTTP10 or HttpHelper.HTTP11
- http status code
- reason for the status code.
- html body contents, can be null or empty.
- If httpVersion is invalid.
+ Md5 hex encoded "userName:realm:password", without the quotes.
+ Md5 hex encoded "method:uri", without the quotes
+ Quality of Protection
+ "Number used ONCE"
+ Hexadecimal request counter.
+ Client number used once
+
-
+
- Send a response.
+ Create a response that can be sent in the WWW-Authenticate header.
- Either HttpHelper.HTTP10 or HttpHelper.HTTP11
- http status code
- reason for the status code.
+ Realm that the user should authenticate in
+ First options specifies if true if username/password is correct but not cnonce.
+ A correct auth request.
+ If realm is empty or null.
-
+
- Send a response.
+ Decodes authorization header value
-
+ header value
+ Encoding that the buffer is in
+ All headers and their values if successful; otherwise null
+
+ NameValueCollection header = DigestAuthentication.Decode("response=\"6629fae49393a05397450978507c4ef1\",\r\nc=00001", Encoding.ASCII);
+
+ Can handle lots of whitespaces and new lines without failing.
-
+
- send a whole buffer
+ Gets the current nonce.
- buffer to send
-
+
-
+
- Send data using the stream
+ Gets the Md5 hash bin hex2.
- Contains data to send
- Start position in buffer
- number of bytes to send
-
-
+ To be hashed.
+
-
+
- Using SSL or other encryption method.
+ determines if the nonce is valid or has expired.
+
+ nonce value (check wikipedia for info)
+ true if the nonce has not expired.
+
+
+
+ name used in http request.
-
+
- Buffersize determines how large the HTTP header can be.
+ Gets or sets whether the token supplied in is a
+ HA1 generated string.
-
+
- Initializes a new instance of the class.
+ Class that receives Requests from a .
- true if the connection is secured (SSL/TLS)
- client that connected.
- delegate handling incoming requests.
- delegate being called when a client disconnectes
- Stream used for communication
- If beginreceive fails
- delegate used to write log entries
-
-
-
+
- Initializes a new instance of the class.
+ Client have been disconnected.
- true if the connection is secured (SSL/TLS)
- delegate handling incoming requests.
- client that connected
- Stream used for communication
- If beginreceive fails
-
-
+ Client that was disconnected.
+ Reason
+
-
+
- Disconnect from client
+ Invoked when a client context have received a new HTTP request
- error to report in the delegate.
+ Client that received the request.
+ Request that was received.
+
-
+
- This method checks the request if a responde to 100-continue should be sent.
+ Delegate used to find a realm/domain.
+
+
- 100 continue is a value in the Expect header.
- It's used to let the webserver determine if a request can be handled. The client
- waits for a reply before sending the body.
+ Realms are used during HTTP Authentication
+
+
-
+
- Send a response.
+ A complete HTTP server, you need to add a module to it to be able to handle incoming requests.
- Either HttpHelper.HTTP10 or HttpHelper.HTTP11
- http status code
- reason for the status code.
- html body contents, can be null or empty.
- If httpVersion is invalid.
+
+
+ // this small example will add two web site modules, thus handling
+ // two different sites. In reality you should add Controller modules or something
+ // two the website modules to be able to handle different requests.
+ HttpServer server = new HttpServer();
+ server.Add(new WebSiteModule("www.gauffin.com", "Gauffin Telecom AB"));
+ server.Add(new WebSiteModule("www.vapadi.se", "Remote PBX"));
+
+ // start regular http
+ server.Start(IPAddress.Any, 80);
+
+ // start https
+ server.Start(IPAddress.Any, 443, myCertificate);
+
+
+
+
+
-
+
- Send a response.
+ Initializes a new instance of the class.
- Either HttpHelper.HTTP10 or HttpHelper.HTTP11
- http status code
- reason for the status code.
+ Used to get all components used in the server..
-
+
- Send a response.
+ Initializes a new instance of the class.
-
-
+
- send a whole buffer
+ Initializes a new instance of the class.
- buffer to send
-
+ Form decoders are used to convert different types of posted data to the object types.
+
+
-
+
- Send data using the stream
+ Initializes a new instance of the class.
- Contains data to send
- Start position in buffer
- number of bytes to send
-
-
+ A session store is used to save and retrieve sessions
+
-
+
- Using SSL or other encryption method.
+ Initializes a new instance of the class.
+ The log writer.
+
-
+
- Client have been disconnected.
+ Initializes a new instance of the class.
- Client that was disconnected.
- Reason
-
+ Form decoders are used to convert different types of posted data to the object types.
+ The log writer.
+
+
+
-
+
- Invoked when a client context have received a new HTTP request
+ Initializes a new instance of the class.
- Client that received the request.
- Request that was received.
-
+ Form decoders are used to convert different types of posted data to the object types.
+ A session store is used to save and retrieve sessions
+ The log writer.
+
+
+
+
-
+
- A controller module is a part of the ModelViewController design pattern.
- It gives you a way to create user friendly URLs.
+ Adds the specified rule.
-
- The controller module uses the flyweight pattern which means that
- the memory usage will continue to increase until the module have
- enough objects in memory to serve all concurrent requests. The objects
- are reused and will not be freed.
-
-
-
- ControllerModule module = new ControllerModule();
- module.Add(new UserController());
- module.Add(new SearchController());
- myWebsite.Add(module);
-
-
+ The rule.
-
+
- A HttpModule can be used to serve urls. The module itself
- decides if it should serve a url or not. In this way, you can
- get a very flexible http app since you can let multiple modules
- serve almost similiar urls.
+ Add a to the server.
-
- Throw UnauthorizedException if you are using a AuthenticationModule and want to prompt for username/password.
-
+ mode to add
-
+
- Method that process the url
+ Decodes the request body.
- Information sent by the browser about the request
- Information that is being sent back to the client.
- Session used to
- true if this module handled the request.
+ The request.
+ Failed to decode form data.
-
+
- Set the log writer to use.
+ Generate a HTTP error page (that will be added to the response body).
+ response status code is also set.
- logwriter to use.
+ Response that the page will be generated in.
+ .
+ response body contents.
-
+
- Log something.
+ Generate a HTTP error page (that will be added to the response body).
+ response status code is also set.
- importance of log message
- message
+ Response that the page will be generated in.
+ exception.
-
+
- If true specifies that the module doesn't consume the processing of a request so that subsequent modules
- can continue processing afterwards. Default is false.
+ Realms are used by the s.
+ HTTP request
+ domain/realm.
-
+
- The controller module uses the prototype design pattern
- to be able to create new controller objects for requests
- if the stack is empty.
+ Process an incoming request.
- A prototype which will be cloned for each request
-
- If a controller with that name have been added already.
+ connection to client
+ request information
+ response that should be filled
+ session information
-
+
- Method that process the incoming request.
+ Can be overloaded to implement stuff when a client have been connected.
- Information sent by the browser about the request
- Information that is being sent back to the client.
- Session used to
+
+ Default implementation does nothing.
+
+ client that disconnected
+ disconnect reason
-
+
- Get a prototype
+ Handle authentication
- in lowercase, without "Controller"
- The controller if found; otherwise null.
-
-
- //fetches the class UserController
- RequestController userController = controllerModule["user"];
-
-
+
+
+
+ true if request can be handled; false if not.
+ Invalid authorization header
-
+
- Initializes a new instance of the class.
+ Will request authentication.
- A controller used to handle certain URLs. Will be cloned for each parallel request.
+
+ Sends respond to client, nothing else can be done with the response after this.
+
+
+
+
-
+
- Retrieve a previously created controller (or a new one if none exist).
+ Received from a when a request have been parsed successfully.
-
+ that received the request.
+ The request.
-
+
- Add a controller
+ To be able to track request count.
-
+
+
-
+
- Prototype controller used for cloning.
+ Start the web server using regular HTTP.
- The prototype.
+ IP Address to listen on, use IpAddress.Any to accept connections on all IP addresses/network cards.
+ Port to listen on. 80 can be a good idea =)
+ address is null.
+ Port must be a positive number.
-
+
- Will contain helper functions for javascript.
+ Accept secure connections.
+ IP Address to listen on, use to accept connections on all IP Addresses / network cards.
+ Port to listen on. 80 can be a good idea =)
+ Certificate to use
+ address is null.
+ Port must be a positive number.
-
+
- Requests a url through ajax
+ shut down the server and listeners
- url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.
- optional options in format "key, value, key, value", used in JS request object. All keys should end with colon.
- a link tag
- onclick attribute is used by this method.
-
-
- // plain text
- JSHelper.AjaxRequest("'/user/show/1'");
-
- // ajax request using this.href
- string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>";
-
-
-
+
- Ajax requests that updates an element with
- the fetched content
+ write an entry to the log file
- url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.
- element to update
- options in format "key, value, key, value". All keys should end with colon.
- A link tag.
-
-
- JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true");
-
-
+ importance of the message
+ log message
-
+
- Opens contents in a dialog window.
+ write an entry to the log file
- url to contents of dialog
- link title
- name, value, name, value, all parameter names should end with colon.
+ object that wrote the message
+ importance of the message
+ log message
-
+
- Close a javascript dialog window/div.
+ Server that is handling the current request.
- javascript for closing a dialog.
-
+
+ Will be set as soon as a request arrives to the object.
+
-
+
- Delegate used by to populate select options.
+ Modules used for authentication. The module that is is added first is used as
+ the default authentication module.
- current object (for instance a User).
- Text that should be displayed in the value part of a <optiongt;-tag.
- Text shown in the select list.
-
- // Class that is going to be used in a SELECT-tag.
- public class User
- {
- private readonly string _realName;
- private readonly int _id;
- public User(int id, string realName)
- {
- _id = id;
- _realName = realName;
- }
- public string RealName
- {
- get { return _realName; }
- }
-
- public int Id
- {
- get { return _id; }
- }
- }
-
- // Using an inline delegate to generate the select list
- public void UserInlineDelegate()
- {
- List<User> items = new List<User>();
- items.Add(new User(1, "adam"));
- items.Add(new User(2, "bertial"));
- items.Add(new User(3, "david"));
- string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value)
- {
- User user = (User)o;
- id = user.Id;
- value = user.RealName;
- }, 2, true);
- }
-
- // Using an method as delegate to generate the select list.
- public void UseExternalDelegate()
- {
- List<User> items = new List<User>();
- items.Add(new User(1, "adam"));
- items.Add(new User(2, "bertial"));
- items.Add(new User(3, "david"));
- string htmlSelect = Select("users", "users", items, UserOptions, 1, true);
- }
-
- // delegate returning id and title
- public static void UserOptions(object o, out object id, out object title)
- {
- User user = (User)o;
- id = user.Id;
- value = user.RealName;
- } ///
+ Use the corresponding property
+ in the if you are using multiple websites.
-
+
- Methods marked with BeforeFilter will be invoked before each request.
+ Form decoder providers are used to decode request body (which normally contains form data).
-
- BeforeFilters should take no arguments and return false
- if controller method should not be invoked.
-
-
-
+
- Initializes a new instance of the class.
+ Server name sent in HTTP responses.
- BeforeFilters should take no arguments and return false
- if controller method should not be invoked.
+ Do NOT include version in name, since it makes it
+ easier for hackers.
-
+
- Initializes a new instance of the class.
+ Name of cookie where session id is stored.
- Specify if the filter should be invoked among the first filters, in between or among the last.
-
- BeforeFilters should take no arguments and return false
- if controller method should not be invoked.
-
-
+
- Filters position in before filter queue
+ Specified where logging should go.
+
+
+
-
+
- Determins when a before filter is executed.
+ Number of connections that can wait to be accepted by the server.
-
+ Default is 10.
-
+
- Filter will be invoked first (unless another filter is added after this one with the First position)
+ Gets or sets maximum number of allowed simultaneous requests.
+
+
+ This property is useful in busy systems. The HTTP server
+ will start queuing new requests if this limit is hit, instead
+ of trying to process all incoming requests directly.
+
+
+ The default number if allowed simultaneous requests are 10.
+
+
-
+
- Invoke after all first filters, and before the last filters.
+ Gets or sets maximum number of requests queuing to be handled.
+
+
+ The WebServer will start turning requests away if response code
+ to indicate that the server
+ is too busy to be able to handle the request.
+
+
-
+
- Filter will be invoked last (unless another filter is added after this one with the Last position)
+ Realms are used during HTTP authentication.
+ Default realm is same as server name.
-
+
- The "basic" authentication scheme is based on the model that the
- client must authenticate itself with a user-ID and a password for
- each realm. The realm value should be considered an opaque string
- which can only be compared for equality with other realms on that
- server. The server will service the request only if it can validate
- the user-ID and password for the protection space of the Request-URI.
- There are no optional authentication parameters.
+ Let's to receive unhandled exceptions from the threads.
+
+ Exceptions will be thrown during debug mode if this event is not used,
+ exceptions will be printed to console and suppressed during release mode.
+
-
+
- Authentication modules are used to implement different
- kind of http authentication.
+ Webhelper provides helpers for common tasks in HTML.
-
+
- Initializes a new instance of the class.
+ Used to let the website use different javascript libraries.
+ Default is
- Delegate used to provide information used during authentication.
- Delegate used to determine if authentication is required (may be null).
-
+
- Initializes a new instance of the class.
+ Creates a link that invokes through ajax.
- Delegate used to provide information used during authentication.
+ url to fetch
+ link title
+
+ optional options in format "key, value, key, value".
+ Javascript options starts with ':'.
+
+ a link tag
+
+ WebHelper.AjaxRequest("/users/add/", "Add user", "method:", "post", "onclick", "validate('this');");
+
-
+
- Create a response that can be sent in the WWW-Authenticate header.
+ Builds a link that updates an element with the fetched ajax content.
- Realm that the user should authenticate in
- Array with optional options.
- A correct auth request.
- If realm is empty or null.
+ Url to fetch content from
+ link title
+ html element to update with the results of the ajax request.
+ optional options in format "key, value, key, value"
+ A link tag.
-
+
- An authentication response have been received from the web browser.
- Check if it's correct
+ A link that pop ups a Dialog (overlay div)
- Contents from the Authorization header
- Realm that should be authenticated
- GET/POST/PUT/DELETE etc.
- options to specific implementations
- Authentication object that is stored for the request. A user class or something like that.
- if authenticationHeader is invalid
- If any of the paramters is empty or null.
+ url to contents of dialog
+ link title
+ name/value of html attributes.
+ A "a"-tag that popups a dialog when clicked
+
+ WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');");
+
-
+
- Used to invoke the auth delegate that is used to lookup the username/realm.
+ Create/Open a dialog box using ajax
- Realm (domain) that user want to authenticate in
- Username
- Password used for validation. Some implementations got password in clear text, they are then sent to client.
- object that will be stored in the request to help you identify the user if authentication was successful.
- true if authentication was successful
+
+
+
+
-
+
- Determines if authentication is required.
+ Close a javascript dialog window/div.
- Http request from browser
- true if user should be authenticated.
- throw ForbiddenException from your delegate if no more attempts are allowed.
- If no more attempts are allowed
+ javascript for closing a dialog.
+
-
+
- name used in http request.
+ Create a <form> tag.
+ name of form
+ action to invoke on submit
+ form should be posted as ajax
+ html code
+
+ WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax);
+
-
+
- Initializes a new instance of the class.
+ Create a link tag.
- Delegate used to provide information used during authentication.
- Delegate used to determine if authentication is required (may be null).
+ url to go to
+ link title (text that is displayed)
+ html attributes, name, value, name, value
+ html code
+
+ WebHelper.Link("/user/show/1", "Show user", "id", "showUser", "onclick", "return confirm('Are you shure?');");
+
-
+
- Initializes a new instance of the class.
+ Build a link
- Delegate used to provide information used during authentication.
+ url to go to.
+ title of link (displayed text)
+ extra html attributes.
+ a complete link
-
+
- Create a response that can be sent in the WWW-Authenticate header.
+ Build a link
- Realm that the user should authenticate in
- Not used in basic auth
- A correct auth request.
+ url to go to.
+ title of link (displayed text)
+ extra html attributes.
+ a complete link
+ more options
-
+
- An authentication response have been received from the web browser.
- Check if it's correct
+ Obsolete
- Contents from the Authorization header
- Realm that should be authenticated
- GET/POST/PUT/DELETE etc.
- Not used in basic auth
- Authentication object that is stored for the request. A user class or something like that.
- if authenticationHeader is invalid
- If any of the paramters is empty or null.
+ Obsolete
+ Obsolete
+ Obsolete
+ Obsolete
+ Obsolete
+ Obsolete
-
+
- name used in http request.
+ Obsolete
+ Obsolete
+ Obsolete
+ Obsolete
+ Obsolete
+ Obsolete
+ Obsolete
+ Obsolete
-
+
- The follow node allows users to display code in a haml document
+ Render errors into a UL with class "errors"
-
- #main Welcome =user.FirstName
-
+ class used by UL-tag.
+ items to list
+ an unordered html list.
-
+
- Child nodes may not be the first node on a line
+ Render errors into a UL with class "errors"
+ class used by UL-tag.
+ items to list
+ an unordered html list.
-
+
- A node represents a controller code and contents. For example a html tag, an attribute list or something else.
+ Render errors into a UL with class "errors"
+
+
-
+
- Add a new node
+ Generates a list with html attributes.
- parent node.
+ StringBuilder that the options should be added to.
+ attributes set by user.
+ attributes set by any of the helper classes.
-
+
- Modifiers are used to modify the first node on the line.
- Typical modifiers are attribute lists, class names and IDs.
+ Generates a list with html attributes.
- Modifier node
+ StringBuilder that the options should be added to.
+
-
+
- Parse node contents add return a fresh node.
+ Purpose of this class is to create a javascript toolkit independent javascript helper.
- List containing all node types
- Node that this is a subnode to. Can be null
- Line to parse
- Where to start the parsing. Should be set to where the next node should start parsing.
- A node corresponding to the bla bla; null if parsing failed.
-
-
+
- determines if this node can handle the line (by checking the first word);
+ Generates a list with JS options.
- Controller char (word)
- true if text belongs to this node type
- First node on line, used since some nodes cannot exist on their own on a line.
+ StringBuilder that the options should be added to.
+ the javascript options. name, value pairs. each string value should be escaped by YOU!
+ true if we should start with a comma.
-
+
- Generate HTML code (with ASP tags)
+ Removes any javascript parameters from an array of parameters
-
+ The array of parameters to remove javascript params from
+ An array of html parameters
-
+
- Converts the node to c# code
+ javascript action that should be added to the "onsubmit" event in the form tag.
- true if we are inside the internal stringbuilder
- c# code
+
+ All javascript option names should end with colon.
+
+
+ JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);");
+
+
-
+
- Convert the node to c# code
+ Requests a url through ajax
- True if we are inside the internal stringbuilder
- true if all subnodes fit on one line
- c# code
+ url to fetch
+ optional options in format "key, value, key, value", used in JS request object.
+ a link tag
+ All javascript option names should end with colon.
+
+
+ JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);");
+
+
-
+
- Generate C# code of the node
+ Ajax requests that updates an element with
+ the fetched content
- true if we are inside the internal stringbuilder
- code is small enough to fit on one row.
- smallEnough is a default value, recalc it
- c# code
+ Url to fetch content from
+ element to update
+ optional options in format "key, value, key, value", used in JS updater object.
+ A link tag.
+ All javascript option names should end with colon.
+
+
+ JSHelper.AjaxUpdater("/user/show/1", "userInfo", "onsuccess:", "alert('Successful!');");
+
+
-
+
- Get intendation level for this node.
+ A link that pop ups a Dialog (overlay div)
-
+ url to contents of dialog
+ link title
+ A "a"-tag that popups a dialog when clicked
+ name/value of html attributes
+
+ WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');");
+
-
+
- Returns true if the node is applicable after another node as text instead of being applied as a modifier
+ Close a javascript dialog window/div.
+ javascript for closing a dialog.
+
-
+
- Count our children and our childrens children and so on...
+ Creates a new modal dialog window
+ url to open in window.
+ window title (may not be supported by all js implementations)
+
+
-
+
- All child nodes for this node.
+ PrototypeJS implementation of the javascript functions.
-
+
- Should only be set for each parent.
+ Requests a url through ajax
+ url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.
+ optional options in format "key, value, key, value", used in JS request object. All keys should end with colon.
+ a link tag
+ onclick attribute is used by this method.
+
+
+ // plain text
+ JSHelper.AjaxRequest("'/user/show/1'");
+
+ // ajax request using this.href
+ string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>";
+
+
-
+
- Modifiers are used to modify the first node on the line.
- Typical modifiers are attribute lists, class names and IDs.
+ Determins if a list of strings contains a specific value
+ options to check in
+ value to find
+ true if value was found
+ case insensitive
-
+
- Last modifier for this node
+ Ajax requests that updates an element with
+ the fetched content
-
+ URL to fetch. URL is NOT enclosed in quotes by the implementation. You need to do that yourself.
+ element to update
+ options in format "key, value, key, value". All keys should end with colon.
+ A link tag.
+
+
+ JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true");
+
+
-
+
- Number of modifiers for this line.
+ A link that pop ups a Dialog (overlay div)
+ URL to contents of dialog
+ link title
+ name, value, name, value
+
+ A "a"-tag that popups a dialog when clicked
+
+ Requires Control.Modal found here: http://livepipe.net/projects/control_modal/
+ And the following JavaScript (load it in application.js):
+
+ Event.observe(window, 'load',
+ function() {
+ document.getElementsByClassName('modal').each(function(link){ new Control.Modal(link); });
+ }
+ );
+
+
+
+ WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');");
+
-
+
- Parent node.
+ create a modal dialog (usually using DIVs)
+ url to fetch
+ dialog title
+ javascript/html attributes. javascript options ends with colon ':'.
+
-
+
- Child nodes may not be the first node on a line
+ Close a javascript dialog window/div.
- parent node
+ javascript for closing a dialog.
+
-
+
- Creates a DIV node and add's the specified node to it.
+ javascript action that should be added to the "onsubmit" event in the form tag.
- Contains all prototypes for each control char. used to instanciate new nodes.
- parent node
- current line information
- node to add to the DIV node
- current node
+ remember to encapsulate strings in ''
+
+ All javascript option names should end with colon.
+
+
+ JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);");
+
+
-
+
- Get endposition for this modifier.
+ Event driven parser used to parse incoming HTTP requests.
- where to start searching
- contents of the current line
- char that tells us that this is the end position
- index on the current line
+
+ The parser supports partial messages and keeps the states between
+ each parsed buffer. It's therefore important that the parser gets
+ ed if a client disconnects.
+
-
+
- Get endposition for this modifier.
+ Parse partial or complete message.
- where to start searching
- contents of the current line
- index on the current line
+ buffer containing incoming bytes
+ where in buffer that parsing should start
+ number of bytes to parse
+ Unparsed bytes left in buffer.
+ BadRequestException.
-
+
- This is a plain text node
+ Clear parser state.
-
+
- Contains C# code that will be rendered into the view.
+ Current state in parser.
- Parent node
-
+
- Parse node contents add return a fresh node.
+ A request have been successfully parsed.
- List containing all node types
- Node that this is a subnode to. Can be null
- Line to parse
- Where to start the parsing. Should be set to where the next node should start parsing.
- A node corresponding to the bla bla; null if parsing failed.
-
-
+
- determines if this node can handle the line (by checking the first word);
+ More body bytes have been received.
- Controller char (word)
- true if text belongs to this node type
- first node on line
-
+
- Generate HTML for this node (with asp tags for code)
+ Request line have been received.
-
-
+
- = is placed at the end of a tag definition, after class, id, and attribute declarations.
- It’s just a shortcut for inserting Ruby code into an element. It works the same as = without a tag:
- it inserts the result of the Ruby code into the template.
- However, if the result is short enough, it is displayed entirely on one line.
+ A header have been received.
- True if we are inside the internal stringbuilder
- true if all subnodes fit on one line
- smallEnough is a default value, recalc it
- c# code
-
+
- Determines if this is a textnode (containg plain text)
+ Gets or sets the log writer.
-
+
- Contains HTML attributes.
+ Current state in the parsing.
-
+
- Create a new node
+ Should parse the request line
- parent node
- collection of attributes
-
+
- create an attribute node
+ Searching for a complete header name
- parent node
-
+
- Get an attribute
+ Searching for colon after header name (ignoring white spaces)
- name of the attribute (case sensitive)
- attribute if found; otherwise null.
-
+
- Parse node contents add return a fresh node.
+ Searching for start of header value (ignoring white spaces)
- List containing all node types
- Node that this is a subnode to. Can be null
- Line to parse
- Where to start the parsing. Should be set to where the next node should start parsing.
- A node corresponding to the bla bla; null if parsing failed.
-
-
+
- determines if this node can handle the line (by checking the first word);
+ Searching for a complete header value (can span over multiple lines, as long as they are prefixed with one/more whitespaces)
- Controller char (word)
- true if text belongs to this node type
- first node on line
-
+
- Convert node to HTML (with ASP-tags)
+ Adding bytes to body
- HTML string
-
+
- Convert the node to c# code
+ Contains server side HTTP request information.
- True if we are inside the internal stringbuilder
- true if all subnodes fit on one line
- smallEnough is a default value, recalc it
- c# code
-
+
- html attributes
+ Called during parsing of a .
+ Name of the header, should not be URL encoded
+ Value of the header, should not be URL encoded
+ If a header is incorrect.
-
+
- A attribute
+ Add bytes to the body
+ buffer to read bytes from
+ where to start read
+ number of bytes to read
+ Number of bytes actually read (same as length unless we got all body bytes).
+ If body is not writable
+ bytes is null.
+ offset is out of range.
-
+
- value is a simple word or quoted text
+ Clear everything in the request
-
+
- Name of the attribute
+ Decode body into a form.
+ A list with form decoders.
+ If body contents is not valid for the chosen decoder.
+ If body is still being transferred.
-
+
- Value, can be a statement, variable or quoted text.
+ Sets the cookies.
+ The cookies.
-
+
- Arguments being used in a template.
+ Create a response object.
-
-
+ Context for the connected client.
+ A new .
-
+
- Holds the arguments connected to their names for quick access.
- (since the ArgumentContainer also holds the name for the argument the mapping with strings is somewhat redundant
- but since the data do 'belong' to the ArgumentContainer this solution was chosen to speed up access)
+ Gets kind of types accepted by the client.
-
+
- Initializes the class without any set arguments.
+ Gets or sets body stream.
-
+
- Initializes the class with all the arguments of the parameter class.
+ Gets whether the body is complete.
- Cannot be null
- If arguments is null
-
+
- Initializes the class with the objects in the parameterlist.
- Note that each object that is null must be followed by a type.
+ Gets or sets kind of connection used for the session.
- Should contain ordered pairs/truples of string, object and type where type is optional if the object isn´t null
- new TemplateArguments("Dir", "\", "Users", null, typeof(User));
- If optional type differs from type of object (if object != null) or argument name is duplicate
- If the order of objects is incorrect
- If any argument name or type is null
-
+
- A function that merges two argument holders updating and adding values
+ Gets or sets number of bytes in the body.
-
- If arguments is null
-
+
- Clears added arguments
+ Gets cookies that was sent with the request.
-
+
- Adds an argument.
- (Will throw ArgumentException on duplicates since adding an argument twice points to incorrect code, for ways around
- this
+ Gets form parameters.
- Cannot be null
- Cannot be null
- If argumentName or argumentObject is null
- If an argument named argumentName already exists
-
+
- Adds an argument. Allows for argumentObject to be null
- (Will throw ArgumentException
+ Gets headers sent by the client.
- Cannot be null
-
- Cannot be null
- If argumentName or argumentType is null
- If an argument named argumentName already exists or argumentObject != null and typeof(argumentObject) differs from argumentType
-
+
- Updates an already added argument
+ Gets or sets version of HTTP protocol that's used.
- Cannot be null
- Cannot be null
- If no argument named argumentName exists
- If argumentName or argumentObject is null
+
+ Probably or .
+
+
-
+
- Updates an already added argument, allows for argumentObject to be null
+ Gets whether the request was made by Ajax (Asynchronous JavaScript)
- Cannot be null
-
- Cannot be null
- If argumentName or argumentType is null
- If an argument named argumentName doesn´t exists or argumentObject != null and typeof(argumentObject) differs from argumentType
-
+
- Clears all added arguments
+ Gets or sets requested method.
+
+ Will always be in upper case.
+
+
-
+
- Retrieves the arguments
- (Does so now by copying the values to a new array, could be optimized?)
+ Gets parameter from or .
- An array containing arguments with name, object and type
-
+
- Returns a individual hashcode built upon the specified types the class is holding
+ Gets variables sent in the query string
- The hashcode is made by joining the typenames of all held arguments and making a string hashcode from them
-
-
+
- Retrieves a concated typename ie DictinaryInt32String
+ Gets or sets requested URI.
- The type to retrieve the name for
-
+
- Checks whether a specific argument is specified or not.
+ Gets URI absolute path divided into parts.
- Argument name
- true if argument is specified; otherwise false.
+
+ // URI is: http://gauffin.com/code/tiny/
+ Console.WriteLine(request.UriParts[0]); // result: code
+ Console.WriteLine(request.UriParts[1]); // result: tiny
+
+
+ If you're using controllers than the first part is controller name,
+ the second part is method name and the third part is Id property.
+
+
-
+
- Function to make it possible to index out known arguments
+ Gets or sets path and query.
- The name of an added argument
- Null if no ArgumentContainer by name was found
+
+
+ Are only used during request parsing. Cannot be set after "Host" header have been
+ added.
+
-
-
- A container class grouping mapping name, argument type and the argument object
-
-
-
-
- Contains the name mapped to the argument
-
-
-
-
- Contains the type of the argument, this must be valid if _argumentObject is null
-
-
-
-
- Holds the actual object
-
-
-
-
- Constructor to initiate an ArgumentContainer, will set the ArgumentType to the value of the argumentObject's type
-
- Cannot be null
- Cannot be null
- If argumentName or argumentObject is null
-
-
-
- Alternative constructor allowing argumentObject parameter to be null
-
- Cannot be null
-
- Cannot be null
- If argumentName or argumentType is null
- If argumentObject != null and argumentType != typeof(argumentObject)
-
-
-
- Sets the object and type of the argument, equal to ArgumentContainer.Object = ...
-
- Cannot be null
- If argumentObject is null
-
-
-
- Sets the argument object and type. Type of the object and argumentType must correspond.
-
-
- Cannot be null
- If argumentType is null
- If typeof(argumentObject) differs from argumentType and object != null
-
-
-
- Attribute for retrieving the name. The name cannot be set however because an argument is defined by its name
- changing the name would be changing the arguments meaning, thus an argument needing a name change should rather
- be recreated
-
-
-
-
- Returns the type of the argument object. The property cannot be set since the type depends on and must correspond to
- the type of the object
-
-
-
-
- Returns or changes the argument object. If the object is to be changed to null the type must be passed aswell,
- in that case
-
- If set value is null
-
-
-
- A partial is a HAML template that is inserted into other HAML templates.
-
-
-
+
- Contains the page/controller target for the partial.
- The PartialNode should be written as follows:
- ex.
-
- _"requestedpage"{parametername="parametervalue",parametername2=parameter2,parametername3=parameter3:typeof(parameter3type)}
+ Delegate used to let authentication modules authenticate the user name and password.
+ Realm that the user want to authenticate in
+ User name specified by client
+ Can either be user password or implementation specific token.
+ object that will be stored in a session variable called if authentication was successful.
+ throw forbidden exception if too many attempts have been made.
+
+
+ Use to specify that the token is a HA1 token. (MD5 generated
+ string from realm, user name and password); Md5String(userName + ":" + realm + ":" + password);
+
+
-
+
- create a new partial node.
+ Let's you decide on a system level if authentication is required.
- parent node
+ HTTP request from client
+ true if user should be authenticated.
+ throw if no more attempts are allowed.
+ If no more attempts are allowed
-
+
- Determines if this node can handle the line (by checking the first word);
+ Serves files that are stored in embedded resources.
- Controller char (word)
- True if text belongs to this node type
- First node on line.
-
+
- Parse node contents add return a fresh node.
+ A HttpModule can be used to serve Uri's. The module itself
+ decides if it should serve a Uri or not. In this way, you can
+ get a very flexible http application since you can let multiple modules
+ serve almost similar urls.
- Node that this is a subnode to. Can be null
- A list with node types
- Line to parse
- Where to start the parsing. Will be set to where the next node should start parsing
- A node corresponding to the bla bla; null if parsing failed.
-
+
+ Throw if you are using a and want to prompt for user name/password.
+
-
+
- Convert the node to c# code
+ Method that process the url
- True if we are inside the internal stringbuilder
- true if all subnodes fit on one line
- smallEnough is a default value, recalc it
- c# code
+ Information sent by the browser about the request
+ Information that is being sent back to the client.
+ Session used to
+ true if this module handled the request.
-
+
- Convert node to HTML (with ASP-tags)
+ Set the log writer to use.
- HTML string
+ logwriter to use.
-
+
- Helper function to retrieve the code for the partial request
+ Log something.
- A string representing the code for invocating a render of the partial
+ importance of log message
+ message
-
+
- Throw an exception with predefined information
+ If true specifies that the module doesn't consume the processing of a request so that subsequent modules
+ can continue processing afterwards. Default is false.
- why the exception was thrown
-
+
- This is a plain text node
+ Initializes a new instance of the class.
+ Runs to make sure the basic mime types are available, they can be cleared later
+ through the use of if desired.
-
+
- Returns the page/controller target for the node
+ Initializes a new instance of the class.
+ Runs to make sure the basic mime types are available, they can be cleared later
+ through the use of if desired.
+ The log writer to use when logging events
-
+
- Loads templates from embedded resources.
+ Mimtypes that this class can handle per default
-
+
- Loads templates from a namespace in the given assembly to an uri
+ Loads resources from a namespace in the given assembly to an uri
The uri to map the resources to
The assembly in which the resources reside
@@ -1819,136 +1691,107 @@
resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views");
- will make ie the resource MyLib.Models.User.Views.list.Haml accessible via /user/list.haml or /user/list/
+ will make ie the resource MyLib.Models.User.Views.stylesheet.css accessible via /user/stylesheet.css
+ The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded
-
-
- Load a template into a and return it.
-
- Relative path (and filename) to template.
-
- a if file was found; otherwise null.
-
-
-
-
- Fetch all files from the resource that matches the specified arguments.
-
- Where the file should reside.
- Files to check
-
- a list of files if found; or an empty array if no files are found.
-
-
-
-
- Always returns true since a resource won't be updated during execution
-
-
-
-
-
-
- Returns whether or not the loader has an instance of the file requested
-
- The name of the template/file
- True if the loader can provide the file
-
-
-
- Priority for log entries
-
-
-
-
+
- Very detailed logs to be able to follow the flow of the program.
+ Returns true if the module can handle the request
-
+
- Logs to help debug errors in the application
+ Method that process the url
+ Information sent by the browser about the request
+ Information that is being sent back to the client.
+ Session used to
+ true if this module handled the request.
-
+
- Information to be able to keep track of state changes etc.
+ List with all mime-type that are allowed.
+ All other mime types will result in a Forbidden http status code.
-
+
- Something did not go as we expected, but it's no problem.
+ The purpose of this module is to serve files.
-
+
- Something that should not fail failed, but we can still keep
- on going.
+ Initializes a new instance of the class.
+ Uri to serve, for instance "/files/"
+ Path on hard drive where we should start looking for files
+ If true a Last-Modifed header will be sent upon requests urging web browser to cache files
-
+
- Something failed, and we cannot handle it properly.
+ Initializes a new instance of the class.
+ Uri to serve, for instance "/files/"
+ Path on hard drive where we should start looking for files
-
+
- Interface used to write to log files.
+ Mimtypes that this class can handle per default
-
+
- Write an entry to the log file.
+ Determines if the request should be handled by this module.
+ Invoked by the
- object that is writing to the log
- importance of the log message
- the message
+
+ true if this module should handle it.
-
-
- This class writes to the console. It colors the output depending on the logprio and includes a 3-level stacktrace (in debug mode)
-
-
+
+ Illegal path
-
+
- The actual instance of this class.
+ check if source contains any of the chars.
+
+
+
-
+
- Logwriters the specified source.
+ Method that process the Uri.
- object that wrote the logentry.
- Importance of the log message
- The message.
+ Information sent by the browser about the request
+ Information that is being sent back to the client.
+ Session used to
+ Failed to find file extension
+ File type is forbidden.
-
+
- Get color for the specified logprio
+ return a file extension from an absolute Uri path (or plain filename)
- prio for the log entry
- A for the prio
+
+
-
+
- Default log writer, writes everything to null (nowhere).
+ List with all mime-type that are allowed.
-
+ All other mime types will result in a Forbidden http status code.
-
+
- The logging instance.
+ characters that may not exist in a path.
+
+ fileMod.ForbiddenChars = new string[]{ "\\", "..", ":" };
+
-
-
- Writes everything to null
-
- object that wrote the logentry.
- Importance of the log message
- The message.
+
+ Container for posted form data
@@ -2010,22 +1853,24 @@
Add a new element. Form array elements are parsed
- and added in a correct hierachy.
+ and added in a correct hierarchy.
Name is converted to lower case.
+ name is null.
+ Cannot add stuff to .
- Returns true if the class contains a HttpInput value with the corresponding name
+ Returns true if the class contains a with the corresponding name.
- The field/querystring name
+ The field/query string name
True if the value exists
Parses an item and returns it.
- This function is primarly used to parse array items as in user[name].
+ This function is primarily used to parse array items as in user[name].
@@ -2087,3491 +1932,1858 @@
Get a form item.
- Returns HttpInputItem.Empty if item was not found.
-
-
-
- Returns item either from a form or a query string (checks them in that order)
-
+ Returns if item was not found.
-
- Representation of a non-initialized HttpParam
+
+ Instance to help mark a non-initialized form
-
- Initialises the class to hold a value either from a post request or a querystring request
+
+ Initializes a form container with the specified name
-
+
- The add method is not availible for HttpParam
- since HttpParam checks both Request.Form and Request.QueryString
+ Makes a deep copy of the input
- name identifying the value
- value to add
-
+ The input to copy
-
+
- Checks whether the form or querystring has the specified value
+ Adds a file to the collection of posted files
- Name, case sensitive
- true if found; otherwise false.
+ The file to add
+ If the file is already added
+ If file is null
+ If the instance is HttpForm.EmptyForm which cannot be modified
-
+
- Returns an enumerator that iterates through the collection.
+ Checks if the form contains a specified file
-
-
- A that can be used to iterate through the collection.
-
- 1
+ Field name of the file parameter
+ True if the file exists
+ If the instance is HttpForm.EmptyForm which cannot be modified
-
+
- Returns an enumerator that iterates through a collection.
+ Retrieves a file held by by the form
-
-
- An object that can be used to iterate through the collection.
-
- 2
+ The identifier of the file
+ The requested file or null if the file was not found
+ If name is null or empty
+ If the instance is HttpForm.EmptyForm which cannot be modified
-
+
+ Disposes all held HttpFile's and resets values
+
+
- Fetch an item from the form or querystring (in that order).
+ Retrieves the number of files added to the
-
- Item if found; otherwise HttpInputItem.EmptyLanguageNode
+ 0 if no files are added
-
+
- Container class for posted files
+ Small design by contract implementation.
-
+
- Creates a container for a posted file
+ Check whether a parameter is empty.
- The identifier of the post field
- The file path
- The content type of the file
- The name of the file uploaded
- If any parameter is null or empty
+ Parameter value
+ Parameter name, or error description.
+ value is empty.
-
+
- Creates a container for a posted file
+ Checks whether a parameter is null.
- If any parameter is null or empty
-
-
- Destructor disposing the file
+ Parameter value
+ Parameter name, or error description.
+ value is null.
-
+
- Deletes the temporary file
+ Checks whether a parameter is null.
- True if manual dispose
+
+ Parameter value
+ Parameter name, or error description.
+ value is null.
-
+
- Disposing interface, cleans up managed resources (the temporary file) and suppresses finalization
+ The "basic" authentication scheme is based on the model that the
+ client must authenticate itself with a user-ID and a password for
+ each realm. The realm value should be considered an opaque string
+ which can only be compared for equality with other realms on that
+ server. The server will service the request only if it can validate
+ the user-ID and password for the protection space of the Request-URI.
+ There are no optional authentication parameters.
-
+
- The name/id of the file
+ Initializes a new instance of the class.
+ Delegate used to provide information used during authentication.
+ Delegate used to determine if authentication is required (may be null).
-
+
- The full file path
+ Initializes a new instance of the class.
+ Delegate used to provide information used during authentication.
-
+
- The name of the uploaded file
+ Create a response that can be sent in the WWW-Authenticate header.
+ Realm that the user should authenticate in
+ Not used in basic auth
+ A correct auth request.
-
+
- The type of file
+ An authentication response have been received from the web browser.
+ Check if it's correct
+ Contents from the Authorization header
+ Realm that should be authenticated
+ GET/POST/PUT/DELETE etc.
+ Not used in basic auth
+ Authentication object that is stored for the request. A user class or something like that.
+ if authenticationHeader is invalid
+ If any of the paramters is empty or null.
-
+
- The object form class takes an object and creates form items for it.
+ name used in http request.
-
+
- Initializes a new instance of the class.
+ Rules are used to perform operations before a request is being handled.
+ Rules can be used to create routing etc.
-
- form name *and* id.
- action to do when form is posted.
-
-
+
- Initializes a new instance of the class.
+ Process the incoming request.
- form name *and* id.
- action to do when form is posted.
- object to get values from
+ incoming HTTP request
+ outgoing HTTP response
+ true if response should be sent to the browser directly (no other rules or modules will be processed).
+
+ returning true means that no modules will get the request. Returning true is typically being done
+ for redirects.
+
+ If request or response is null.
-
+
- Initializes a new instance of the class.
+ Delegate used by to populate select options.
- form action.
- object to get values from.
+ current object (for instance a User).
+ Text that should be displayed in the value part of a <optiongt;-tag.
+ Text shown in the select list.
+
+ // Class that is going to be used in a SELECT-tag.
+ public class User
+ {
+ private readonly string _realName;
+ private readonly int _id;
+ public User(int id, string realName)
+ {
+ _id = id;
+ _realName = realName;
+ }
+ public string RealName
+ {
+ get { return _realName; }
+ }
+
+ public int Id
+ {
+ get { return _id; }
+ }
+ }
+
+ // Using an inline delegate to generate the select list
+ public void UserInlineDelegate()
+ {
+ List<User> items = new List<User>();
+ items.Add(new User(1, "adam"));
+ items.Add(new User(2, "bertial"));
+ items.Add(new User(3, "david"));
+ string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value)
+ {
+ User user = (User)o;
+ id = user.Id;
+ value = user.RealName;
+ }, 2, true);
+ }
+
+ // Using an method as delegate to generate the select list.
+ public void UseExternalDelegate()
+ {
+ List<User> items = new List<User>();
+ items.Add(new User(1, "adam"));
+ items.Add(new User(2, "bertial"));
+ items.Add(new User(3, "david"));
+ string htmlSelect = Select("users", "users", items, UserOptions, 1, true);
+ }
+
+ // delegate returning id and title
+ public static void UserOptions(object o, out object id, out object title)
+ {
+ User user = (User)o;
+ id = user.Id;
+ value = user.RealName;
+ } ///
-
+
- write out the FORM-tag.
+ This class is created as a wrapper, since there are two different cookie types in .Net (Cookie and HttpCookie).
+ The framework might switch class in the future and we dont want to have to replace all instances
- generated html code
-
+
- Writeout the form tag
+ Let's copy all the cookies.
- form should be posted through ajax.
- generated html code
+ value from cookie header.
-
+
- Generates a text box.
+ Adds a cookie in the collection.
-
-
- generated html code
+ cookie to add
+ cookie is null
-
+
- password box
+ Gets a collection enumerator on the cookie list.
-
-
- generated html code
+ collection enumerator
-
+