Beispiel #1
0
 public Set<Space> getAllSpaces() {
   IWikiDao dao = getWikiDao();
   Set<Space> spaces = new HashSet<Space>();
   Set<String> spaceNames = dao.loadSpaceNames(fValue.name);
   for (String spaceName : spaceNames) {
     Space space = getSpace(spaceName);
     if (space != null) spaces.add(space);
   }
   return spaces;
 }
Beispiel #2
0
 public Space newSpace(String spaceName) throws XWikiException {
   if (spaceName == null) throw new XWikiException("Space name is not defined");
   IWikiDao dao = getWikiDao();
   SpaceValue spaceValue = dao.loadSpaceInfo(fValue.name, spaceName);
   if (spaceValue != null)
     throw new XWikiException(
         "A space with such a name already exists. Name: '" + spaceName + "'. ");
   spaceValue = new SpaceValue(spaceName);
   dao.storeSpaceInfo(fValue.name, spaceValue);
   return new Space(this, spaceValue);
 }
Beispiel #3
0
 public Space getSpace(String spaceName) {
   IWikiDao dao = getWikiDao();
   SpaceValue spaceValue = dao.loadSpaceInfo(fValue.name, spaceName);
   return checkAccess(spaceValue) ? new Space(this, spaceValue) : null;
 }