Skip to content

Commit

Permalink
Various invalid character fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
OrchardCMS committed Nov 30, 2011
1 parent 458d706 commit 4ee23d2
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 70 deletions.
8 changes: 4 additions & 4 deletions Documentation/Alternates.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ All templates for alternates must reside in the _Views_ folder. The _Views_ fold

Shape type | Template Folder
-------------- | ----------------
Content item | _Views\Items_
Parts | _Views\Parts_
Fields | _Views\Fields_
EditorTemplate | _Views\EditorTemplates\\[template type folder\]_ (For example, an **EditorTemplate** for a part is located at _Views\EditorTemplates\Parts_.)
Content item | _Views\\Items_
Parts | _Views\\Parts_
Fields | _Views\\Fields_
EditorTemplate | _Views\\EditorTemplates\\[template type folder\]_ (For example, an **EditorTemplate** for a part is located at _Views\EditorTemplates\Parts_.)
All other | _Views_

For example, to create an alternate template for the **Tags** part, you can add a template to the _MyTheme\Views\Parts_ folder. However, because the underscore can be converted to either a dot (.) or backslash (\), you can also create a template in the _Views_ folder and add _Parts._ to the beginning of the name. A template at either _Views\Parts\Tags.ShowTags-BlogPost.cshtml_ or _Views\Parts.Tags.ShowTags-BlogPost.cshtml_ will map to a shape named `Parts_Tags_ShowTags__BlogPost`.
Expand Down
10 changes: 5 additions & 5 deletions Documentation/Automation-test-guidance.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Though Selenium does a great job for us to generate C# test code, however, many
If you see common steps/verifications in more 2 test cases, you'd better to think moving the steps to a helper class (classes derived from class HelperBase).

# Create a simple test by using the test framework
Let's say you are going to create a test which verifies a link named Admin is presented, for Administrators. Below is the tests based on the test framework:
Let's say you are going to create a test which verifies a link named "Admin" is presented, for Administrators. Below is the tests based on the test framework:


[TestMethod]
public void CanNotAccessAdminPanelTestHelper()
{
TestLibrary.UserHelper.LogOn(Administrator”, “0123456);
TestLibrary.UserHelper.LogOn("Administrator", "0123456");
Assert.IsFalse(selenium.IsElementPresent("link=Admin"));
}

Expand Down Expand Up @@ -73,11 +73,11 @@ If you need throw an exception from your test code, indicates test code error. P
if (owner != null)
throw new CaseErrorException("Set owner is not implemented yet!");

...
}


If a null reference is passed to parameter title, this is a bug in test code. In order to distinguish test bugs from product bugs, we'd better throw an instance of CaseErrorException, with the original exception as its inner exception. This is useful in controller test, because the test code calls controllers directly, we need a way to distinguish test bugs from product bugs, while investigate test failures.
If a null reference is passed to parameter "title", this is a bug in test code. In order to distinguish test bugs from product bugs, we'd better throw an instance of CaseErrorException, with the original exception as its inner exception. This is useful in controller test, because the test code calls controllers directly, we need a way to distinguish test bugs from product bugs, while investigate test failures.

## Class TestLibrary.Consts
Please put all constants to this class, for e.g. the default administrator name/password in the test database.
Expand All @@ -92,7 +92,7 @@ Please check the following article to understand how data driven tests is done i
<http://www.julmar.com/blog/mark/PermaLink,guid,e47f09cc-e893-46a6-aa13-7202d4e50986.aspx>

## Running tests against different browsers
In order to run all tests on different browsers, and reuse the same test logics. The test code saves browsers settings in the excel file. Test team developed a script, which adds browser settings, such as *opera”, “*iexplore and e.t.c to the excel files. So in test case automation phase, just put test data in the excel files is fine. The script is run before any tests, which adds browser settings to all excel files and copy the files to %TestOutputDir%.
In order to run all tests on different browsers, and reuse the same test logics. The test code saves browsers settings in the excel file. Test team developed a script, which adds browser settings, such as "*opera", "*iexplore" and e.t.c to the excel files. So in test case automation phase, just put test data in the excel files is fine. The script is run before any tests, which adds browser settings to all excel files and copy the files to %TestOutputDir%.

There is another way to launch different browser, selenium remote control sever has a switch called -forcedBrowserMode, this switch overrides settings (hard code brower string) in ocde. This is also quite convenient while debugging test failures.

Expand Down
26 changes: 13 additions & 13 deletions Documentation/Bug-bash-1-18-2010.markdown
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@


* Archive data is not displayed in all themes (e.g. classic theme, green theme)
* Need a Preview button for editing pages and posts
* (loudej) Need to bring back the Delete this draft operation on the page/post editing page (perhaps as a small link to deemphasize it, ala WordPress)
* Need a "Preview" button for editing pages and posts
* (loudej) Need to bring back the "Delete this draft" operation on the page/post editing page (perhaps as a small link to deemphasize it, ala WordPress)
* Theme Preview button to be implemented
* (heskew) Implement Javascript Datetime Picker for post/page scheduling UI
* (suhacan-FIXED) Need ability to delete a user in Manage Users
Expand All @@ -28,9 +28,9 @@


* Bulk operations on Manage Blog page (e.g. delete post) (put same drop downs that we have for pages on top of blog list)
* Bulk operations on Manage Blogs page, like CMS pages (put same drop downs that we have for pages on top of blog post list)
* Bulk operations on Manage Blogs page, like CMS pages... (put same drop downs that we have for pages on top of blog post list)
* Ability to filter posts by published/draft/schedule on Manage Blogs , like CMS pages
* How to Unpublish a post on the Manage Blog page? Like CMS pages
* How to Unpublish a post on the Manage Blog page? Like CMS pages...
* Blog Details Page needs UI cleanup (placement, icons need text), also need ability to View blog from here:
* Media list is inconsistent: all other contents have separate edit links. For media, you click on the image name.
* All screens that have bulk actions have a header item in the drop down. Media has delete only (which also redirects to the root)
Expand All @@ -41,17 +41,17 @@


* Finalize this text: Possible text about setting up and managing a blog goes here.
* New Post: helper text for Tags (comma-separated)
* New Post: helper text for "Tags" (comma-separated)
* Finalize this text: "X" Allow new comments, Enable to show the comment form. Disabling still allows the existing comments to be shown but does not allow the conversation to continue.
* Your Site in Admin header should render Site Name setting instead (should be separate from preview site link?)
* Rename Manage Folders to Manage Media
* "Your Site" in Admin header should render Site Name setting instead (should be separate from "preview site" link?)
* Rename "Manage Folders" to "Manage Media"


**Do Later:**


* What UI do we want for change ownership? Do we want to display owner textbox on every content item?
* If only one blog, Manage Blog goes to blog details page. Else goes to list of blogs (as it is today). May also need a way to get to a specific blog from the admin panel menu.
* If only one blog, "Manage Blog" goes to blog details page. Else goes to list of blogs (as it is today). May also need a way to get to a specific blog from the admin panel menu.
Stylesheet applied to TinyMCE content should be style of applied theme.
* Revisit whether we should validate duplicate slugs at publish-time (log a bug for this)
* Uploading an image file should attempt to extract title or subject from embedded meta-data and make those the values for the image name and caption.
Expand All @@ -61,7 +61,7 @@ Stylesheet applied to TinyMCE content should be style of applied theme.

**Untriaged:**
* None
* XMLRPC/LiveWriter support seems to be broken. I found Louis' previous instructions, which said to type http://localhost:<port>/xmlrpc. However, I tried that and it didn't work. Any ideas?
* XMLRPC/LiveWriter support seems to be broken. I found Louis' previous instructions, which said to type "http://localhost:<port>/xmlrpc. However, I tried that and it didn't work. Any ideas?


**No repro:**
Expand All @@ -71,25 +71,25 @@ Stylesheet applied to TinyMCE content should be style of applied theme.


**DONE:**
* (erikpo-FIXED)When in an archive page, the archive navigation with the collapsible years should be there too. Here's what I was doing: I clicked on the January 2010 archive link from my blog, then I clicked the 2010 link. That didn't give me a way to get back to January. Two ways this can be fixed is by showing subarchives links under where you are (2010 would have a link for January) or you have the full archive menu there at all times (that's probably simpler).
* (erikpo-FIXED)When in an archive page, the archive navigation with the collapsible years should be there too. Here's what I was doing: I clicked on the January 2010 archive link from my blog, then I clicked the "2010" link. That didn't give me a way to get back to January. Two ways this can be fixed is by showing "subarchives" links under where you are (2010 would have a link for January) or you have the full archive menu there at all times (that's probably simpler).
* (rpaquay-FIXED) Attempting to access an incorrectly cased page results in a null ref exception: create a page with the slug "About" (uppercase A) then try to access "/about" (lowercase a).
* (erikpo-FIXED) Finish blog archive and remove fake archive data
* (rpaquay-FIXED) Bug: Exception: When creating a new post (no theme applied) - System.InvalidOperationException: The view 'NotFound' or its master was not found.
* (rpaquay-FIXED) Bug: Draft posts affect the number of posts listed for a blog (on front-end and back-end)
* (suhacan-FIXED) Bug: When saving a draft post, should redirect to/Edit admin URL for that post
* (suhacan-FIXED) Bug: When publishing a post from the edit post page, should redirect to the list of posts
* (suhacan-FIXED) Bug: When publishing a post from the "edit post" page, should redirect to the list of posts
* (suhacan-FIXED) Bug: Post Publishing Now button on Blog Details page throws 404 error
* (heskew-FIXED) Blog slug generation: "!!!Brad's Blog!!!" -Brad-s-Blog- (remove beginning/trailing slashes)
* (heskew-FIXED) Blog slug generation: "todo: (heskew) need path to here"
* (heskew-FIXED; still need to be selective on when to show the manage bits) When I'm on a post's front-end page, logged in as an admin/author/owner with the default blue theme, I don't have a direct link to edit the post.
* (rpaquay-FIXED) Page front-end has weird URLs: http://localhost:30320/Pages/Page/Item?slug=About (it used to work) (heskew: ISlugConstraint functionality hasn't been hooked up since cms pages migration)
* (rpaquay-FIXED) Why do published posts still say Draft on the blog front-end page? (bug <- related to create as published problems?)
* (rpaquay-FIXED) Why do published posts still say "Draft" on the blog front-end page? (bug <- related to create as published problems?)



* (rpaquay-FIXED) Implement "true" versioning for blog posts (we currently only keep the latest version of posts in the DB)
* (heskew-FIXED) We need to use IDs instead of slugs for admin URLs where slugs aren't guaranteed to be unique
* (rpaquay-FIXED) Implement ?? comments on: Manage Blog (for blog), Blog Details Page (for posts in a list) - both admin and front-end (for now we are going to append aspect UI in some deterministic order at some placeholder in a template, similar to what we do for aspects on a content item editor today). Will tackle the bigger problem of UI composition and placement within a template later (not sure if before Mix?). "xx Comments" in admin for blog post summary should be a link to comments page filtered on the blog post. FIX COMMENTS ON BLOG POST TO BE CONSISTENT! (Punt on blog for now)
* (rpaquay-FIXED) Implement "?? comments" on: Manage Blog (for blog), Blog Details Page (for posts in a list) - both admin and front-end (for now we are going to append aspect UI in some deterministic order at some placeholder in a template, similar to what we do for aspects on a content item editor today). Will tackle the bigger problem of UI composition and placement within a template later (not sure if before Mix?). "xx Comments" in admin for blog post summary should be a link to comments page filtered on the blog post. FIX COMMENTS ON BLOG POST TO BE CONSISTENT! (Punt on blog for now)



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ After you accept the license terms, Orchard is installed.

Open a command window and change the current directory to point to the root of the site. Then run `bin\orchard.exe`.

![Figure 6. The Orchard command line](../Attachments/Creating-a-module-with-a-simple-text-editor/s_07_OrchardCLI.png)
[![Figure 6. The Orchard command line](../Attachments/Creating-a-module-with-a-simple-text-editor/s_07_OrchardCLI.png)](../Attachments/Creating-a-module-with-a-simple-text-editor/07_OrchardCLI.png)

Type `help commands` to get the list of available commands. For now, only the `help` and `setup` commands are available. However, as Orchard is developed and modules are activated, new commands will become available. (The Orchard command-line executable actually discovers the commands from the modules inside of the application.)

To set up the site, enter the following command:


setup /SiteName:Orchard /AdminUsername:admin /AdminPassword:123456 /DatabaseProvider:SqlCe
setup /SiteName:Orchard /AdminUsername:admin /AdminPassword:123456
/DatabaseProvider:SqlCe


This is equivalent to setting up the site from the web interface.
Expand Down
8 changes: 4 additions & 4 deletions Documentation/Pages-editing.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ The slug rules are described here: [Slugs](slugs).
## Orphaned contents
When the user switches the page to a layout that has less zones than the previous ones, he is potentially creating orphaned contents. We don't throw that contents away or try to merge them. We also don't try to reassign if the zone names are different, even if the number of zones is the same.

Instead, we display the following message in the top alert zone: You have switched to a template that does not have the same content zones as the previous one, resulting in some of your contents not showing up on your site. You can either delete that content or copy it into another zone.
Instead, we display the following message in the top alert zone: "You have switched to a template that does not have the same content zones as the previous one, resulting in some of your contents not showing up on your site. You can either delete that content or copy it into another zone."

In the admin screen for the page, we show the orphaned contents with an alert This content is assigned to a zone that does not exist in the current template. Please delete it or copy it to another zone.
In the admin screen for the page, we show the orphaned contents with an alert "This content is assigned to a zone that does not exist in the current template. Please delete it or copy it to another zone."

When the page is saved, we delete empty orphaned contents. By empty, we mean empty of contents, not necessarily empty string: &lt;p&gt;&lt;/p&gt; is empty contents. Warning, &lt;img src=foo.gif/&gt; is not.
When the page is saved, we delete empty orphaned contents. By empty, we mean empty of contents, not necessarily empty string: &lt;p&gt;&lt;/p&gt; is empty contents. Warning, &lt;img src="foo.gif"/&gt; is not.

## Preview
When the user clicks the Preview button, we need to create a draft. We've considered making that draft temporary and not a full draft. We also talked about the potential concurrency issues associated with this. Those concurrency issues actually also exist when saving a draft, the difference here is that the operation is implicit.
When the user clicks the "Preview" button, we need to create a draft. We've considered making that draft "temporary" and not a full draft. We also talked about the potential concurrency issues associated with this. Those concurrency issues actually also exist when saving a draft, the difference here is that the operation is implicit.

For the moment, we'll ignore the concurrent editing scenarios and let the latest draft, implicit or explicit, win. There is still always only one draft at any given time.
Clicking preview is exactly equivalent to saving as a draft and then navigating to the url for the draft in a new window. The draft is not automatically deleted.
Expand Down
8 changes: 4 additions & 4 deletions Documentation/Slugs.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
The slug admin UI shows the first part of the URL as read only and follows that immediately with a textbox that is wide enough to accommodate long slugs.

We should explain what a slug is and what it's used for right in the admin UI as many users will not be familiar with that notion:
A ‘slug' is what Orchard uses to build a unique and readable address for your pages. You can usually trust the system to build one for you from the title or you can tweak it to make it shorter or more or less explicit, at your convenience. An example of slug is 'about-us'.
"A ‘slug' is what Orchard uses to build a unique and readable address for your pages. You can usually trust the system to build one for you from the title or you can tweak it to make it shorter or more or less explicit, at your convenience. An example of slug is 'about-us'."

## Validation

* A slug can't be empty. The slug that we store in the database should never be empty, but the user is allowed to not enter a slug. In that case, we generate one for him (see below).
* A slug can't be more than (some arbitrariness here) 1000 characters, which allows for some reasonable additions such as /json or the first parts of the url without a great risk of hitting IE's 2048 char limit for the URL. Message: Please keep the slug under a thousand characters.
* A slug can't be more than (some arbitrariness here) 1000 characters, which allows for some reasonable additions such as /json or the first parts of the url without a great risk of hitting IE's 2048 char limit for the URL. Message: "Please keep the slug under a thousand characters."
* A slug can have international characters and should conform to the RFC for IRI (International Resource Identifier): [RFC 3987](http://tools.ietf.org/html/rfc3987), which is supported by all modern browsers. A slug can include slashes (/) but each token between slashes must conform to RFC 3987 and not include any of the following characters: ":", "/", "?", "\#", "\[", "\]", "@", "\!", "$", "&", "'", "\(", "\)", "\*", "\+", ",", ";", "=", " ".
Please do not use any of the following characters in your slugs: ":", "?", "\#", "\[", "\]", "@", "\!", "$", "&", "'", "\(", "\)", "\*", "\+", ",", ";", "=". No spaces are allowed (please use dashes or underscores instead).
"Please do not use any of the following characters in your slugs: ":", "?", "\#", "\[", "\]", "@", "\!", "$", "&", "'", "\(", "\)", "\*", "\+", ",", ";", "=". No spaces are allowed (please use dashes or underscores instead)."

## Slug generation

Expand All @@ -21,6 +21,6 @@ The slug can be changed even after the resource has been created. This is somewh

Note that we allow forward slashes into the slug, which allows the user to manually introduce some hierarchy even though we don't support parent pages.

The slug prefix is built from the application path and the currently configured routes for the module. For example, if the application URL is http://mydomain/mysite and the URL for the resource with slug my-slug is ~/pages/my-slug, we prefix the slug input field with http://mydomain/mysite/pages/.
The slug prefix is built from the application path and the currently configured routes for the module. For example, if the application URL is "http://mydomain/mysite" and the URL for the resource with slug "my-slug" is "~/pages/my-slug", we prefix the slug input field with "http://mydomain/mysite/pages/".

When the generated or manually entered slug is discovered by the server to not be unique, it should be made unique by adding a number after it.
Loading

0 comments on commit 4ee23d2

Please sign in to comment.