Revision 5362
Added by berkley almost 14 years ago
MetacatHandler.java | ||
---|---|---|
33 | 33 |
import java.io.OutputStreamWriter; |
34 | 34 |
import java.io.PrintWriter; |
35 | 35 |
import java.io.StringReader; |
36 |
import java.io.ByteArrayOutputStream; |
|
36 | 37 |
import java.io.Writer; |
37 | 38 |
import java.net.MalformedURLException; |
38 | 39 |
import java.net.URL; |
... | ... | |
168 | 169 |
|
169 | 170 |
csv.flush(); |
170 | 171 |
response.flushBuffer(); |
171 |
|
|
172 |
|
|
172 | 173 |
rs.close(); |
173 | 174 |
|
174 | 175 |
} catch (SQLException e) { |
... | ... | |
905 | 906 |
} |
906 | 907 |
} |
907 | 908 |
|
909 |
/** |
|
910 |
* |
|
911 |
* @return |
|
912 |
*/ |
|
913 |
public void query(String metacatUrl, PrintWriter out, Hashtable<String, String[]>params, |
|
914 |
String username, String[] groups, String sessionid) |
|
915 |
throws Exception |
|
916 |
{ |
|
917 |
handleQuery(out, params, null, username, groups, sessionid); |
|
918 |
} |
|
919 |
|
|
920 |
/** |
|
921 |
* set the access permissions on the document specified |
|
922 |
*/ |
|
923 |
public void setAccess(String metacatUrl, String username, String docid, String principal, |
|
924 |
String permission, String permissionType, String permissionOrder) |
|
925 |
throws Exception |
|
926 |
{ |
|
927 |
Hashtable<String,String[]> params = new Hashtable(); |
|
928 |
params.put("principal", new String[] {principal}); |
|
929 |
params.put("permission", new String[] {permission}); |
|
930 |
params.put("permType", new String[] {permissionType}); |
|
931 |
params.put("permOrder", new String[] {permissionOrder}); |
|
932 |
params.put("docid", new String[]{docid}); |
|
933 |
|
|
934 |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
|
935 |
PrintWriter out = new PrintWriter(baos); |
|
936 |
handleSetAccessAction(out, params, username, null, null); |
|
937 |
System.out.println("Set acces to " + permission + " for document " + docid); |
|
938 |
} |
|
939 |
|
|
908 | 940 |
/** read metadata or data from Metacat |
909 | 941 |
* @throws PropertyNotFoundException |
910 | 942 |
* @throws ParseLSIDException |
Also available in: Unified diff
listObjects is almost working. need to get the result set parsed when returned to CrudService.