Index: site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java =================================================================== --- site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java (revision 111791) +++ site-manage-tool/tool/src/java/org/sakaiproject/site/tool/SiteAction.java (working copy) @@ -667,6 +667,7 @@ /** the web content tool id **/ private final static String WEB_CONTENT_TOOL_ID = "sakai.iframe"; + private final static String SITE_INFO_TOOL_ID = "sakai.iframe.site"; private final static String WEB_CONTENT_TOOL_SOURCE_CONFIG = "source"; private final static String WEB_CONTENT_TOOL_SOURCE_CONFIG_VALUE = "http://"; @@ -2678,6 +2679,15 @@ .getAttribute(STATE_TOOL_HOME_SELECTED)); context.put("importSupportedTools", importTools()); + if(ServerConfigurationService.getBoolean("site-manage.importoption.siteinfo", false)){ + try{ + String siteInfoToolTitle = ToolManager.getTool(SITE_INFO_TOOL_ID).getTitle(); + context.put("siteInfoToolTitle", siteInfoToolTitle); + }catch(Exception e){ + + } + } + return (String) getContext(data).get("template") + TEMPLATE[27]; case 60: /* @@ -6219,7 +6229,7 @@ */ private String findOriginalToolId(SessionState state, String toolId) { // treat home tool differently - if (toolId.equals(TOOL_ID_HOME)) + if (toolId.equals(TOOL_ID_HOME) || SITE_INFO_TOOL_ID.equals(toolId)) { return toolId; } @@ -9728,11 +9738,15 @@ for (int k = 0; k < importSiteIds.size(); k++) { String fromSiteId = (String) importSiteIds.get(k); String toSiteId = site.getId(); - Map entityMap = transferCopyEntities(toolId, fromSiteId, toSiteId); - if(entityMap != null){ - transversalMap.putAll(entityMap); + if(SITE_INFO_TOOL_ID.equals(toolId)){ + copySiteInformation(fromSiteId, site); + }else{ + Map entityMap = transferCopyEntities(toolId, fromSiteId, toSiteId); + if(entityMap != null){ + transversalMap.putAll(entityMap); + } + resourcesImported = true; } - resourcesImported = true; } } } @@ -9794,9 +9808,13 @@ for (int k = 0; k < importSiteIds.size(); k++) { String fromSiteId = (String) importSiteIds.get(k); String toSiteId = site.getId(); - Map entityMap = transferCopyEntitiesMigrate(toolId, fromSiteId, toSiteId); - if(entityMap != null){ - transversalMap.putAll(entityMap); + if(SITE_INFO_TOOL_ID.equals(toolId)){ + copySiteInformation(fromSiteId, site); + }else{ + Map entityMap = transferCopyEntitiesMigrate(toolId, fromSiteId, toSiteId); + if(entityMap != null){ + transversalMap.putAll(entityMap); + } } } } @@ -9816,7 +9834,20 @@ } } // importToolIntoSiteMigrate + private void copySiteInformation(String fromSiteId, Site toSite){ + try { + Site fromSite = SiteService.getSite(fromSiteId); + //we must get the new site again b/c some tools (lesson builder) can make changes to the site structure (i.e. add pages). + Site editToSite = SiteService.getSite(toSite.getId()); + editToSite.setDescription(fromSite.getDescription()); + editToSite.setInfoUrl(fromSite.getInfoUrl()); + commitSite(editToSite); + toSite = editToSite; + } catch (IdUnusedException e) { + } + } + public void saveSiteStatus(SessionState state, boolean published) { Site site = getStateSite(state); site.setPublished(published); @@ -11320,8 +11351,11 @@ } } if(updated){ - newSite.setDescription(msgBody); + //update the site b/c some tools (Lessonbuilder) updates the site structure (add/remove pages) and we don't want to + //over write this try { + newSite = SiteService.getSite(newSite.getId()); + newSite.setDescription(msgBody); SiteService.save(newSite); } catch (IdUnusedException e) { // TODO: @@ -11418,6 +11452,10 @@ } } + if (ServerConfigurationService.getBoolean("site-manage.importoption.siteinfo", false)){ + rv.add(SITE_INFO_TOOL_ID); + } + return rv; } @@ -11462,7 +11500,11 @@ toolIdList.add(WEB_CONTENT_TOOL_ID); if (displayNews && !toolIdList.contains(NEWS_TOOL_ID)) toolIdList.add(NEWS_TOOL_ID); - + if (ServerConfigurationService.getBoolean("site-manage.importoption.siteinfo", false)){ + toolIdList.add(SITE_INFO_TOOL_ID); + } + + return toolIdList; } // getToolsAvailableForImport Index: site-manage-tool/tool/src/webapp/vm/sitesetup/chef_site-importSites.vm =================================================================== --- site-manage-tool/tool/src/webapp/vm/sitesetup/chef_site-importSites.vm (revision 111791) +++ site-manage-tool/tool/src/webapp/vm/sitesetup/chef_site-importSites.vm (working copy) @@ -38,6 +38,9 @@ #set($toolTitle = $t.getTitle()) #end #end + #if($toolId == "sakai.iframe.site") + #set($toolTitle = $siteInfoToolTitle) + #end

$toolTitle

#set ($siteCount=0)