Readme for Checkin 13-Aug-2008 Author: Bob Armstrong Summary This is an initial checkin covering some support features that will be required for an image picker. This checkin covers: - new configuration option to define an upload area as central, namespace centric or topic centric. (Default is central) - new configuration option to autocreate upload directories (Default is false) - primatives for thumbnail support with a new presentation class. Two types of thumbnails are available, clickable and non-clickable. Clickable thumbnails bring up the full image within a separate window. - Addition of the list operator #! to terminate all levels of a list. References List Termination o New, For compatibility with new parser Upload Area Configuration o Addresses most of feature request 1044912, image picker will complete this. o Part of an alternative organization method mentioned on the Flex Wiki V2 File Upload Page can now be configured if desired. Image and Thumbnail Support o Performance improvement and simpler syntax o New options for borders, titles and colours o Fix some undocumented bugs getting this to work with relative links under the old method, ie: "@@Image(federation.LinkMaker.LinkToImage("Namespaces/SampleNamespaceOne/i mages/Missile.jpg"),"Missile","300","150")@@":[@@Presentations.Link(federation.Lin kMaker.SimpleLinkTo("Namespaces/SampleNamespaceOne/images/Missile.jpg"), "Missile.jpg", "Missile.jpg")@@] just doesn’t work correctly. o Fixes 1238321 o Fixes 1044271 o Add fix for null doc title on document upload. File Changes The following files have been changed/added. Module/Filename FlexWiki.Web BaseHttpHandler.cs flexwiki.config.template FlexWikiApplicationConfiguration.cs FlexWikiWebApplication.cs Thumbnailer.aspx.cs Web.config WikiEdit.aspx.cs EngineSource Formatter.cs HTMLWikiOutput.cs Presentations.cs Status Comment New Mod For thumbnail support Added configuration options for Namespace and Topic centric upload areas Added configuration options Added configuration options For thumbnail support Added httpHandler Replace IsUploadable Add CheckWriteAccess Add 2 radio buttons for image and thumbnail links Add fixes for Namespace and Topic centric upload areas. Mod Mod New Mod Mod Mod Mod Mod ThumbnailPresentation.cs New WikiOutput.cs Mod Parser\WomDocument.cs FlexWiki.UnitTests BehaviourTests.cs Mod FormatterTests.cs Mod Mod Add list termination support Add thumbnail rendering Add Exposed Method call for ThumbnailPresentation Add Thumbnail Presentation Support Add abstract method for Thumbnails Add WriteThumbnail method Added 3 nunit tests for thumbnail generation: - 1 clickable - 1 non-clickable - 1 no title Add a test for list termination Assembly References FlexWiki.Web Project FlexWikiEngine log4net System System.configuration System.Data System.Drawing System.Net (new) System.Web System.Web.Services System.Xml EngineSource Project System System.configuration System.Data System.Web System.Xml List Termination The operator \t#! will terminate all levels of the current list, and reset the numbering back to 1. Example: ! List Termination Test # First # Second # Third # Second Level First #! Second Level Second # Second Level First # First Produces: Thumbnail Support Although there was a mechanism to previously simulate thumbnails, as in: "@@Image(federation.LinkMaker.LinkToImage("Namespaces/SampleNamespaceOne/i mages/Missile.jpg"),"Missile","300","150")@@":[http://localhost/mywiki/Namespaces/S ampleNamespaceOne/images/Missile.jpg] It was problematic. - used absolute url links to the image, which caused problems when moving the wiki to another site or cloning a site to another box. - poor network performance as the full image was downloaded to the browser and then resized in the browser - the clickable link would cause the current page to display the full image. If this page were closed you would lose your context within the wiki. - image often would be miss scaled as you wouldn’t know what size to use for the thumbnail - syntax is relatively tricky, and had to be hand keyed. To solve these issues and provide better thumbnail support (for an upcoming image picker). The following presentation primitive has been implemented. @@Presentations.Thumbnail(url,urlToImage,Image Title,Image Title Colour, Thumbnail size,Border Colour, Border Width, Border Style, Clickable) Parameters are: Parameter url urlToImage Image Title Image Title Colour Thumbnail Size Border Colour Border Size Border Style Clickable Comment path to the thumbnail link to the image, similar to the link syntax used in the Presentations.Image call, i.e. federation.LinkMaker.LinkToImage("upload/images/blackhawk.jpg") string containing the Image Title. If present the title will be centered below the thumbnail Colour tag for the Image Title Can be one of: small – generates a thumbnail scaled to 72 px medium – generates a thumbnail scaled to 144 px large – generates a thumbnail scaled to 288 px integer number – generates a thumbnail scaled to the number supplied in pixels Colour tag for the Border integer number indicating the size of the border style tag for the border type. Can be one of: none – generates no border hidden – generates no border dotted – generates a dotted border dashed – generates a dashed border solid – generates a solid border double – generates a double link border groove – generates a 3D grooved border ridge – generates a 3D ridged border inset – generates a 3D inset border outset – generates a 3D outset border if true then when you click the thumbnail a full size image will be displayed in a new window. Example: Displays a thumbnail scaled to 144px with a green title “Blackhawk” and a red dashed border of 3px. When clicked the full image will be displayed in a new window. Generates: The alt tag is also set to the title (in iexplorer this will show up as a label when a cursor goes over the image). To indicate that it is clickable the blue link symbol is shown on the right of the image. Here is another example, where a namespace centric upload area is used, and the thumbnails are various sizes. !! Images @@Presentations.Thumbnail("Namespaces/SampleNamespaceTwo/HomePage/images/Missile.jpg", federation.LinkMaker.LinkToImage("Namespaces/SampleNamespaceTwo/HomePage/images/Missile.jpg" ), "A Missile","green","small","red","5px","double","true")@@ @@Presentations.Thumbnail("Namespaces/SampleNamespaceTwo/HomePage/images/Missile.jpg", federation.LinkMaker.LinkToImage("Namespaces/SampleNamespaceTwo/HomePage/images/Missile.jpg" ), "A Missile","blue","medium","orange","5px","dashed","true")@@ @@Presentations.Thumbnail("Namespaces/SampleNamespaceTwo/HomePage/images/Missile.jpg", federation.LinkMaker.LinkToImage("Namespaces/SampleNamespaceTwo/HomePage/images/Missile.jpg" ), "A Missile","royalblue","large","yellow","5px","dotted","true")@@ @@Presentations.Thumbnail("Namespaces/SampleNamespaceTwo/HomePage/images/Missile.jpg", federation.LinkMaker.LinkToImage("Namespaces/SampleNamespaceTwo/HomePage/images/Missile.jpg" ), "A Missile","forestgreen","350","pink","5px","ridge","false")@@ !End of Test Produces: [Images deleted] The last thumbnail is a non-standard size and is non-clickable. To assist with the syntax, a helper has been added to the “File Upload and Attachment” section of the wiki editor. After uploading an image, if you select “Image Attachment” it will generate a @@Presentations.Image call on the page. If you select “Thumbnail Attachment”, it will generate a generic @@Presentations.Thumbnail call on the page. There are no selectable options currently, other than entering the document title. The title colour is set to green, a medium size thumbnail is generated, and a red dashed border is used, plus the thumbnail is clickable. If you need to change any of the attributes you will have to edit the call on the page. When the image picker is available, there will be a full set of options available to select. Upload Area Support Some sites would like to have different upload areas for each namespace they have defined. This is useful, if the site wants to restrict the upload area for a particular namespace to a specific group of people, or totally prevent uploads for one namespace but allow uploads for another. Having all of the images for a large site in one folder might be a problem as well for an image picker, you may have literally hundreds of images to scan through, so I have extended this further to have Topic central upload areas as well. I have retained the upload organization by ContentBase. If you have chosen each Namespace to have its own upload area, then hung off of the Namespace directory will be directories: images, doc, and html. The default upload organization is Central; one central upload directory is used indicated by the <ContentUploadType> configuration option. For Topic centric upload directories, a directory is created with the same name as the Topic, and directories: images, doc and html are below that. Maintenance wise it would be painful to have to pre-create all of these directories, so now there is a configurable option to precreate the upload directories if they don’t exist when you edit a topic. The default for this option is false, and it is recommended to enable this option only for internal sites where you trust your users. Within the flexwiki.config file, the following options are now available: Option <ContainerUploadType> <ContentUploadPath> <AutoCreateUploadDirectories> Comment Can be one of Central - indicates a central upload area Namespace – indicates a namespace centric upload area Topic – indicates a topic centric upload area Default is Central Used only if the ContainerUploadType is Central true or false value indicating whether to auto create the upload directories. Default is false. For example: If you have the following options within the flexwiki.config file <ContainerUploadType>Namespace</ContainerUploadType> <ContentUploadPath></ContentUploadPath> <AutoCreateUploadDirectories>true</AutoCreateUploadDirectories> If you are editing a topic within namespace SampleNamespaceOne, then directories will be created to hold images, docs and html RootUrl Namespaces SampleNamespaceOne images html doc The following has been added to the flexwiki.config.template <!-- Identifies the type of Container Upload Path Choices are: Central = A Central (Common) Upload Path for all Namespace = Uploads are loaded to a Content Upload individual Namespace. i.e. the RootUrl Topic = Uploads are loaded to a Content Upload Namespaces is used Path within each is the Namespace Directory Path for each Topic. --> <ContainerUploadType>Namespace</ContainerUploadType> <!-- When set to true will auto create the upload directories if they are missing The default for this setting is false --> <AutoCreateUploadDirectories>true</AutoCreateUploadDirectories> <!-- Identifies the path to a directory tree where uploads to the wiki will be stored. This path is used only if the ContainerUploadType is "Central", and ignored if the ContainerUploadType is Namespace or Topic. If this key does not exist and the type is Central, then the file upload and attachment controls will not be accessible in WikiEdit.aspx. If the directories do not exist and "AutoCreateUploadDirectories" is false then you will not be able to upload content. The directory tree is placed in the virtual directory at the root of the wiki and all directories must be precreated. In addition to the directories in the key, there are 3 other directories that must be created as subdirectories: images, html or doc. Using the key below as a sample the directory tree would be: RootUrl content upload images html doc --> <ContentUploadPath>content\upload</ContentUploadPath>