Ignore:
Timestamp:
08/15/14 16:02:36 (10 years ago)
Author:
olhsha@mpi.nl
Message:

fixing serialisation issues for List<String>. Adding unit tests for goup service

File:
1 edited

Legend:

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

    r5552 r5553  
    2727
    2828/**
    29  * 
     29 *
    3030 * @author twago@mpi.nl
    3131 * @author olsha@mpi.nl
     
    3535@Path("/registry")
    3636@Singleton
    37 @Transactional(rollbackFor=Exception.class)
     37@Transactional(rollbackFor = Exception.class)
    3838public interface IComponentRegistryRestService {
    3939
    40         public static final String APPLICATION_BASE_URL_PARAM = "eu.clarin.cmdi.componentregistry.serviceRootUrl";
    41         public static final String DATA_FORM_FIELD = "data";
    42         public static final String NAME_FORM_FIELD = "name";
    43         public static final String DESCRIPTION_FORM_FIELD = "description";
    44         public static final String GROUP_FORM_FIELD = "group";
    45         public static final String DOMAIN_FORM_FIELD = "domainName";
    46         public static final String REGISTRY_SPACE_PARAM = "registrySpace";
    47         public static final String GROUPID_PARAM = "groupid";
    48         public static final String METADATA_EDITOR_PARAM = "mdEditor";
    49         public static final String NUMBER_OF_RSSITEMS = "limit";
    50 
    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        
     40    public static final String APPLICATION_BASE_URL_PARAM = "eu.clarin.cmdi.componentregistry.serviceRootUrl";
     41    public static final String DATA_FORM_FIELD = "data";
     42    public static final String NAME_FORM_FIELD = "name";
     43    public static final String DESCRIPTION_FORM_FIELD = "description";
     44    public static final String GROUP_FORM_FIELD = "group";
     45    public static final String DOMAIN_FORM_FIELD = "domainName";
     46    public static final String REGISTRY_SPACE_PARAM = "registrySpace";
     47    public static final String GROUPID_PARAM = "groupid";
     48    public static final String METADATA_EDITOR_PARAM = "mdEditor";
     49    public static final String NUMBER_OF_RSSITEMS = "limit";
     50
     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
    6362//      ComponentRegistry findRegistry(String id,
    6463//                      RegistryClosure<? extends BaseDescription> clos)
     
    6665//
    6766//     
    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 ;
    78 
    79         /**
    80          *
    81          * Purely helper method for my front-end (FLEX) which only does post/get
    82          * requests. The query param is checked and the "proper" method is called.
    83          *
    84          * @param profileId
    85          * @param method
    86          * @return
    87          */
    88         Response manipulateRegisteredProfile(String profileId, String method);
    89 
    90         Response manipulateCommentFromProfile(String profileId, String commentId,
    91                         String method);
    92 
    93         Response manipulateCommentFromComponent(String componentId,
    94                         String commentId, String method);
    95 
    96         Response publishRegisteredProfile(String profileId, InputStream input,
    97                         String name, String description, String group, String domainName);
    98 
    99         Response updateRegisteredProfile(String profileId,
    100                         InputStream input, String name, String description, String groupId,
    101                         String domainName);
    102 
    103         /**
    104          *
    105          * Purely helper method for my front-end (FLEX) which van only do post/get
    106          * requests. The query param is checked and the "proper" method is called.
    107          *
    108          * @param componentId
    109          * @param method
    110          * @return
    111          */
    112         Response manipulateRegisteredComponent(String componentId, String method);
    113 
    114         Response publishRegisteredComponent(String componentId, InputStream input,
    115                         String name, String description, String groupId, String domainName);
    116 
    117         Response updateRegisteredComponent(String componentId,
    118                         InputStream input, String name, String description, String groupId,
    119                         String domainName);
    120 
    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;
    130 
    131         Response registerProfile(InputStream input, String name,
    132                         String description, String groupId, String domainName);
    133 
    134         Response registerComponent(InputStream input, String name,
    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;
    140 
    141         Response pingSession();
    142 
    143         /**
    144          * @param componentRegistryFactory the componentRegistryFactory to set
    145          */
    146         void setComponentRegistryFactory(ComponentRegistryFactory componentRegistryFactory);
    147 
    148        
    149         Rss getRssComponent(String groupId, String registrySpace, String limit)
    150                         throws ComponentRegistryException, ParseException, IOException;
    151 
    152        
    153         Rss getRssProfile(String groupId, String registrySpace, String limit)
    154                         throws ComponentRegistryException, ParseException, IOException;
    155 
    156        
    157         Rss getRssOfCommentsFromProfile(String profileId, String limit) throws ComponentRegistryException,
    158                         JAXBException, ParseException, IOException;
    159 
    160        
    161         Rss getRssOfCommentsFromComponent(String componentId,
    162                         String limit) throws ComponentRegistryException, IOException,
    163                         JAXBException, ParseException;
    164 
    165         AllowedAttributetypesXML getAllowedAttributeTypes()
    166                         throws ComponentRegistryException, IOException, JAXBException,
    167                         ParseException;
    168        
    169         void setFileNamesFromListToNull(List<CMDComponentType> listofcomponents);
    170        
    171         /**
    172          * Get a list of groups the user is a member of
    173          * @return
    174          */
    175         List<Group> getGroupsTheCurrentUserIsAMemberOf();
    176 
    177         /**
    178          * Get a list of groups the item is available to. For all practical reasons, this will return either 0 or 1 groups
    179          * @param itemId ID of component or profile. This is not the DB id but the logical ID which is unique across components and profiles
    180          * @return List of groups
    181          */
    182         List<Group> getGroupsTheItemIsAMemberOf(String itemId);
    183        
    184         /**
    185          * Transfer ownership of an item (group/profile) to a group
    186          * @param itemId
    187          * @param groupId
    188          */
    189         Response transferItemOwnershipToGroup(String itemId, long groupId) throws IOException;
    190        
    191         /**
    192          * Get any component (public or private) with the specified ID
    193          * @param componentId
    194          * @return
    195          */
    196         BaseDescription getBaseDescription(String componentId) throws ComponentRegistryException, IOException;
    197 
     67    List<BaseDescription> getComponentUsage(String componentId) throws ComponentRegistryException, IOException;
     68
     69    List<Comment> getCommentsFromProfile(String profileId) throws ComponentRegistryException, IOException;
     70
     71    List<Comment> getCommentsFromComponent(String componentId) throws ComponentRegistryException, IOException;
     72
     73    Comment getSpecifiedCommentFromProfile(String profileId, String commentId) throws ComponentRegistryException, IOException;
     74
     75    Comment getSpecifiedCommentFromComponent(String componentId, String commentId) throws ComponentRegistryException, IOException;
     76
     77    /**
     78     *
     79     * Purely helper method for my front-end (FLEX) which only does post/get
     80     * requests. The query param is checked and the "proper" method is called.
     81     *
     82     * @param profileId
     83     * @param method
     84     * @return
     85     */
     86    Response manipulateRegisteredProfile(String profileId, String method);
     87
     88    Response manipulateCommentFromProfile(String profileId, String commentId,
     89            String method);
     90
     91    Response manipulateCommentFromComponent(String componentId,
     92            String commentId, String method);
     93
     94    Response publishRegisteredProfile(String profileId, InputStream input,
     95            String name, String description, String group, String domainName);
     96
     97    Response updateRegisteredProfile(String profileId,
     98            InputStream input, String name, String description, String groupId,
     99            String domainName);
     100
     101    /**
     102     *
     103     * Purely helper method for my front-end (FLEX) which van only do post/get
     104     * requests. The query param is checked and the "proper" method is called.
     105     *
     106     * @param componentId
     107     * @param method
     108     * @return
     109     */
     110    Response manipulateRegisteredComponent(String componentId, String method);
     111
     112    Response publishRegisteredComponent(String componentId, InputStream input,
     113            String name, String description, String groupId, String domainName);
     114
     115    Response updateRegisteredComponent(String componentId,
     116            InputStream input, String name, String description, String groupId,
     117            String domainName);
     118
     119    Response deleteRegisteredComponent(String componentId);
     120
     121    Response deleteRegisteredProfile(String profileId);
     122
     123    Response deleteCommentFromProfile(String profileId, String commentId);
     124
     125    Response deleteCommentFromComponent(String componentId, String commentId);
     126
     127    Response getRegisteredProfileRawType(String profileId, String rawType) throws ComponentRegistryException;
     128
     129    Response registerProfile(InputStream input, String name,
     130            String description, String groupId, String domainName);
     131
     132    Response registerComponent(InputStream input, String name,
     133            String description, String groupId, String domainName);
     134
     135    Response registerCommentInComponent(InputStream input, String componentId) throws ComponentRegistryException;
     136
     137    Response registerCommentInProfile(InputStream input, String profileId) throws ComponentRegistryException;
     138
     139    Response pingSession();
     140
     141    /**
     142     * @param componentRegistryFactory the componentRegistryFactory to set
     143     */
     144    void setComponentRegistryFactory(ComponentRegistryFactory componentRegistryFactory);
     145
     146    Rss getRssComponent(String groupId, String registrySpace, String limit)
     147            throws ComponentRegistryException, ParseException, IOException;
     148
     149    Rss getRssProfile(String groupId, String registrySpace, String limit)
     150            throws ComponentRegistryException, ParseException, IOException;
     151
     152    Rss getRssOfCommentsFromProfile(String profileId, String limit) throws ComponentRegistryException,
     153            JAXBException, ParseException, IOException;
     154
     155    Rss getRssOfCommentsFromComponent(String componentId,
     156            String limit) throws ComponentRegistryException, IOException,
     157            JAXBException, ParseException;
     158
     159    AllowedAttributetypesXML getAllowedAttributeTypes()
     160            throws ComponentRegistryException, IOException, JAXBException,
     161            ParseException;
     162
     163    void setFileNamesFromListToNull(List<CMDComponentType> listofcomponents);
     164
     165 
     166
     167    /**
     168     * Get any component (public or private) with the specified ID
     169     *
     170     * @param componentId
     171     * @return
     172     */
     173    BaseDescription getBaseDescription(String componentId) throws ComponentRegistryException, IOException;
     174
     175    // Group Service
     176   
     177     /**
     178     * Get a list of groups the user is a member of
     179     *
     180     * @return
     181     */
     182    List<Group> getGroupsTheCurrentUserIsAMemberOf();
     183
     184   
     185   
     186     /**
     187     * Get a list of groups the item is available to. For all practical reasons,
     188     * this will return either 0 or 1 groups
     189     *
     190     * @param itemId ID of component or profile. This is not the DB id but the
     191     * logical ID which is unique across components and profiles
     192     * @return List of groups
     193     */
     194    List<Group> getGroupsTheItemIsAMemberOf(String itemId);
     195
     196    /**
     197     * Transfer ownership of an item (group/profile) to a group
     198     *
     199     * @param itemId
     200     * @param groupId
     201     */
     202    Response transferItemOwnershipToGroup(String itemId, long groupId) throws IOException;
     203   
     204    // (added by Olha)
     205   
     206    Response createNewGroup(String groupName) throws IOException;
     207
     208    List<Group> getGroupsOwnedByUser(String pricipalName) throws IOException;
     209
     210    Response listGroupNames() throws IOException;
     211
     212    Response isOwner(String groupName) throws IOException;
     213
     214    Response makeGroupMember(String groupName, String principalName) throws IOException;
     215   
     216    //Response removeGroupMember(String groupName, String principalName) throws IOException;
     217
     218    Response listProfiles(String groupId) throws IOException;
     219
     220    Response listComponents(String groupId) throws IOException;
     221
     222    Response getGroupNameById(String groupId) throws IOException;
     223
     224    Response getGroupIdByName(String groupName) throws IOException;
    198225}
Note: See TracChangeset for help on using the changeset viewer.