@Test @Override public void testGetAdminObject() throws SQLException { assertThat("testGetAdminObject 0", (Community)c.getAdminObject(Constants.REMOVE), equalTo(c)); assertThat("testGetAdminObject 1", (Community)c.getAdminObject(Constants.ADD), equalTo(c)); assertThat("testGetAdminObject 2", c.getAdminObject(Constants.DELETE), nullValue()); assertThat("testGetAdminObject 3", (Community)c.getAdminObject(Constants.ADMIN), equalTo(c)); }
public DSpaceObject getAdminObject(int action) throws SQLException { DSpaceObject adminObject = null; switch (action) { case Constants.REMOVE: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementDeletion()) { adminObject = this; } break; case Constants.DELETE: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementDeletion()) { adminObject = getParentCommunity(); } break; case Constants.ADD: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementCreation()) { adminObject = this; } break; default: adminObject = this; break; } return adminObject; }
Community extends DSpaceObject { public DSpaceObject getAdminObject(int action) throws SQLException { DSpaceObject adminObject = null; switch (action) { case Constants.REMOVE: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementDeletion()) { adminObject = this; } break; case Constants.DELETE: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementDeletion()) { adminObject = getParentCommunity(); } break; case Constants.ADD: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementCreation()) { adminObject = this; } break; default: adminObject = this; break; } return adminObject; } }
Community extends DSpaceObject { public DSpaceObject getAdminObject(int action) throws SQLException { DSpaceObject adminObject = null; switch (action) { case Constants.REMOVE: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementDeletion()) { adminObject = this; } break; case Constants.DELETE: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementDeletion()) { adminObject = getParentCommunity(); } break; case Constants.ADD: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementCreation()) { adminObject = this; } break; default: adminObject = this; break; } return adminObject; } Community(Context context, TableRow row); }
Community extends DSpaceObject { public DSpaceObject getAdminObject(int action) throws SQLException { DSpaceObject adminObject = null; switch (action) { case Constants.REMOVE: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementDeletion()) { adminObject = this; } break; case Constants.DELETE: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementDeletion()) { adminObject = getParentCommunity(); } break; case Constants.ADD: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementCreation()) { adminObject = this; } break; default: adminObject = this; break; } return adminObject; } Community(Context context, TableRow row); static Community find(Context context, int id); static Community create(Community parent, Context context); static Community create(Community parent, Context context, String handle); static Community[] findAll(Context context); static Community[] findAllTop(Context context); int getID(); String getHandle(); String getMetadata(String field); void setMetadata(String field, String value); String getName(); Bitstream getLogo(); Bitstream setLogo(InputStream is); void update(); Group createAdministrators(); void removeAdministrators(); Group getAdministrators(); Collection[] getCollections(); Community[] getSubcommunities(); Community getParentCommunity(); Community[] getAllParents(); Collection createCollection(); Collection createCollection(String handle); void addCollection(Collection c); Community createSubcommunity(); Community createSubcommunity(String handle); void addSubcommunity(Community c); void removeCollection(Collection c); void removeSubcommunity(Community c); void delete(); boolean equals(Object other); int hashCode(); int getType(); boolean canEditBoolean(); void canEdit(); int countItems(); DSpaceObject getAdminObject(int action); DSpaceObject getParentObject(); }
Community extends DSpaceObject { public DSpaceObject getAdminObject(int action) throws SQLException { DSpaceObject adminObject = null; switch (action) { case Constants.REMOVE: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementDeletion()) { adminObject = this; } break; case Constants.DELETE: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementDeletion()) { adminObject = getParentCommunity(); } break; case Constants.ADD: if (AuthorizeConfiguration.canCommunityAdminPerformSubelementCreation()) { adminObject = this; } break; default: adminObject = this; break; } return adminObject; } Community(Context context, TableRow row); static Community find(Context context, int id); static Community create(Community parent, Context context); static Community create(Community parent, Context context, String handle); static Community[] findAll(Context context); static Community[] findAllTop(Context context); int getID(); String getHandle(); String getMetadata(String field); void setMetadata(String field, String value); String getName(); Bitstream getLogo(); Bitstream setLogo(InputStream is); void update(); Group createAdministrators(); void removeAdministrators(); Group getAdministrators(); Collection[] getCollections(); Community[] getSubcommunities(); Community getParentCommunity(); Community[] getAllParents(); Collection createCollection(); Collection createCollection(String handle); void addCollection(Collection c); Community createSubcommunity(); Community createSubcommunity(String handle); void addSubcommunity(Community c); void removeCollection(Collection c); void removeSubcommunity(Community c); void delete(); boolean equals(Object other); int hashCode(); int getType(); boolean canEditBoolean(); void canEdit(); int countItems(); DSpaceObject getAdminObject(int action); DSpaceObject getParentObject();  }