mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V4.2-BUG-FIX (4.2.1) to HEAD (Cloud/4.3)
56434: Merged V4.1-BUG-FIX (4.1.7) to V4.2-BUG-FIX (4.2.1) Merged V4.1.6 (4.1.6) to V4.1-BUG-FIX (4.1.7) 56432: MNT-8891: Reverse merged in V4.1.6 51111: MNT-8891 Spaces in wiki page's title are replaced by underscores In name property spaces replased on "%20". 51341: MNT-8891: Deleted the line of code where it was substituting whitespaces in the wiki's title with underscores (This might have been missed during merging. rev: 51111). ALF-19020: Added code to remove the leading and trailing whitespaces in the wiki's title. 52729: MNT-8891: Fixed wiki's title renaming issue by adding code to remove the leading and trailing whitespaces in the wiki's title instead of replacing all the whitespaces with underscores. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@56641 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -141,7 +141,7 @@ public class WikiServiceImpl implements WikiService
|
|||||||
private static String buildName(String title)
|
private static String buildName(String title)
|
||||||
{
|
{
|
||||||
// The name is based on the title, but with underscores
|
// The name is based on the title, but with underscores
|
||||||
String name = title.replaceAll(" ", "%20");
|
String name = title.replace(' ', '_');
|
||||||
name = name.replaceAll("\"", "%22");
|
name = name.replaceAll("\"", "%22");
|
||||||
name = name.replaceAll("[*]", "%2a");
|
name = name.replaceAll("[*]", "%2a");
|
||||||
name = name.replaceAll("<", "%3c");
|
name = name.replaceAll("<", "%3c");
|
||||||
|
@@ -212,13 +212,13 @@ public class WikiServiceImplTest
|
|||||||
page.setContents("This is new content");
|
page.setContents("This is new content");
|
||||||
|
|
||||||
page = WIKI_SERVICE.updateWikiPage(page);
|
page = WIKI_SERVICE.updateWikiPage(page);
|
||||||
assertEquals("New%20Title", page.getSystemName()); // Name has underscores
|
assertEquals("New_Title", page.getSystemName()); // Name has underscores
|
||||||
assertEquals("New Title", page.getTitle());
|
assertEquals("New Title", page.getTitle());
|
||||||
|
|
||||||
|
|
||||||
// Fetch, and check
|
// Fetch, and check
|
||||||
page = WIKI_SERVICE.getWikiPage(WIKI_SITE.getShortName(), page.getSystemName());
|
page = WIKI_SERVICE.getWikiPage(WIKI_SITE.getShortName(), page.getSystemName());
|
||||||
assertEquals("New%20Title", page.getSystemName()); // Name has underscores
|
assertEquals("New_Title", page.getSystemName()); // Name has underscores
|
||||||
assertEquals("New Title", page.getTitle());
|
assertEquals("New Title", page.getTitle());
|
||||||
assertEquals("This is new content", page.getContents());
|
assertEquals("This is new content", page.getContents());
|
||||||
assertEquals(TEST_USER, page.getCreator());
|
assertEquals(TEST_USER, page.getCreator());
|
||||||
@@ -238,7 +238,7 @@ public class WikiServiceImplTest
|
|||||||
testNodesToTidy.add(page.getNodeRef());
|
testNodesToTidy.add(page.getNodeRef());
|
||||||
|
|
||||||
// Check it
|
// Check it
|
||||||
assertEquals("Title%20Space", page.getSystemName());
|
assertEquals("Title_Space", page.getSystemName());
|
||||||
assertEquals("Title Space", page.getTitle());
|
assertEquals("Title Space", page.getTitle());
|
||||||
assertEquals("This Is Some Content", page.getContents());
|
assertEquals("This Is Some Content", page.getContents());
|
||||||
assertEquals(TEST_USER, page.getCreator());
|
assertEquals(TEST_USER, page.getCreator());
|
||||||
@@ -251,7 +251,7 @@ public class WikiServiceImplTest
|
|||||||
|
|
||||||
// Check
|
// Check
|
||||||
page = WIKI_SERVICE.getWikiPage(WIKI_SITE.getShortName(), page.getSystemName());
|
page = WIKI_SERVICE.getWikiPage(WIKI_SITE.getShortName(), page.getSystemName());
|
||||||
assertEquals("Title%20Space", page.getSystemName());
|
assertEquals("Title_Space", page.getSystemName());
|
||||||
assertEquals("Title Space", page.getTitle());
|
assertEquals("Title Space", page.getTitle());
|
||||||
assertEquals("Changed contents", page.getContents());
|
assertEquals("Changed contents", page.getContents());
|
||||||
assertEquals(TEST_USER, page.getCreator());
|
assertEquals(TEST_USER, page.getCreator());
|
||||||
|
Reference in New Issue
Block a user