mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixed ALF-3085: UI Bootstrap - No root 'Web Projects' folder exists (is WCM enabled ?)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22904 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -112,6 +112,14 @@ public interface WebProjectService
|
|||||||
@NotAuditable
|
@NotAuditable
|
||||||
public WebProjectInfo createWebProject(WebProjectInfo wpInfo);
|
public WebProjectInfo createWebProject(WebProjectInfo wpInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines whether the "Web Projects" container node is present.
|
||||||
|
*
|
||||||
|
* @return true if the "Web Projects" container node is present
|
||||||
|
*/
|
||||||
|
@NotAuditable
|
||||||
|
public boolean hasWebProjectsRoot();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Web Projects container
|
* Returns the Web Projects container
|
||||||
*
|
*
|
||||||
|
@@ -438,7 +438,39 @@ public class WebProjectServiceImpl extends WCMUtil implements WebProjectService
|
|||||||
throw new AccessDeniedException("Only content managers may delete webapp '"+webAppName+"' (web project: "+wpNodeRef+")");
|
throw new AccessDeniedException("Only content managers may delete webapp '"+webAppName+"' (web project: "+wpNodeRef+")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @see org.alfresco.wcm.webproject.WebProjectService#hasWebProjectsRoot()
|
||||||
|
*/
|
||||||
|
public boolean hasWebProjectsRoot()
|
||||||
|
{
|
||||||
|
boolean hasRoot = false;
|
||||||
|
|
||||||
|
// Get the root 'web projects' folder
|
||||||
|
ResultSet resultSet = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
resultSet = this.searchService.query(WEBPROJECT_STORE, SearchService.LANGUAGE_LUCENE, "PATH:\""+getWebProjectsPath()+"\"");
|
||||||
|
if (resultSet.length() == 1)
|
||||||
|
{
|
||||||
|
hasRoot = true;
|
||||||
|
}
|
||||||
|
else if (resultSet.length() > 1 && logger.isWarnEnabled())
|
||||||
|
{
|
||||||
|
logger.warn("More than one root 'Web Projects' folder exists");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (resultSet != null)
|
||||||
|
{
|
||||||
|
resultSet.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return hasRoot;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the node reference that is the web projects root
|
* Get the node reference that is the web projects root
|
||||||
*
|
*
|
||||||
|
@@ -142,6 +142,12 @@ public class WebProjectServiceImplTest extends AbstractWCMServiceImplTest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testHasWebProjectsRoot()
|
||||||
|
{
|
||||||
|
// make sure there is a "Web Projects" container node
|
||||||
|
assertTrue(wpService.hasWebProjectsRoot());
|
||||||
|
}
|
||||||
|
|
||||||
public void testCreateWebProjectSimple()
|
public void testCreateWebProjectSimple()
|
||||||
{
|
{
|
||||||
// Create a web project
|
// Create a web project
|
||||||
|
Reference in New Issue
Block a user