diff --git a/olat3/webapp/WEB-INF/src/org/olat/course/repository/ImportCourseController.java b/olat3/webapp/WEB-INF/src/org/olat/course/repository/ImportCourseController.java index 1fc31121b02a9b27d61cfeb666cf870b1b2a843b..cefbd04003098bd7d75e3c90809e214cd10f1e3f 100644 --- a/olat3/webapp/WEB-INF/src/org/olat/course/repository/ImportCourseController.java +++ b/olat3/webapp/WEB-INF/src/org/olat/course/repository/ImportCourseController.java @@ -22,6 +22,7 @@ package org.olat.course.repository; import java.io.File; +import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.List; @@ -228,9 +229,16 @@ public class ImportCourseController extends BasicController implements IAddContr return; } callback.setResourceable(newCourseResource); - // Set title of root node. do not call course.getTitle() at this point. - callback.setDisplayName(course.getEditorTreeModel().getRootNode().getTitle()); callback.setResourceName(fCourseImportZIP.getName()); + + final File exportDir = new File(course.getCourseBaseContainer().getBasefile(),"/exportd/"); + if(exportDir.exists() && exportDir.canRead()){ + final RepositoryEntryImportExport importExport = new RepositoryEntryImportExport(exportDir); + callback.setDisplayName(importExport.getDisplayName()); + callback.setDescription(importExport.getDescription()); + }else{ + logError("Directory "+exportDir.getAbsolutePath()+" not found", new FileNotFoundException()); + } // collect all nodes collectNodesAsList((CourseEditorTreeNode)course.getEditorTreeModel().getRootNode(), nodeList); nodeListPos = 0; diff --git a/olat3/webapp/WEB-INF/src/org/olat/repository/controllers/RepositoryAddCallback.java b/olat3/webapp/WEB-INF/src/org/olat/repository/controllers/RepositoryAddCallback.java index 5757c322fd4c7b5be390763ef9e87c7093ab9bec..8fe2f8cfe91e21353db727c7ee84219c1c925671 100644 --- a/olat3/webapp/WEB-INF/src/org/olat/repository/controllers/RepositoryAddCallback.java +++ b/olat3/webapp/WEB-INF/src/org/olat/repository/controllers/RepositoryAddCallback.java @@ -40,7 +40,8 @@ public class RepositoryAddCallback { private OLATResourceable resourceable; private String resourceName; private String displayName; - + private String description; + protected RepositoryAddCallback() { // only allow to be instantiated without addController by repository itself. } @@ -93,6 +94,21 @@ public class RepositoryAddCallback { this.displayName = displayName; } + + /** + * + * @param description + */ + public void setDescription(final String description){ + this.description = description; + } + + + protected String getDescription() { + return description; + } + + /** * Call finished() upon success. Must have set all data before calling finished. * This will return to the calling controller. diff --git a/olat3/webapp/WEB-INF/src/org/olat/repository/controllers/RepositoryAddController.java b/olat3/webapp/WEB-INF/src/org/olat/repository/controllers/RepositoryAddController.java index 7278565a8af4b61a155cb6c55a0b3931539a109e..1279ddfa032e35ed547aa24b5a9f179de020444c 100644 --- a/olat3/webapp/WEB-INF/src/org/olat/repository/controllers/RepositoryAddController.java +++ b/olat3/webapp/WEB-INF/src/org/olat/repository/controllers/RepositoryAddController.java @@ -365,6 +365,13 @@ public class RepositoryAddController extends BasicController { String resName = addCallback.getResourceName(); if (resName == null) resName = ""; addedEntry.setResourcename(resName); + + String resDescription = addCallback.getDescription(); + if(resDescription == null){ + resDescription = ""; + } + addedEntry.setDescription(resDescription); + // Do set access for owner at the end, because unfinished course should be invisible // addedEntry.setAccess(RepositoryEntry.ACC_OWNERS); addedEntry.setAccess(0);//Access for nobody