|
From: Chris W. <la...@us...> - 2001-11-27 12:08:50
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/doc In directory usw-pr-cvs1:/tmp/cvs-serv15845/doc Modified Files: base_page.pod Log Message: modify docs Index: base_page.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/doc/base_page.pod,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** base_page.pod 2001/11/26 06:55:54 1.4 --- base_page.pod 2001/11/27 12:08:47 1.5 *************** *** 14,27 **** This module displays pages. ! Well, ok, it does more than that. Each page can optionally be a ! template in its own right and you can store the content of the pages ! in the database or the filesystem, or both. The database always stores ! page metadata. ! So a request like: http://www.mysite.com/reports/q1/sales ! Can be mapped to an object which has the content in the database, but to your users it looks like a static HTML page. --- 14,36 ---- This module displays pages. ! Well, ok, it does more than that. Each 'page' consists of two pieces: ! a record of metadata always stored in the database, and the content of ! the page which can be stored in one of several media. ! The content can be displayable in a web browser, but it doesn't have ! to be. Additionally, the 'page' can itself have no content at all and ! exist merely as a pointer to content stored elsewhere. If the page can ! be displayed in a browser then you can embed the various template ! directives used elsewhere in OpenInteract. ! ! This package -- more specifically, the 'Page' handler in this package ! -- generally deals with all requests for which a handler is not ! found. This means a request like: http://www.mysite.com/reports/q1/sales ! will get passed to the 'Page' handler and that page object ! ('/reports/q1/sales') fetched. (More on this below.) Again, the ! content for that object can exist in the database or the filesystem, but to your users it looks like a static HTML page. *************** *** 35,39 **** But you can manage these files through the web interface and even intermingle (for instance) your PDFs and tarballs along with your HTML ! files. =head2 Handling all unspecified requests --- 44,48 ---- But you can manage these files through the web interface and even intermingle (for instance) your PDFs and tarballs along with your HTML ! files, keeping the same security settings for all of them. =head2 Handling all unspecified requests *************** *** 49,53 **** redir = page - This means if no action is found (an 'empty request') it will be serviced by the 'page' action, which is defined in this module's --- 58,61 ---- *************** *** 70,104 **** 'basic_page' SPOPS object. No longer. You can now display HTML pages from the filesystem as well as objects from the database, and refer to ! them in the exact same way. ! There are a few differences. Objects ! For instance, say you have database records representing HTML pages ! identified by the following locations: ! /mytest/test1 ! /mytest/test2 ! And HTML pages in the filesystem at the following locations: ! $SITE_HOME/html/mytest/test3.html ! $SITE_HOME/html/mytest/test4.html ! Then the following applies: ! Request Result ! =============== ========================= ! /mytest/test1 Served by SPOPS object from database ! /mytest/test3.html Served by filesystem ! /mytest/test4 File not found! ! /mytest/test2.html Served by SPOPS object from database ! The first three are pretty easy to understand, but the fourth is ! odd. When searching for files in the database, we take the requests ! and, if a file extension exists, chop it off as another name to ! check. This could lead to a nasty 'error' where you have a file in the ! filesystem '$SITE_HOME/html/mytest/test2.html' and a database object ! '/mytest/test2' -- if the database is being checked first, then the ! filesystem file will B<never be displayed>. =head1 SECURITY --- 78,114 ---- 'basic_page' SPOPS object. No longer. You can now display HTML pages from the filesystem as well as objects from the database, and refer to ! them in the exact same way. And people using the browser interface to ! edit browser-displayable content should be able to edit the content no ! matter where it is stored. ! Also, you can mix-and-match whether a particular page is stored in the ! filesystem or database. Each object knows where its content is stored, ! and that setting is independent of all other objects. ! Here's an example: ! my $page = $R->page->fetch( '/reports/q1/sales' ); ! The variable C<$page> now contains metadata about the page to be ! displayed -- title, author, keywords, MIME type, size (optional), and ! other information. The content has not yet been put into the object. ! To get the content, you just need to call: ! $page->fetch_content; ! And it will be retrieved into the object under the key 'content'. ! =head1 ALIASES ! ! You can define a page to be an alias for another page. An alias won't ! have any content of its own, it just acts as a pointer to the other ! page. This can be useful if you find that people are mistyping a ! particular page name, or if you've accidentally botched a page ! spelling in an advertisement, or for whatever reason. ! ! Note that an alias isn't a B<real> pointer to the other page. The ! C<show()> method in the handler just has some extra logic to deal with ! it. =head1 SECURITY *************** *** 154,178 **** docs. - =item * - - See that we handle file extensions (or lack thereof) consistently no - matter whether we're requesting an object from the database or a file - from the filesystem. - =back =head1 TO DO ! B<Map multiple URLs to one 'file'> ! Sometimes you might accidentally give out the wrong URL, or you might ! find that people constantly misspell the correct URL. It should be ! pretty simple to have a separate table of URL -> real URL mappings ! which we consult if we don't find a page. ! B<Map requests to URL fetches from other sites> ! It would be kind of interesting to map certain URLs to grab pages (or ! sections of pages) from other sites. (Probably illegal, but whatever.) =head1 SEE ALSO --- 164,181 ---- docs. =back =head1 TO DO ! B<Indexes> ! Be able to whip up a directory index on the fly, listing all files ! within that directory. ! B<Rewrite content> ! Allow subclasses for the storage facility so that developers can ! create a custom storage facility to do things like content rewriting, ! etc. =head1 SEE ALSO |