Ignore:
Timestamp:
08/11/14 16:07:55 (10 years ago)
Author:
olhsha@mpi.nl
Message:

Added group service. Tested via the tomcat on loclahots (test URI and postman), old unit tests are adjusted and work well. Todo: retest on localhost tomcat, look at run-time exceptions, add new unit tests, adjust front-end

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/ComponentRegistry.java

    r4098 r5549  
    2323    public static final String PUBLIC_NAME = "Public Registry";
    2424
     25   
     26   
     27    public Owner getRegistryOwner(); 
     28    public void setRegistryOwner(Owner registryOwner);     
     29   
     30    public RegistrySpace getRegistrySpace();
     31    public void setRegistrySpace(RegistrySpace registrySpace);
     32   
     33    public Number getGroupId();
     34    public void setGroupId(Number groupId);
     35   
     36    public Number getBaseDescriptionOwnerId(String cmdId);
     37   
     38    public List<Number> getItemGroups(String cmdId);
    2539    /**
    2640     * @return List of component descriptions ordered by name ascending
    2741     * @throws ComponentRegistryException
    2842     */
    29     List<ComponentDescription> getComponentDescriptions() throws ComponentRegistryException;
    30 
    31     /**
    32      * @param principalName
    33      * @param groupId
    34      * @return List of component descriptions ordered by name ascending
    35      * @throws ComponentRegistryException
    36      */
    37     List<ComponentDescription> getComponentDescriptionsInGroup(String principalName, String groupId) throws ComponentRegistryException;
    38 
    39     ComponentDescription getComponentDescription(String id) throws ComponentRegistryException;
    40 
     43    List<ComponentDescription> getComponentDescriptions() throws ComponentRegistryException, UserUnauthorizedException;
     44
     45   
     46    ComponentDescription getComponentDescriptionAccessControlled(String id) throws ComponentRegistryException, UserUnauthorizedException, ItemNotFoundException;
     47
     48   
    4149    /**
    4250     *
     
    4452     * @throws ComponentRegistryException
    4553     */
    46     List<ProfileDescription> getProfileDescriptions() throws ComponentRegistryException;
    47 
    48     /**
    49     * @param groupId
    50     * @return List of profile descriptions ordered by name ascending
    51     * @throws ComponentRegistryException
    52     */
    53    List<ProfileDescription> getProfileDescriptionsInGroup(String groupId) throws ComponentRegistryException;
     54    List<ProfileDescription> getProfileDescriptions() throws ComponentRegistryException, UserUnauthorizedException;
     55
    5456
    5557   /**
     
    6567    * @throws ComponentRegistryException
    6668    */
    67    List<ProfileDescription> getProfileDescriptionsForMetadaEditor(String groupId) throws ComponentRegistryException;
    68 
    69    ProfileDescription getProfileDescription(String id) throws ComponentRegistryException;
    70 
    71     CMDComponentSpec getMDProfile(String id) throws ComponentRegistryException;
     69   List<ProfileDescription> getProfileDescriptionsForMetadaEditor(Number groupId) throws ComponentRegistryException, UserUnauthorizedException;
     70
     71   ProfileDescription getProfileDescriptionAccessControlled(String id) throws ComponentRegistryException, UserUnauthorizedException, ItemNotFoundException;
     72
     73    CMDComponentSpec getMDProfileAccessControled(String id) throws ComponentRegistryException, UserUnauthorizedException, ItemNotFoundException;
     74
     75    CMDComponentSpec getMDComponentAccessControlled(String id) throws ComponentRegistryException, UserUnauthorizedException, ItemNotFoundException;
    7276
    7377    CMDComponentSpec getMDComponent(String id) throws ComponentRegistryException;
    74 
    7578    /**
    7679     *
     
    8487     * @return -1 if comment could not be registered
    8588     */
    86     int registerComment(Comment comment, String userId) throws ComponentRegistryException;
     89    int registerComment(Comment comment, String userId) throws ComponentRegistryException, ItemNotFoundException, UserUnauthorizedException;
    8790
    8891    /**
     
    9093     * @return -1 if component could not be updated
    9194     */
    92     int update(BaseDescription description, CMDComponentSpec spec, Principal principal, boolean forceUpdate);
     95    int update(BaseDescription description, CMDComponentSpec spec, boolean forceUpdate)  throws UserUnauthorizedException, ItemNotFoundException;
    9396
    9497    /**
     
    97100     * current (private) workspace to public workspace.
    98101     */
    99     int publish(BaseDescription desc, CMDComponentSpec spec, Principal principal);
    100 
    101     void getMDProfileAsXml(String profileId, OutputStream output) throws ComponentRegistryException;
    102 
    103     void getMDProfileAsXsd(String profileId, OutputStream outputStream) throws ComponentRegistryException;
    104 
    105     void getMDComponentAsXml(String componentId, OutputStream output) throws ComponentRegistryException;
    106 
    107     void getMDComponentAsXsd(String componentId, OutputStream outputStream) throws ComponentRegistryException;
    108 
    109     /**
    110      *
    111      * @param profileId
    112      * @param principal
     102    int publish(BaseDescription desc, CMDComponentSpec spec, Principal principal)  throws UserUnauthorizedException, ItemNotFoundException;
     103
     104    void getMDProfileAsXml(String profileId, OutputStream output) throws ComponentRegistryException, UserUnauthorizedException, ItemNotFoundException;
     105
     106    void getMDProfileAsXsd(String profileId, OutputStream outputStream) throws ComponentRegistryException, UserUnauthorizedException, ItemNotFoundException;
     107
     108    void getMDComponentAsXml(String componentId, OutputStream output) throws ComponentRegistryException, UserUnauthorizedException, ItemNotFoundException;
     109
     110    void getMDComponentAsXsd(String componentId, OutputStream outputStream) throws ComponentRegistryException, UserUnauthorizedException, ItemNotFoundException;
     111
     112    /**
     113     *
     114     * @param profileIds
    113115     * @throws IOException
    114116     * @throws UserUnauthorizedException
     
    116118     * @throws DeleteFailedException
    117119     */
    118     void deleteMDProfile(String profileId, Principal principal) throws IOException, UserUnauthorizedException, ComponentRegistryException, DeleteFailedException;
     120    void deleteMDProfile(String profileId) throws IOException, UserUnauthorizedException, ComponentRegistryException, DeleteFailedException, ItemNotFoundException;
    119121
    120122    /**
     
    130132     * @throws DeleteFailedException
    131133     */
    132     void deleteMDComponent(String componentId, Principal principal, boolean forceDelete) throws IOException, ComponentRegistryException, UserUnauthorizedException,
    133             DeleteFailedException;
     134    void deleteMDComponent(String componentId, boolean forceDelete) throws IOException, ComponentRegistryException, UserUnauthorizedException,
     135            DeleteFailedException, ItemNotFoundException;
    134136
    135137    /**
     
    149151    List<ProfileDescription> getUsageInProfiles(String componentId) throws ComponentRegistryException;
    150152
    151     /**
    152      * Return true if this registry is the public registry as opposed to a
    153      * registry used for the user privately.
    154      * */
    155     boolean isPublic();
    156 
    157     ComponentStatus getStatus();
    158 
    159     Owner getOwner();
     153 
    160154
    161155    /**
     
    168162     * @return List of profile descriptions ordered by name ascending
    169163     */
    170     List<ProfileDescription> getDeletedProfileDescriptions();
     164    List<ProfileDescription> getDeletedProfileDescriptions()throws ComponentRegistryException;
    171165
    172166    /**
     
    174168     * @return List of component descriptions ordered by name ascending
    175169     */
    176     List<ComponentDescription> getDeletedComponentDescriptions();
     170    List<ComponentDescription> getDeletedComponentDescriptions() throws ComponentRegistryException;
    177171
    178172    /**
     
    182176     * @throws ComponentRegistryException
    183177     */
    184     List<Comment> getCommentsInProfile(String profileId, Principal principal) throws ComponentRegistryException;
     178    List<Comment> getCommentsInProfile(String profileId) throws ComponentRegistryException, UserUnauthorizedException, ItemNotFoundException;
    185179
    186180    /**
     
    191185     * @throws ComponentRegistryException
    192186     */
    193     Comment getSpecifiedCommentInProfile(String profileId, String commentId, Principal principal) throws ComponentRegistryException;
     187    Comment getSpecifiedCommentInProfile(String profileId, String commentId) throws ComponentRegistryException, UserUnauthorizedException, ItemNotFoundException;
    194188
    195189    /**
     
    199193     * @throws ComponentRegistryException
    200194     */
    201     List<Comment> getCommentsInComponent(String componentId, Principal principal) throws ComponentRegistryException;
     195    List<Comment> getCommentsInComponent(String componentId) throws ComponentRegistryException, UserUnauthorizedException, ItemNotFoundException;
    202196
    203197    /**
     
    208202     * @throws ComponentRegistryException
    209203     */
    210     Comment getSpecifiedCommentInComponent(String componentId, String commentId, Principal principal) throws ComponentRegistryException;
     204    Comment getSpecifiedCommentInComponent(String componentId, String commentId) throws ComponentRegistryException, UserUnauthorizedException, ItemNotFoundException;
    211205
    212206    /**
     
    219213     * @throws DeleteFailedException
    220214     */
    221     public void deleteComment(String commentId, Principal principal) throws IOException, ComponentRegistryException, UserUnauthorizedException,
    222             DeleteFailedException;
     215    public void deleteComment(String commentId) throws IOException, ComponentRegistryException, UserUnauthorizedException,
     216            DeleteFailedException, ItemNotFoundException;
    223217
    224218    /**
     
    239233     */
    240234    List<String> getAllNonDeletedComponentIds();
     235   
     236    Boolean isItemPublic(String id) throws ItemNotFoundException;
     237   
    241238}
Note: See TracChangeset for help on using the changeset viewer.