source: MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/CollectionProxyAction.java @ 1108

Last change on this file since 1108 was 1108, checked in by gaba, 13 years ago

Collections - jstree solution, CustomTermsets? - load, save to WorkspaceProfile?

File size: 1.5 KB
Line 
1package eu.clarin.cmdi.mdservice.action;
2
3import java.io.IOException;
4import java.net.MalformedURLException;
5import java.net.URL;
6
7import net.sf.json.JSONObject;
8import net.sf.json.xml.XMLSerializer;
9
10/**
11 *
12 *
13 */
14public class CollectionProxyAction extends GenericProxyAction {
15
16        private static final long serialVersionUID = 1L;
17       
18        private String proxy_key = "collections";
19
20         protected void  initialize(){
21                 // default ;
22                 setMaxdepth(2);
23         }
24        @Override 
25        public String getFullFormat() {
26                return "collection2" + getFormat();
27        }
28       
29        @Override
30        public String getProxyKey() {
31                return proxy_key;
32        }
33       
34       
35        public URL getTargetRequest() throws IOException {
36               
37                URL targetURL = null;
38                //targetURL =new URL( getBaseURL(), getActionkey());
39                //FIXME: get maxdepth-constant out of here !!
40                String params = "";
41                params = "&maxdepth=" + getMaxdepth();
42                params = params + "&collection=";
43                if (getCollection() != null){
44                        params = params + getCollection();
45                }
46                targetURL = new URL(getBaseURL(), "?operation=getCollections" + params);
47                //Admin.notifyUser("CollectionProxy.targetURL:" + targetURL);
48
49            return targetURL;
50        }
51       
52       
53        @Override
54        public URL getBaseURL() throws MalformedURLException {         
55                if (base_url == null) {
56                        //base_url = new URL(Admin.getConfig().getProperty(getProxyKey() + ".uri"));
57                        base_url = new URL(getRepositoryPath());
58                                                //Admin.notifyUser("TEST-URLnew:" + base_url.toString());
59                       
60                }
61                return base_url;
62        }
63
64
65}
Note: See TracBrowser for help on using the repository browser.