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/rest/IComponentRegistryRestService.java

    r4135 r5549  
    11package clarin.cmdi.componentregistry.rest;
    22
     3import clarin.cmdi.componentregistry.UserUnauthorizedException;
    34import java.io.IOException;
    45import java.io.InputStream;
     
    1314
    1415import clarin.cmdi.componentregistry.AllowedAttributetypesXML;
    15 import clarin.cmdi.componentregistry.ComponentRegistry;
    1616import clarin.cmdi.componentregistry.ComponentRegistryException;
    1717import clarin.cmdi.componentregistry.ComponentRegistryFactory;
     
    4444        public static final String GROUP_FORM_FIELD = "group";
    4545        public static final String DOMAIN_FORM_FIELD = "domainName";
    46         public static final String USERSPACE_PARAM = "userspace";
     46        public static final String REGISTRY_SPACE_PARAM = "registrySpace";
    4747        public static final String GROUPID_PARAM = "groupid";
    4848        public static final String METADATA_EDITOR_PARAM = "mdEditor";
    4949        public static final String NUMBER_OF_RSSITEMS = "limit";
    5050
    51         List<ComponentDescription> getRegisteredComponents(boolean userspace, String groupId)
    52                         throws ComponentRegistryException;
    53 
    54         List<ProfileDescription> getRegisteredProfiles(boolean userspace,
    55                         boolean metadataEditor, String groupId) throws ComponentRegistryException;
    56 
    57         Response getRegisteredComponent(String componentId, boolean userspace)
    58                         throws ComponentRegistryException;
    59 
    60         Response getRegisteredComponentRawType(String componentId, String rawType);
    61 
    62         ComponentRegistry findRegistry(String id,
    63                         RegistryClosure<? extends BaseDescription> clos)
    64                         throws ComponentRegistryException;
    65 
    66         Response getRegisteredProfile(String profileId, boolean userspace)
    67                         throws ComponentRegistryException;
    68 
    69         List<BaseDescription> getComponentUsage(String componentId,
    70                         boolean userspace) throws ComponentRegistryException;
    71 
    72         List<Comment> getCommentsFromProfile(String profileId, boolean userspace)
    73                         throws ComponentRegistryException;
    74 
    75         List<Comment> getCommentsFromComponent(String componentId, boolean userspace)
    76                         throws ComponentRegistryException;
    77 
    78         Comment getSpecifiedCommentFromProfile(String profileId, String commentId,
    79                         boolean userspace) throws ComponentRegistryException;
    80 
    81         Comment getSpecifiedCommentFromComponent(String componentId,
    82                         String commentId, boolean userspace)
    83                         throws ComponentRegistryException;
     51        List<ComponentDescription> getRegisteredComponents(String registrySpace, String groupId)
     52                        throws ComponentRegistryException, IOException, UserUnauthorizedException;
     53
     54        List<ProfileDescription> getRegisteredProfiles(String registrySpace, boolean metadataEditor, String groupId) throws ComponentRegistryException, IOException, UserUnauthorizedException;
     55
     56        Response getRegisteredComponent(String componentId) throws IOException;
     57
     58        Response getRegisteredProfile(String profileId) throws IOException;
     59       
     60        Response getRegisteredComponentRawType(String componentId, String rawType) throws ComponentRegistryException;
     61
     62       
     63//      ComponentRegistry findRegistry(String id,
     64//                      RegistryClosure<? extends BaseDescription> clos)
     65//                      throws ComponentRegistryException;
     66//
     67//     
     68
     69        List<BaseDescription> getComponentUsage(String componentId) throws ComponentRegistryException, IOException;
     70
     71        List<Comment> getCommentsFromProfile(String profileId) throws ComponentRegistryException, IOException;
     72
     73        List<Comment> getCommentsFromComponent(String componentId) throws ComponentRegistryException, IOException;
     74
     75        Comment getSpecifiedCommentFromProfile(String profileId, String commentId) throws ComponentRegistryException, IOException ;
     76
     77        Comment getSpecifiedCommentFromComponent(String componentId, String commentId) throws ComponentRegistryException, IOException ;
    8478
    8579        /**
     
    9286         * @return
    9387         */
    94         Response manipulateRegisteredProfile(String profileId, String method,
    95                         boolean userspace);
     88        Response manipulateRegisteredProfile(String profileId, String method);
    9689
    9790        Response manipulateCommentFromProfile(String profileId, String commentId,
    98                         String method, boolean userspace);
     91                        String method);
    9992
    10093        Response manipulateCommentFromComponent(String componentId,
    101                         String commentId, String method, boolean userspace);
     94                        String commentId, String method);
    10295
    10396        Response publishRegisteredProfile(String profileId, InputStream input,
    10497                        String name, String description, String group, String domainName);
    10598
    106         Response updateRegisteredProfile(String profileId, boolean userspace,
    107                         InputStream input, String name, String description, String group,
     99        Response updateRegisteredProfile(String profileId,
     100                        InputStream input, String name, String description, String groupId,
    108101                        String domainName);
    109102
     
    117110         * @return
    118111         */
    119         Response manipulateRegisteredComponent(String componentId, String method,
    120                         boolean userspace);
     112        Response manipulateRegisteredComponent(String componentId, String method);
    121113
    122114        Response publishRegisteredComponent(String componentId, InputStream input,
    123                         String name, String description, String group, String domainName);
    124 
    125         Response updateRegisteredComponent(String componentId, boolean userspace,
    126                         InputStream input, String name, String description, String group,
     115                        String name, String description, String groupId, String domainName);
     116
     117        Response updateRegisteredComponent(String componentId,
     118                        InputStream input, String name, String description, String groupId,
    127119                        String domainName);
    128120
    129         Response deleteRegisteredComponent(String componentId, boolean userspace);
    130 
    131         Response deleteRegisteredProfile(String profileId, boolean userspace);
    132 
    133         Response deleteCommentFromProfile(String profileId, String commentId,
    134                         boolean userspace);
    135 
    136         Response deleteCommentFromComponent(String componentId, String commentId,
    137                         boolean userspace);
    138 
    139         Response getRegisteredProfileRawType(String profileId, String rawType);
     121        Response deleteRegisteredComponent(String componentId);
     122
     123        Response deleteRegisteredProfile(String profileId);
     124
     125        Response deleteCommentFromProfile(String profileId, String commentId);
     126
     127        Response deleteCommentFromComponent(String componentId, String commentId);
     128
     129        Response getRegisteredProfileRawType(String profileId, String rawType) throws ComponentRegistryException;
    140130
    141131        Response registerProfile(InputStream input, String name,
    142                         String description, String group, String domainName,
    143                         boolean userspace);
     132                        String description, String groupId, String domainName);
    144133
    145134        Response registerComponent(InputStream input, String name,
    146                         String description, String group, String domainName,
    147                         boolean userspace);
    148 
    149         Response registerCommentInComponent(InputStream input, String componentId,
    150                         boolean userspace) throws ComponentRegistryException;
    151 
    152         Response registerCommentInProfile(InputStream input, String profileId,
    153                         boolean userspace) throws ComponentRegistryException;
     135                        String description, String groupId, String domainName);
     136
     137        Response registerCommentInComponent(InputStream input, String componentId) throws ComponentRegistryException;
     138
     139        Response registerCommentInProfile(InputStream input, String profileId) throws ComponentRegistryException;
    154140
    155141        Response pingSession();
     
    158144         * @param componentRegistryFactory the componentRegistryFactory to set
    159145         */
    160         void setComponentRegistryFactory(
    161                         ComponentRegistryFactory componentRegistryFactory);
     146        void setComponentRegistryFactory(ComponentRegistryFactory componentRegistryFactory);
    162147
    163148        /**
     
    169154         * @throws ParseException
    170155         */
    171         Rss getRssComponent(boolean userspace, String limit)
    172                         throws ComponentRegistryException, ParseException;
     156        Rss getRssComponent(String groupId, String registrySpace, String limit)
     157                        throws ComponentRegistryException, ParseException, IOException;
    173158
    174159        /**
     
    180165         * @throws ParseException
    181166         */
    182         Rss getRssProfile(boolean userspace, String limit)
    183                         throws ComponentRegistryException, ParseException;
     167        Rss getRssProfile(String groupId, String registrySpace, String limit)
     168                        throws ComponentRegistryException, ParseException, IOException;
    184169
    185170        /**
     
    194179         * @throws ParseException
    195180         */
    196         Rss getRssOfCommentsFromProfile(String profileId, boolean userspace,
    197                         String limit) throws ComponentRegistryException, IOException,
    198                         JAXBException, ParseException;
     181        Rss getRssOfCommentsFromProfile(String profileId, String limit) throws ComponentRegistryException,
     182                        JAXBException, ParseException, IOException;
    199183
    200184        /**
     
    209193         * @throws ParseException
    210194         */
    211         Rss getRssOfCommentsFromComponent(String componentId, boolean userspace,
     195        Rss getRssOfCommentsFromComponent(String componentId,
    212196                        String limit) throws ComponentRegistryException, IOException,
    213197                        JAXBException, ParseException;
     
    237221         * @param groupId
    238222         */
    239         void transferItemOwnershipToGroup(String itemId, long groupId);
     223        String transferItemOwnershipToGroup(String itemId, long groupId) throws IOException;
    240224       
    241225        /**
     
    244228         * @return
    245229         */
    246         BaseDescription getComponentDescription(String componentId) throws ComponentRegistryException;
     230        BaseDescription getBaseDescription(String componentId) throws ComponentRegistryException, IOException;
    247231
    248232}
Note: See TracChangeset for help on using the changeset viewer.