source: ComponentRegistry/branches/jeaferversion/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/PublishAction.java @ 1639

Last change on this file since 1639 was 1639, checked in by jeafer, 12 years ago

Jean-Charles branch ComponentRegistry commit4,
Changes regarding comment on the ComponentRegistry.

Modification of classes Comment, CommentsDao?
Improvement of validation process for comments
Improvement of ComponentRegistryRestService?
Functionnal implementation of class test (RegisterHelper? and RestServiceTest?)

File size: 1.0 KB
Line 
1package clarin.cmdi.componentregistry.rest;
2
3import clarin.cmdi.componentregistry.model.Comment;
4import java.security.Principal;
5
6import clarin.cmdi.componentregistry.ComponentRegistry;
7import clarin.cmdi.componentregistry.components.CMDComponentSpec;
8import clarin.cmdi.componentregistry.model.AbstractDescription;
9import clarin.cmdi.componentregistry.model.RegisterResponse;
10
11public class PublishAction implements RegisterAction {
12   
13    private final Principal principal;
14
15    public PublishAction(Principal principal) {
16        this.principal = principal;
17    }
18
19    @Override
20    public int execute(AbstractDescription desc, CMDComponentSpec spec, RegisterResponse response, ComponentRegistry registry) {
21        response.setIsInUserSpace(false);
22        return registry.publish(desc, spec, principal);
23    }
24
25    @Override
26    public int executeComment(Comment com, RegisterResponse response, ComponentRegistry registry, String userId) {
27        throw new UnsupportedOperationException("Not supported yet.");
28    }
29
30}
Note: See TracBrowser for help on using the repository browser.