source: ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/PublishAction.java @ 1087

Last change on this file since 1087 was 1087, checked in by patdui, 13 years ago

Publishing components/profiles results in a move from private to public workspace: http://trac.clarin.eu/ticket/57

File size: 767 bytes
Line 
1package clarin.cmdi.componentregistry.rest;
2
3import java.security.Principal;
4
5import clarin.cmdi.componentregistry.ComponentRegistry;
6import clarin.cmdi.componentregistry.components.CMDComponentSpec;
7import clarin.cmdi.componentregistry.model.AbstractDescription;
8import clarin.cmdi.componentregistry.model.RegisterResponse;
9
10public class PublishAction implements RegisterAction {
11   
12    private final Principal principal;
13
14    public PublishAction(Principal principal) {
15        this.principal = principal;
16    }
17
18    @Override
19    public int execute(AbstractDescription desc, CMDComponentSpec spec, RegisterResponse response, ComponentRegistry registry) {
20        response.setIsInUserSpace(false);
21        return registry.publish(desc, spec, principal);
22    }
23
24}
Note: See TracBrowser for help on using the repository browser.