From 920a5647e341f792a5609cd80077d3d9a6c35787 Mon Sep 17 00:00:00 2001
From: gnaegi <none@none>
Date: Wed, 9 Oct 2013 16:07:34 +0200
Subject: [PATCH] OO-812 always open medatada editor when creating new pages in
 CP editor

---
 .../java/org/olat/ims/cp/ui/CPContentController.java | 12 ++++++++++++
 .../org/olat/ims/cp/ui/CPEditMainController.java     |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/olat/ims/cp/ui/CPContentController.java b/src/main/java/org/olat/ims/cp/ui/CPContentController.java
index f7f94b44714..bf20ae6fbe2 100644
--- a/src/main/java/org/olat/ims/cp/ui/CPContentController.java
+++ b/src/main/java/org/olat/ims/cp/ui/CPContentController.java
@@ -103,6 +103,7 @@ public class CPContentController extends BasicController {
 	/**
 	 * Displays the correct edit page when node with the given id is selected.
 	 * 
+	 * @param ureq
 	 * @param nodeID
 	 */
 	protected void displayPage(UserRequest ureq, String nodeID) {
@@ -126,6 +127,17 @@ public class CPContentController extends BasicController {
 		}
 		fireEvent(ureq, new Event("Page loaded"));
 	}
+	
+	/**
+	 * Displays the page editor and shows the metadata editor to rename the page
+	 * @param ureq
+	 * @param nodeID
+	 */
+	protected void displayPageWithMetadataEditor(UserRequest ureq, String nodeID) {
+		displayPage(ureq, nodeID);
+		displayMetadataEditor(ureq);
+	}
+	
 
 	/**
 	 * Set the content to display given the file path
diff --git a/src/main/java/org/olat/ims/cp/ui/CPEditMainController.java b/src/main/java/org/olat/ims/cp/ui/CPEditMainController.java
index 34138751dcc..7a1c6565032 100644
--- a/src/main/java/org/olat/ims/cp/ui/CPEditMainController.java
+++ b/src/main/java/org/olat/ims/cp/ui/CPEditMainController.java
@@ -168,7 +168,7 @@ public class CPEditMainController extends MainLayoutBasicController {
 				contentCtr.displayPage(ureq, nodeId);
 			} else if (event.getCommand().equals("New Page")) {
 				String newIdentifier = treeCtr.addNewHTMLPage();
-				contentCtr.displayPage(ureq, newIdentifier);
+				contentCtr.displayPageWithMetadataEditor(ureq, newIdentifier);
 			} else if (event instanceof NewCPPageEvent) {
 				contentCtr.displayPage(ureq, ((NewCPPageEvent) event).getCPPage().getIdentifier());
 			}
-- 
GitLab