Project

General

Profile

« Previous | Next » 

Revision 45211

codebase used to migrate to java8 the production system

View differences:

modules/dnet-modular-is-ui/trunk/deploy.info
1
{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-modular-is-ui/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "dnet-modular-is-ui"}
modules/dnet-modular-is-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/is/InformationServiceEntryPointController.java
1
package eu.dnetlib.functionality.modular.ui.is;
2

  
3
import javax.servlet.http.HttpServletRequest;
4
import javax.servlet.http.HttpServletResponse;
5

  
6
import org.springframework.ui.ModelMap;
7

  
8
import eu.dnetlib.functionality.modular.ui.ModuleEntryPoint;
9

  
10
public class InformationServiceEntryPointController extends ModuleEntryPoint {
11

  
12
	@Override
13
	protected void initialize(final ModelMap map, final HttpServletRequest request, final HttpServletResponse response) throws Exception {
14

  
15
	}
16

  
17
}
modules/dnet-modular-is-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/is/InformationServiceInternalController.java
1
package eu.dnetlib.functionality.modular.ui.is;
2

  
3
import java.io.IOException;
4
import java.io.StringReader;
5
import java.net.HttpURLConnection;
6
import java.net.URL;
7
import java.util.*;
8
import javax.annotation.Resource;
9
import javax.servlet.ServletOutputStream;
10
import javax.servlet.ServletResponse;
11
import javax.xml.transform.dom.DOMResult;
12
import javax.xml.xpath.XPathFactory;
13

  
14
import com.google.common.base.Splitter;
15
import com.google.common.collect.Iterables;
16
import com.google.common.collect.Lists;
17
import com.google.common.collect.Maps;
18
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException;
19
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
20
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
21
import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
22
import eu.dnetlib.enabling.is.sn.SubscriptionRegistry;
23
import eu.dnetlib.enabling.is.sn.resourcestate.ResourceStateSubscription;
24
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
25
import eu.dnetlib.functionality.modular.ui.AbstractAjaxController;
26
import eu.dnetlib.functionality.modular.ui.is.bulk.ProfileImporter;
27
import eu.dnetlib.functionality.modular.ui.is.objects.*;
28
import eu.dnetlib.functionality.modular.ui.is.objects.ServiceDesc.ServiceStatus;
29
import eu.dnetlib.miscutils.datetime.DateUtils;
30
import org.apache.commons.io.IOUtils;
31
import org.apache.commons.lang.StringUtils;
32
import org.apache.commons.lang.math.NumberUtils;
33
import org.apache.commons.logging.Log;
34
import org.apache.commons.logging.LogFactory;
35
import org.dom4j.Document;
36
import org.dom4j.io.SAXReader;
37
import org.springframework.stereotype.Controller;
38
import org.springframework.web.bind.annotation.RequestMapping;
39
import org.springframework.web.bind.annotation.RequestParam;
40
import org.springframework.web.bind.annotation.ResponseBody;
41

  
42
@Controller
43
public class InformationServiceInternalController extends AbstractAjaxController {
44

  
45
	@Resource
46
	private UniqueServiceLocator serviceLocator;
47

  
48
	@Resource(name = "modularUiProfileImporter")
49
	private ProfileImporter profileImporter;
50

  
51
	/**
52
	 * is sn subscription registries.
53
	 */
54
	@Resource(name = "issResourceStateNotificationRegistry")
55
	private transient SubscriptionRegistry registry;
56

  
57
	private static final Log log = LogFactory.getLog(InformationServiceInternalController.class);
58

  
59
	@RequestMapping("/ui/is/xquery.do")
60
	public @ResponseBody
61
	List<String> query(@RequestParam(value = "query", required = true) final String query) throws Exception {
62
		log.debug("Executing xquery: " + query);
63
		return serviceLocator.getService(ISLookUpService.class).quickSearchProfile(query);
64
	}
65

  
66
	@RequestMapping("/ui/is/listSchemas.do")
67
	public @ResponseBody
68
	List<String> listSchemas() throws Exception {
69
		return serviceLocator.getService(ISLookUpService.class).listResourceTypes();
70
	}
71

  
72
	@RequestMapping("/ui/is/getSchema.do")
73
	public @ResponseBody
74
	String getSchema(@RequestParam(value = "name", required = true) final String name) throws Exception {
75
		return serviceLocator.getService(ISLookUpService.class).getResourceTypeSchema(name);
76
	}
77

  
78
	@RequestMapping("/ui/is/listCollections.do")
79
	public @ResponseBody
80
	List<CollectionDesc> listCollections() throws Exception {
81
		final String xquery = "for $kind in xmldb:get-child-collections('/db/DRIVER') " +
82
				"for $type in xmldb:get-child-collections(concat('/db/DRIVER/', $kind)) " +
83
				"return concat ($kind, ' @@@ ', $type, ' @@@ ', count(xmldb:get-child-resources(concat('/db/DRIVER/', $kind, '/', $type))))";
84

  
85
		final Map<String, CollectionDesc> map = Maps.newHashMap();
86
		for (String s : serviceLocator.getService(ISLookUpService.class).quickSearchProfile(xquery)) {
87
			final String[] arr = s.split("@@@");
88
			final String kind = arr[0].trim();
89
			final String type = arr[1].trim();
90
			final int size = NumberUtils.toInt(arr[2].trim(), 0);
91
			if (!map.containsKey(kind)) {
92
				map.put(kind, new CollectionDesc(kind));
93
			}
94
			map.get(kind).addType(type, size);
95
		}
96

  
97
		final List<CollectionDesc> res = Lists.newArrayList(map.values());
98
		for (CollectionDesc d : res) {
99
			Collections.sort(d.getTypes());
100
		}
101
		Collections.sort(res);
102

  
103
		return res;
104
	}
105

  
106
	@RequestMapping("/ui/is/listProfiles.do")
107
	public @ResponseBody
108
	List<String> listProfiles(@RequestParam(value = "kind", required = true) final String kind,
109
			@RequestParam(value = "type", required = true) final String type) throws Exception {
110
		final String collName = "/db/DRIVER/" + kind + "/" + type;
111
		final String xquery = "distinct-values(for $x in collection('" + collName + "') return $x//RESOURCE_IDENTIFIER/@value/string())";
112
		final List<String> res = serviceLocator.getService(ISLookUpService.class).quickSearchProfile(xquery);
113

  
114
		Collections.sort(res);
115

  
116
		return res;
117
	}
118

  
119
	@RequestMapping("/ui/is/getProfile.do")
120
	public @ResponseBody
121
	String getProfiles(@RequestParam(value = "id", required = true) final String id) throws Exception {
122
		return serviceLocator.getService(ISLookUpService.class).getResourceProfile(id);
123
	}
124

  
125
	@RequestMapping("/ui/is/registerProfile.do")
126
	public @ResponseBody
127
	String registerProfile(@RequestParam(value = "profile", required = true) final String profile) throws Exception {
128
		return serviceLocator.getService(ISRegistryService.class).registerProfile(profile);
129
	}
130

  
131
	@RequestMapping("/ui/is/updateProfile.do")
132
	public @ResponseBody
133
	String updateProfile(@RequestParam(value = "profile", required = true) final String profile) throws Exception {
134
		final SAXReader reader = new SAXReader();
135
		final Document doc = reader.read(new StringReader(profile));
136

  
137
		final String id = doc.valueOf("//RESOURCE_IDENTIFIER/@value");
138
		final String type = doc.valueOf("//RESOURCE_TYPE/@value");
139

  
140
		if (StringUtils.isEmpty(id)) {
141
			throw new Exception("RESOURCE_IDENTIFIER is empty");
142
		} else if (StringUtils.isEmpty(type)) {
143
			throw new Exception("RESOURCE_TYPE is empty");
144
		} else if (serviceLocator.getService(ISRegistryService.class).updateProfile(id, profile, type)) {
145
			return id;
146
		} else {
147
			throw new Exception("Profile not updated");
148
		}
149
	}
150

  
151
	@RequestMapping("/ui/is/deleteProfile.do")
152
	public @ResponseBody
153
	boolean deleteProfile(@RequestParam(value = "id", required = true) final String id) throws Exception {
154
		return serviceLocator.getService(ISRegistryService.class).deleteProfile(id);
155
	}
156

  
157
	@RequestMapping("/ui/is/import.do")
158
	public @ResponseBody
159
	Map<String, Integer> importProfiles(
160
			@RequestParam(value = "path", required = true) final String path,
161
			@RequestParam(value = "profiles", required = true) final boolean profiles,
162
			@RequestParam(value = "schemas", required = true) final boolean schemas) throws Exception {
163

  
164
		log.info("importing profiles/schemas from " + path);
165

  
166
		final Map<String, Integer> res = Maps.newHashMap();
167
		if (schemas) {
168
			res.putAll(profileImporter.importSchemas(path + "/**/*.xsd"));
169
		}
170
		if (profiles) {
171
			res.putAll(profileImporter.importProfiles(path + "/**/*.xml"));
172
		}
173

  
174
		return res;
175
	}
176

  
177
	@RequestMapping("/ui/is/listBlackboards.do")
178
	public @ResponseBody
179
	List<BlackboardMessage> listBlackboards() throws Exception {
180
		final List<BlackboardMessage> list = Lists.newArrayList();
181

  
182
		final SAXReader reader = new SAXReader();
183

  
184
		for (String xml : serviceLocator
185
				.getService(ISLookUpService.class)
186
				.quickSearchProfile(
187
						"for $x in collection('/db/DRIVER/ServiceResources')//MESSAGE return <message>{$x/../../..//RESOURCE_TYPE}{$x/../../..//RESOURCE_IDENTIFIER}{$x}</message>")) {
188
			final BlackboardMessage info = new BlackboardMessage();
189
			final Document doc = reader.read(new StringReader(xml));
190
			info.setProfId(doc.valueOf(".//RESOURCE_IDENTIFIER/@value"));
191
			info.setMessageId(doc.valueOf(".//@id"));
192
			info.setResourceType(doc.valueOf(".//RESOURCE_TYPE/@value"));
193
			info.setAction(doc.valueOf(".//ACTION"));
194
			info.setDate(doc.valueOf(".//@date"));
195
			info.setActionStatus(doc.valueOf(".//ACTION_STATUS"));
196
			info.setError(doc.valueOf(".//PARAMETER[@name='error']/@value"));
197
			list.add(info);
198
		}
199
		return list;
200
	}
201

  
202
	@RequestMapping("/ui/is/getMetaWfIdForFamily.do")
203
	public @ResponseBody
204
	Map<String, String> getMetaWfId(@RequestParam(value = "family", required = true) final String family) throws ISLookUpException {
205
		final String xq = "for $x in collection('/db/DRIVER/MetaWorkflowDSResources/MetaWorkflowDSResourceType') " +
206
				"where $x//METAWORKFLOW_NAME/@family='" + family + "' " +
207
				"return concat($x//RESOURCE_IDENTIFIER/@value, ' @@@ ', $x//METAWORKFLOW_SECTION)";
208

  
209
		final Map<String, String> map = Maps.newHashMap();
210
		try {
211
			final String[] arr = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery(xq).split("@@@");
212
			map.put("id", arr[0].trim());
213
			map.put("section", arr[1].trim());
214
		} catch (ISLookUpDocumentNotFoundException e) {
215
			map.put("id", "");
216
			map.put("section", "");
217
		}
218
		map.put("family", family);
219

  
220
		return map;
221
	}
222

  
223
	@RequestMapping("/ui/is/listServices.do")
224
	public @ResponseBody
225
	Collection<ServiceGrouperDesc> listServices() throws Exception {
226
		final String xq = IOUtils.toString(getClass().getResourceAsStream("/eu/dnetlib/functionality/modular/xquery/listServices.xquery"));
227

  
228
		final List<ServiceDesc> list = Lists.newArrayList();
229

  
230
		final SAXReader reader = new SAXReader();
231
		for (String s : serviceLocator.getService(ISLookUpService.class).quickSearchProfile(xq)) {
232
			final Document doc = reader.read(new StringReader(s));
233
			final String id = doc.valueOf("/service/id").trim();
234
			final String name = doc.valueOf("/service/name").trim();
235
			final String wsdl = doc.valueOf("/service/wsdl").trim();
236
			list.add(new ServiceDesc(id, name, wsdl));
237
		}
238

  
239
		final XPathFactory xpathFactory = XPathFactory.newInstance();
240

  
241
		for (ResourceStateSubscription sub : registry.listSubscriptions()) {
242
			boolean notFound = true;
243
			final DOMResult result = new DOMResult(); // NOPMD
244
			sub.getSubscriberAsEpr().writeTo(result);
245
			final String wsdl = xpathFactory.newXPath().evaluate("//*[local-name() = 'Address']", result.getNode()) + "?wsdl";
246

  
247
			for (ServiceDesc s : list) {
248
				if (s.getWsdl().equalsIgnoreCase(wsdl)) {
249
					s.getSubscriptions().add(new SubscriptionDesc(sub));
250
					notFound = false;
251
				}
252
			}
253
			if (notFound) {
254
				final ServiceDesc desc = new ServiceDesc("", "", wsdl);
255
				desc.getSubscriptions().add(new SubscriptionDesc(sub));
256
				desc.setStatus(ServiceStatus.MISSING);
257
				list.add(desc);
258
			}
259
		}
260

  
261
		final Map<String, ServiceGrouperDesc> map = Maps.newHashMap();
262
		for (ServiceDesc s : list) {
263
			final URL url = new URL(s.getWsdl());
264
			final String host = url.getHost();
265
			final int port = url.getPort();
266
			final String context = Iterables.getFirst(Splitter.on("/").omitEmptyStrings().split(url.getPath()), "");
267
			final String tmpKey = host + "@@@" + port + "@@@" + context;
268
			if (!map.containsKey(tmpKey)) {
269
				map.put(tmpKey, new ServiceGrouperDesc(host, port, context, new ArrayList<ServiceDesc>()));
270
			}
271
			map.get(tmpKey).getServices().add(s);
272
		}
273

  
274
		return map.values();
275
	}
276

  
277
	@RequestMapping("/ui/is/ping.do")
278
	public @ResponseBody
279
	long pingUrl(@RequestParam(value = "url", required = true) final String url, @RequestParam(value = "timeout", required = true) final int timeout)
280
			throws IOException {
281

  
282
		final long start = DateUtils.now();
283

  
284
		final HttpURLConnection urlConn = (HttpURLConnection) new URL(url).openConnection();
285
		urlConn.setConnectTimeout(timeout);
286
		urlConn.setReadTimeout(timeout);
287

  
288
		if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
289
			return DateUtils.now() - start;
290
		} else {
291
			throw new IllegalArgumentException("Invalid Url");
292
		}
293
	}
294

  
295
	public void sendXML(final ServletResponse response, final String xml) throws IOException {
296
		response.setContentType("text/xml");
297

  
298
		final ServletOutputStream out = response.getOutputStream();
299
		IOUtils.copy(new StringReader(xml), out);
300

  
301
		out.flush();
302
		out.close();
303
	}
304

  
305
}
modules/dnet-modular-is-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/is/objects/ServiceDesc.java
1
package eu.dnetlib.functionality.modular.ui.is.objects;
2

  
3
import java.util.ArrayList;
4
import java.util.List;
5

  
6
public class ServiceDesc {
7

  
8
	public enum ServiceStatus {
9
		UNKNOWN, ACTIVE, PENDING, NOT_RESPONDING, MISSING
10
	}
11

  
12
	private String id = "";
13
	private String name = "";
14
	private String wsdl = "";
15
	private ServiceStatus status = ServiceStatus.UNKNOWN;
16
	private List<SubscriptionDesc> subscriptions = new ArrayList<SubscriptionDesc>();
17

  
18
	public ServiceDesc() {}
19

  
20
	public ServiceDesc(final String id, final String name, final String wsdl) {
21
		this(id, name, wsdl, ServiceStatus.UNKNOWN, new ArrayList<SubscriptionDesc>());
22
	}
23

  
24
	public ServiceDesc(final String id, final String name, final String wsdl, final ServiceStatus status, final List<SubscriptionDesc> subscriptions) {
25
		this.id = id;
26
		this.name = name;
27
		this.wsdl = wsdl;
28
		this.status = status;
29
		this.subscriptions = subscriptions;
30
	}
31

  
32
	public String getId() {
33
		return id;
34
	}
35

  
36
	public void setId(final String id) {
37
		this.id = id;
38
	}
39

  
40
	public String getName() {
41
		return name;
42
	}
43

  
44
	public void setName(final String name) {
45
		this.name = name;
46
	}
47

  
48
	public String getWsdl() {
49
		return wsdl;
50
	}
51

  
52
	public void setWsdl(final String wsdl) {
53
		this.wsdl = wsdl;
54
	}
55

  
56
	public ServiceStatus getStatus() {
57
		return status;
58
	}
59

  
60
	public void setStatus(final ServiceStatus status) {
61
		this.status = status;
62
	}
63

  
64
	public List<SubscriptionDesc> getSubscriptions() {
65
		return subscriptions;
66
	}
67

  
68
	public void setSubscriptions(final List<SubscriptionDesc> subscriptions) {
69
		this.subscriptions = subscriptions;
70
	}
71

  
72
}
modules/dnet-modular-is-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/is/objects/ServiceGrouperDesc.java
1
package eu.dnetlib.functionality.modular.ui.is.objects;
2

  
3
import java.util.List;
4

  
5
public class ServiceGrouperDesc {
6

  
7
	private String host;
8
	private int port;
9
	private String context;
10
	private List<ServiceDesc> services;
11

  
12
	public ServiceGrouperDesc() {}
13

  
14
	public ServiceGrouperDesc(final String host, final int port, final String context, final List<ServiceDesc> services) {
15
		this.host = host;
16
		this.port = port;
17
		this.context = context;
18
		this.services = services;
19
	}
20

  
21
	public String getHost() {
22
		return host;
23
	}
24

  
25
	public void setHost(final String host) {
26
		this.host = host;
27
	}
28

  
29
	public int getPort() {
30
		return port;
31
	}
32

  
33
	public void setPort(final int port) {
34
		this.port = port;
35
	}
36

  
37
	public String getContext() {
38
		return context;
39
	}
40

  
41
	public void setContext(final String context) {
42
		this.context = context;
43
	}
44

  
45
	public List<ServiceDesc> getServices() {
46
		return services;
47
	}
48

  
49
	public void setServices(final List<ServiceDesc> services) {
50
		this.services = services;
51
	}
52
}
modules/dnet-modular-is-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/is/objects/SubscriptionDesc.java
1
package eu.dnetlib.functionality.modular.ui.is.objects;
2

  
3
import eu.dnetlib.enabling.is.sn.resourcestate.ResourceStateSubscription;
4

  
5
public class SubscriptionDesc {
6

  
7
	private String id;
8
	private String prefix;
9
	private String type;
10
	private String resourceId;
11
	private String xpath;
12

  
13
	public SubscriptionDesc() {}
14

  
15
	public SubscriptionDesc(final ResourceStateSubscription sub) {
16
		this(sub.getSubscriptionId(), sub.getPrefix(), sub.getType(), sub.getResourceId(), sub.getXpath());
17
	}
18

  
19
	public SubscriptionDesc(final String id, final String prefix, final String type, final String resourceId, final String xpath) {
20
		this.id = id;
21
		this.prefix = prefix;
22
		this.type = type;
23
		this.resourceId = resourceId;
24
		this.xpath = xpath;
25
	}
26

  
27
	public String getId() {
28
		return id;
29
	}
30

  
31
	public void setId(final String id) {
32
		this.id = id;
33
	}
34

  
35
	public String getPrefix() {
36
		return prefix;
37
	}
38

  
39
	public void setPrefix(final String prefix) {
40
		this.prefix = prefix;
41
	}
42

  
43
	public String getType() {
44
		return type;
45
	}
46

  
47
	public void setType(final String type) {
48
		this.type = type;
49
	}
50

  
51
	public String getResourceId() {
52
		return resourceId;
53
	}
54

  
55
	public void setResourceId(final String resourceId) {
56
		this.resourceId = resourceId;
57
	}
58

  
59
	public String getXpath() {
60
		return xpath;
61
	}
62

  
63
	public void setXpath(final String xpath) {
64
		this.xpath = xpath;
65
	}
66

  
67
}
modules/dnet-modular-is-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/is/objects/BlackboardMessage.java
1
package eu.dnetlib.functionality.modular.ui.is.objects;
2

  
3
public class BlackboardMessage {
4
	private String profId;
5
	private String messageId;
6
	private String resourceType; 
7
	private String action;
8
	private String date;
9
	private String actionStatus;
10
	private String error;
11
	
12
	public BlackboardMessage() {}
13
	
14
	public BlackboardMessage(String profId, String messageId, String resourceType,	String action, String date, String actionStatus, String error) {
15
		this.profId = profId;
16
		this.messageId = messageId;
17
		this.resourceType = resourceType;
18
		this.action = action;
19
		this.date = date;
20
		this.actionStatus = actionStatus;
21
		this.error = error;
22
	}
23

  
24
	public String getProfId() {
25
		return profId;
26
	}
27

  
28
	public void setProfId(String profId) {
29
		this.profId = profId;
30
	}
31

  
32
	public String getMessageId() {
33
		return messageId;
34
	}
35

  
36
	public void setMessageId(String messageId) {
37
		this.messageId = messageId;
38
	}
39

  
40
	public String getResourceType() {
41
		return resourceType;
42
	}
43

  
44
	public void setResourceType(String resourceType) {
45
		this.resourceType = resourceType;
46
	}
47

  
48
	public String getAction() {
49
		return action;
50
	}
51

  
52
	public void setAction(String action) {
53
		this.action = action;
54
	}
55

  
56
	public String getDate() {
57
		return date;
58
	}
59

  
60
	public void setDate(String date) {
61
		this.date = date;
62
	}
63

  
64
	public String getActionStatus() {
65
		return actionStatus;
66
	}
67

  
68
	public void setActionStatus(String actionStatus) {
69
		this.actionStatus = actionStatus;
70
	}
71

  
72
	public String getError() {
73
		return error;
74
	}
75

  
76
	public void setError(String error) {
77
		this.error = error;
78
	}
79
}
modules/dnet-modular-is-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/is/objects/CollectionDesc.java
1
package eu.dnetlib.functionality.modular.ui.is.objects;
2

  
3
import java.util.ArrayList;
4
import java.util.List;
5

  
6
import com.google.common.collect.Lists;
7

  
8
public class CollectionDesc implements Comparable<CollectionDesc> {
9
	private String kind;
10
	private int size = 0;
11
	private List<CollectionTypeDesc> types = Lists.newArrayList();
12
	
13
	public CollectionDesc() {}
14
	
15
	public CollectionDesc(String kind, List<CollectionTypeDesc> types, int size) {
16
		this.kind = kind;
17
		this.types = types;
18
		this.size = size;
19
	}
20
	
21
	public CollectionDesc(String kind) {
22
		this(kind, new ArrayList<CollectionTypeDesc>(), 0);
23
	}
24

  
25
	public String getKind() {
26
		return kind;
27
	}
28
	
29
	public void setKind(String kind) {
30
		this.kind = kind;
31
	}
32
	
33
	public List<CollectionTypeDesc> getTypes() {
34
		return types;
35
	}
36
	
37
	public void setTypes(List<CollectionTypeDesc> types) {
38
		this.types = types;
39
	}
40

  
41
	public void addType(String type, int n) {
42
		types.add(new CollectionTypeDesc(type, n));
43
		this.size += n;
44
	}
45
	
46
	public int getSize() {
47
		return size;
48
	}
49

  
50
	public void setSize(int size) {
51
		this.size = size;
52
	}
53

  
54
	@Override
55
	public int compareTo(CollectionDesc o) {
56
		return kind.compareTo(o.getKind());
57
	}
58

  
59
}
modules/dnet-modular-is-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/is/objects/CollectionTypeDesc.java
1
package eu.dnetlib.functionality.modular.ui.is.objects;
2

  
3
public class CollectionTypeDesc implements Comparable<CollectionTypeDesc> {
4
	private String name;
5
	private int size;
6
	
7
	public CollectionTypeDesc() {}
8
	
9
	public CollectionTypeDesc(String name, int size) {
10
		this.name = name;
11
		this.size = size;
12
	}
13
	
14
	public String getName() {
15
		return name;
16
	}
17
	
18
	public void setName(String name) {
19
		this.name = name;
20
	}
21
	
22
	public int getSize() {
23
		return size;
24
	}
25
	
26
	public void setSize(int size) {
27
		this.size = size;
28
	}
29

  
30
	@Override
31
	public int compareTo(CollectionTypeDesc o) {
32
		return name.compareTo(o.getName());
33
	}
34

  
35
}
modules/dnet-modular-is-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/is/bulk/ProfileImporter.java
1
package eu.dnetlib.functionality.modular.ui.is.bulk;
2

  
3
import java.io.IOException;
4
import java.net.URL;
5
import java.util.Map;
6

  
7
import org.apache.commons.io.FilenameUtils;
8
import org.apache.commons.io.IOUtils;
9
import org.apache.commons.logging.Log;
10
import org.apache.commons.logging.LogFactory;
11
import org.springframework.context.ResourceLoaderAware;
12
import org.springframework.core.io.Resource;
13
import org.springframework.core.io.ResourceLoader;
14
import org.springframework.core.io.support.ResourcePatternUtils;
15

  
16
import com.google.common.collect.Maps;
17

  
18
import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService;
19
import eu.dnetlib.enabling.is.store.rmi.ISStoreService;
20
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
21
import eu.dnetlib.enabling.tools.StreamOpaqueResource;
22

  
23
public class ProfileImporter implements ResourceLoaderAware {
24

  
25
	private ResourceLoader resourceLoader;
26

  
27
	private static final Log log = LogFactory.getLog(ProfileImporter.class);
28

  
29
	@javax.annotation.Resource
30
	private UniqueServiceLocator serviceLocator;
31

  
32
	public Map<String, Integer> importSchemas(final String path) throws IOException {
33

  
34
		int done = 0;
35
		int total = 0;
36

  
37
		for (Resource res : ResourcePatternUtils.getResourcePatternResolver(getResourceLoader()).getResources(path)) {
38
			total++;
39
			try {
40
				registerSchema(res.getURL());
41
				done++;
42
			} catch (Throwable e) {
43
				log.error("Error registering schema " + res.getURL(), e);
44
			}
45
		}
46

  
47
		final Map<String, Integer> res = Maps.newHashMap();
48
		res.put("schemasDone", done);
49
		res.put("schemasTotal", total);
50

  
51
		return res;
52
	}
53

  
54
	public Map<String, Integer> importProfiles(final String path) throws IOException {
55

  
56
		int done = 0;
57
		int total = 0;
58

  
59
		for (Resource res : ResourcePatternUtils.getResourcePatternResolver(getResourceLoader()).getResources(path)) {
60
			total++;
61
			try {
62
				registerProfile(res.getURL());
63
				done++;
64
			} catch (Throwable e) {
65
				log.error("Error registering profile " + res.getURL(), e);
66
			}
67
		}
68

  
69
		final Map<String, Integer> res = Maps.newHashMap();
70
		res.put("profilesDone", done);
71
		res.put("profilesTotal", total);
72

  
73
		return res;
74
	}
75

  
76
	private void registerSchema(final URL url) throws Exception {
77
		final String resourceType = FilenameUtils.getBaseName(url.getPath());
78

  
79
		log.info("registering schema: " + resourceType);
80

  
81
		serviceLocator.getService(ISRegistryService.class).addResourceType(resourceType, IOUtils.toString(url.openStream()));
82
	}
83

  
84
	private void registerProfile(final URL url) throws Exception {
85
		final StreamOpaqueResource resource = new StreamOpaqueResource(url.openStream());
86
		final String name = resource.getResourceId().split("_")[0];
87
		final String coll = "/db/DRIVER/" + resource.getResourceKind() + "/" + resource.getResourceType();
88

  
89
		log.info("saving profile: " + name + " in coll " + coll);
90

  
91
		serviceLocator.getService(ISStoreService.class).insertXML(name, coll, resource.asString());
92
	}
93

  
94
	public ResourceLoader getResourceLoader() {
95
		return resourceLoader;
96
	}
97

  
98
	@Override
99
	public void setResourceLoader(final ResourceLoader resourceLoader) {
100
		this.resourceLoader = resourceLoader;
101
	}
102

  
103
}
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/webContext-modular-ui-is.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns="http://www.springframework.org/schema/beans"
3
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
4
	xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:wsa="http://cxf.apache.org/ws/addressing"
5
	xmlns:p="http://www.springframework.org/schema/p" xmlns:http="http://cxf.apache.org/transports/http/configuration"
6
	xmlns:t="http://dnetlib.eu/springbeans/t" xmlns:template="http://dnetlib.eu/springbeans/template"
7
	xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context"
8
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
9
						http://cxf.apache.org/ws/addressing http://cxf.apache.org/schemas/ws-addr-conf.xsd
10
						http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
11
						http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
12
						http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
13
						http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd
14
						http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
15
						http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
16

  
17

  
18
	<bean name="/ui/isManager.do"
19
		class="eu.dnetlib.functionality.modular.ui.is.InformationServiceEntryPointController"
20
		p:menu="Information Service Inspector" 
21
		p:title="Information Service Inspector"
22
		p:description="Information Service Inspector"
23
		p:order="1" 
24
		p:group="Tools">
25
		<property name="permissionLevels">
26
			<set>
27
				<value>IS_ADMIN</value>
28
			</set>
29
		</property>
30
	</bean>
31

  
32
</beans>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/applicationContext-modular-ui-is.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns="http://www.springframework.org/schema/beans"
3
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
4
	xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:wsa="http://cxf.apache.org/ws/addressing"
5
	xmlns:p="http://www.springframework.org/schema/p" xmlns:http="http://cxf.apache.org/transports/http/configuration"
6
	xmlns:t="http://dnetlib.eu/springbeans/t" xmlns:template="http://dnetlib.eu/springbeans/template"
7
	xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context"
8
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
9
						http://cxf.apache.org/ws/addressing http://cxf.apache.org/schemas/ws-addr-conf.xsd
10
						http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
11
						http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
12
						http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
13
						http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd
14
						http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
15
						http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
16

  
17
	<bean id="modularUiProfileImporter" class="eu.dnetlib.functionality.modular.ui.is.bulk.ProfileImporter" />
18
						
19
</beans>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/isManager.st
1
$common/master( header={
2
	<script type="text/javascript" src="../resources/js/angular.min.js" ></script>
3
	<script type="text/javascript" src="../resources/js/angular-route.min.js"></script>
4
	<script type="text/javascript" src="../resources/js/angular-local-storage.min.js"></script>
5
	<script type="text/javascript" src="../resources/js/is_manager.js"></script>
6
	<script type="text/javascript" src="../resources/js/is_manager_controllers.js"></script>
7
}, body={
8
	<div ng-app="isManager" class="row">
9
		<div class="col-sm-3 col-lg-2" ng-controller="moduleMenuCtrl">
10
			<ul class="nav nav-pills nav-stacked">
11
				<li ng-class="{active : isActive('^\/(list|profile|profiles)')}"><a href="#/list">Profiles</a></li>
12
				<li ng-class="{active : isActive('^\/(schemas|schema)')}"><a href="#/schemas">Schemas</a></li>
13
				<li ng-class="{active : isActive('^\/q')}"><a href="#/q">XQuery</a></li>
14
				<li ng-class="{active : isActive('^\/services')}"><a href="#/services">Registered services</a></li>
15
				<li ng-class="{active : isActive('^\/register')}"><a href="#/register">Register new profile</a></li>
16
				<li ng-class="{active : isActive('^\/bulk')}"><a href="#/bulk">Bulk importer</a></li>
17
				<li ng-class="{active : isActive('^\/verify')}"><a href="#/verify">Validation checker</a></li>
18
				<li ng-class="{active : isActive('^\/blackboard')}"><a href="#/blackboard">Blackboard messages</a></li>
19
				<li ng-class="{active : isActive('^\/backup')}"><a href="#/backup">Backup</a></li>
20
			</ul>
21
		</div>
22
		<div ng-view class="col-sm-9 col-lg-10"></div>
23
	</div>
24
} )$
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/workflows/backup/backup-metawf.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<RESOURCE_PROFILE>
3
	<HEADER>
4
		<RESOURCE_IDENTIFIER
5
			value="f9c630f2-29f9-4196-a75f-1d208d7ef6dc_TWV0YVdvcmtmbG93RFNSZXNvdXJjZXMvTWV0YVdvcmtmbG93RFNSZXNvdXJjZVR5cGU=" />
6
		<RESOURCE_TYPE value="MetaWorkflowDSResourceType" />
7
		<RESOURCE_KIND value="MetaWorkflowDSResources" />
8
		<RESOURCE_URI value="" />
9
		<DATE_OF_CREATION value="2014-07-29T10:15:51.0Z" />
10
	</HEADER>
11
	<BODY>
12
		<METAWORKFLOW_NAME family="IS_BACKUP">Backup</METAWORKFLOW_NAME>
13
		<METAWORKFLOW_DESCRIPTION />
14
		<METAWORKFLOW_SECTION>Information Service</METAWORKFLOW_SECTION>
15
		<ADMIN_EMAIL />
16
		<CONFIGURATION status="EXECUTABLE">
17
			<WORKFLOW name="IS-Store Backup"
18
				id="8426b094-1f35-471e-8431-e75732dfa134_V29ya2Zsb3dEU1Jlc291cmNlcy9Xb3JrZmxvd0RTUmVzb3VyY2VUeXBl">
19
				<WORKFLOW name="IS-SN Backup"
20
					id="c245e501-a19d-4647-bd9f-68e5db522a5a_V29ya2Zsb3dEU1Jlc291cmNlcy9Xb3JrZmxvd0RTUmVzb3VyY2VUeXBl" />
21
			</WORKFLOW>
22
		</CONFIGURATION>
23
		<SCHEDULING enabled="false">
24
			<CRON>29 5 22 ? * *</CRON>
25
			<MININTERVAL>10080</MININTERVAL>
26
		</SCHEDULING>
27
	</BODY>
28
</RESOURCE_PROFILE>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/workflows/backup/backup-isstore.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<RESOURCE_PROFILE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3
	<HEADER>
4
		<RESOURCE_IDENTIFIER
5
			value="8426b094-1f35-471e-8431-e75732dfa134_V29ya2Zsb3dEU1Jlc291cmNlcy9Xb3JrZmxvd0RTUmVzb3VyY2VUeXBl" />
6
		<RESOURCE_TYPE value="WorkflowDSResourceType" />
7
		<RESOURCE_KIND value="WorkflowDSResources" />
8
		<RESOURCE_URI value="" />
9
		<DATE_OF_CREATION value="2014-07-29T10:15:51.0Z" />
10
	</HEADER>
11
	<BODY>
12
		<WORKFLOW_NAME>IS-Store Backup</WORKFLOW_NAME>
13
		<WORKFLOW_TYPE>IS_BACKUP</WORKFLOW_TYPE>
14
		<WORKFLOW_PRIORITY>20</WORKFLOW_PRIORITY>
15
		<CONFIGURATION start="auto">
16
			<NODE name="backup" isStart="true">
17
				<DESCRIPTION>Perform the backup of the IS-Store</DESCRIPTION>
18
				<PARAMETERS />
19
				<ARCS>
20
					<ARC to="success" />
21
				</ARCS>
22
			</NODE>
23
		</CONFIGURATION>
24
		<STATUS />
25
	</BODY>
26
</RESOURCE_PROFILE>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/workflows/backup/backup-issn.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<RESOURCE_PROFILE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3
	<HEADER>
4
		<RESOURCE_IDENTIFIER
5
			value="c245e501-a19d-4647-bd9f-68e5db522a5a_V29ya2Zsb3dEU1Jlc291cmNlcy9Xb3JrZmxvd0RTUmVzb3VyY2VUeXBl" />
6
		<RESOURCE_TYPE value="WorkflowDSResourceType" />
7
		<RESOURCE_KIND value="WorkflowDSResources" />
8
		<RESOURCE_URI value="" />
9
		<DATE_OF_CREATION value="2014-07-29T10:15:51.0Z" />
10
	</HEADER>
11
	<BODY>
12
		<WORKFLOW_NAME>IS-SN Backup</WORKFLOW_NAME>
13
		<WORKFLOW_TYPE>IS_BACKUP</WORKFLOW_TYPE>
14
		<WORKFLOW_PRIORITY>20</WORKFLOW_PRIORITY>
15
		<CONFIGURATION start="auto">
16
			<NODE name="backup" isStart="true">
17
				<DESCRIPTION>Perform the backup of the IS-SN</DESCRIPTION>
18
				<PARAMETERS />
19
				<ARCS>
20
					<ARC to="success" />
21
				</ARCS>
22
			</NODE>
23
		</CONFIGURATION>
24
		<STATUS />
25
	</BODY>
26
</RESOURCE_PROFILE>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/workflows/validation/validation.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<RESOURCE_PROFILE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3
	<HEADER>
4
		<RESOURCE_IDENTIFIER
5
			value="54898c83-8dcd-4cfb-b092-8ba6697f658b_V29ya2Zsb3dEU1Jlc291cmNlcy9Xb3JrZmxvd0RTUmVzb3VyY2VUeXBl" />
6
		<RESOURCE_TYPE value="WorkflowDSResourceType" />
7
		<RESOURCE_KIND value="WorkflowDSResources" />
8
		<RESOURCE_URI value="" />
9
		<DATE_OF_CREATION value="2014-07-29T10:15:51.0Z" />
10
	</HEADER>
11
	<BODY>
12
		<WORKFLOW_NAME>Revalidate profiles</WORKFLOW_NAME>
13
		<WORKFLOW_TYPE>IS_VALIDATION</WORKFLOW_TYPE>
14
		<WORKFLOW_PRIORITY>20</WORKFLOW_PRIORITY>
15
		<CONFIGURATION start="auto">
16
			<NODE name="Validate" type="ValidateProfiles" isStart="true">
17
				<DESCRIPTION>Perform the validation of the IS Profiles</DESCRIPTION>
18
				<PARAMETERS />
19
				<ARCS>
20
					<ARC to="success" />
21
				</ARCS>
22
			</NODE>
23
		</CONFIGURATION>
24
		<STATUS />
25
	</BODY>
26
</RESOURCE_PROFILE>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/workflows/validation/validation-metawf.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<RESOURCE_PROFILE>
3
	<HEADER>
4
		<RESOURCE_IDENTIFIER
5
			value="e5288425-c599-4194-80d1-62c51d526b34_TWV0YVdvcmtmbG93RFNSZXNvdXJjZXMvTWV0YVdvcmtmbG93RFNSZXNvdXJjZVR5cGU=" />
6
		<RESOURCE_TYPE value="MetaWorkflowDSResourceType" />
7
		<RESOURCE_KIND value="MetaWorkflowDSResources" />
8
		<RESOURCE_URI value="" />
9
		<DATE_OF_CREATION value="2014-07-29T10:15:51.0Z" />
10
	</HEADER>
11
	<BODY>
12
		<METAWORKFLOW_NAME family="IS_VALIDATION">Revalidate profiles</METAWORKFLOW_NAME>
13
		<METAWORKFLOW_DESCRIPTION />
14
		<METAWORKFLOW_SECTION>Information Service</METAWORKFLOW_SECTION>
15
		<ADMIN_EMAIL />
16
		<CONFIGURATION status="EXECUTABLE">
17
			<WORKFLOW name="Revalidate profiles"
18
				id="54898c83-8dcd-4cfb-b092-8ba6697f658b_V29ya2Zsb3dEU1Jlc291cmNlcy9Xb3JrZmxvd0RTUmVzb3VyY2VUeXBl" />
19
		</CONFIGURATION>
20
		<SCHEDULING enabled="false">
21
			<CRON>29 5 22 ? * *</CRON>
22
			<MININTERVAL>10080</MININTERVAL>
23
		</SCHEDULING>
24
	</BODY>
25
</RESOURCE_PROFILE>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/functionality/modular/xquery/listServices.xquery
1
for $x in collection("/db/DRIVER/ServiceResources/")/RESOURCE_PROFILE/HEADER
2
return
3
<service>
4
	<id>{$x/RESOURCE_IDENTIFIER/@value/string()}</id>
5
	<name>{replace($x/RESOURCE_TYPE/@value/string(),'ServiceResourceType$','')}</name>
6
	<wsdl>{$x/RESOURCE_URI/@value/string()}</wsdl>
7
</service>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/is/bulk.html
1
<div class="well">
2
	<fieldset>
3
		<legend><h4>Bulk Importer</h4></legend>
4
		<form role="form">
5
			<div class="form-group">
6
				<label for="bulkPathInput" class="control-label">BaseURL Directory:</label>
7
				<input type="text" class="form-control" id="bulkPathInput" ng-model="path" />
8
			</div>
9
			<div class="checkbox" style="margin-top: 20px">
10
				<label>
11
					<input type="checkbox" ng-model="profiles" /> <b>Import profiles:</b> <i>{{path}}/**/*.xml</i>
12
				</label>
13
			</div>
14
			<div class="checkbox" style="margin-top: 20px;">
15
				<label>
16
					<input type="checkbox" ng-model="schemas" /> <b>Import schemas:</b> <i>{{path}}/**/*.xsd</i>
17
				</label>
18
			</div>
19
			<div style="margin-top: 30px;">
20
				<b>Examples:</b>
21
				<pre>file:///tmp/dnet_import			
22
classpath*:/eu/dnetlib/test (use CAREFULLY to reload default profiles and schemas)</pre>
23
			</div>
24
			<button class="btn btn-default" ng-click="bulkImport()" style="margin-top: 30px;">Import</button>
25
		</form>
26
		
27
		<table class="table" ng-show="(response.schemasTotal != null) || (response.profilesTotal != null)">
28
			<thead>
29
				<tr>
30
					<th></th>
31
					<th class="text-center col-xs-3">Total</th>
32
					<th class="text-center col-xs-3">Added</th>
33
					<th class="text-center col-xs-3">Discarded</th>
34
				</tr>
35
			</thead>
36
			<tbody>
37
				<tr ng-show="response.schemasTotal != null">
38
					<th>Schemas</th>
39
					<td class="text-center col-xs-1">{{response.schemasTotal}}</td>
40
					<td class="text-center col-xs-1">{{response.schemasDone}}</td>
41
					<td class="text-center col-xs-1" ng-class="{'text-danger' : response.schemasDone < response.schemasTotal}">{{response.schemasTotal - response.schemasDone}}</td>
42
				</tr>
43
				<tr ng-show="response.profilesTotal != null">
44
					<th>Profiles</th>
45
					<td class="text-center col-xs-1">{{response.profilesTotal}}</td>
46
					<td class="text-center col-xs-1">{{response.profilesDone}}</td>
47
					<td class="text-center col-xs-1" ng-class="{'text-danger' : response.profilesDone < response.profilesTotal}">{{response.profilesTotal - response.profilesDone}}</td>
48
				</tr>
49
			</tbody>		
50
		</table>			
51
		
52
		
53
	</fieldset>
54
</div>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/is/profile.html
1
<div class="row">
2
	<div class="col-xs-12 col-md-10">
3
		<h5><b>Profile</b>  (ID: <i>{{id}}</i>)</h5>		
4
	</div>
5
	<div class="col-xs-12 col-md-2">
6
		<div class="pull-right" ng-show="profile && !editProfile">
7
			<button class="btn btn-sm btn-danger" ng-click="deleteProfile()">Delete</button>
8
			<button class="btn btn-sm btn-default" ng-click="startEditing()">Edit</button>
9
		</div>
10
		<div class="pull-right" ng-show="editProfile">
11
			<button class="btn btn-sm btn-warning" ng-click="abortEditing()">Abort</button>
12
			<button class="btn btn-sm btn-default" ng-click="saveEditing()">Save</button>
13
		</div>
14
	</div>
15
</div>
16
<pre ng-show="profile && !editProfile">{{profile}}</pre>
17
<textarea class="form-control" ng-show="editProfile" ng-model="editProfile" rows="400"></textarea>
18
<pre ng-hide="profile">The requested profile is missing</pre>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/is/schema.html
1
<div class="row">
2
	<div class="col-xs-9"><h4><b>Schema:</b> <i>{{name}}</i></h4></div>
3
	<div class="col-xs-3">
4
		<!-- <button class="btn btn-sm btn-default pull-right">edit</button> -->	
5
	</div>
6
</div>
7

  
8
<pre>{{schema}}</pre>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/is/isQuery.html
1
<form role="form">
2
	<div class="form-group">
3
		<label for="xqueryInput" class="control-label">XQuery</label>
4
		<textarea class="form-control" id="xqueryInput" ng-model="query" rows="10"></textarea>
5
	</div>
6
	<button class="btn btn-default" ng-click="searchXQuery()">Search</button>
7
	<button class="btn btn-primary pull-right" data-toggle="modal" data-target="#xqueryHistoryModal">History</button>
8
</form>
9
<br />
10

  
11
<div class="panel panel-default" ng-show="error">
12
	<div class="panel-heading">
13
		<a class="accordion-toggle" data-toggle="collapse" data-target="#collapse_error"><b>Error:</b> <i>{{error.message}}</i></a>
14
	</div>
15
	<div id="collapse_error" class="panel-collapse collapse in">
16
		<div class="panel-body">
17
			<pre>{{error.stacktrace}}</pre>
18
		</div>			
19
	</div>
20
</div>
21

  
22

  
23
<p ng-hide="error"><b>Number of results:</b> {{results.length}}<br /></p>
24

  
25
<div class="panel panel-default" ng-repeat="r in results track by $index">
26
	<div class="panel-heading">
27
		<a class="accordion-toggle" data-toggle="collapse" data-target="#collapse_{{$index}}"><b> Result: </b><i>{{$index + 1}}</i></a>
28
	</div>
29
	<div id="collapse_{{$index}}" class="panel-collapse collapse in">
30
		<div class="panel-body">
31
			<pre>{{r}}</pre>
32
		</div>
33
	</div>
34
</div>
35

  
36

  
37
<div id="xqueryHistoryModal" class="modal fade" tabindex="-1" role="dialog">
38
	<div class="modal-dialog modal-lg">
39
		<div class="modal-content">
40
			<div class="modal-header">
41
				<button type="button" class="close" data-dismiss="modal">&times;</button>
42
				<h4 class="modal-title">History</h4>
43
			</div>
44
			<div class="modal-body" style="height: 400px; overflow-y: scroll">
45
				<p class="text-center" ng-show="history.length == 0">
46
					<b>History is empty</b>
47
				</p>
48
				<div ng-repeat="e in history | reverse">
49
					<span><a href="javascript:void(0)" data-dismiss="modal" ng-click="updateXQuery(e.query)">{{e.date | date:"yyyy-MM-dd HH:mm:ss"}}</a></span>
50
					<pre>{{e.query}}</pre>
51
				</div>
52
			</div>
53
			<div class="modal-footer">
54
				<button class="btn btn-primary" data-dismiss="modal">Clear history</button>
55
				<button class="btn btn-default" data-dismiss="modal">Close</button>
56
			</div>
57
		</div>
58
	</div>
59
</div>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/is/profiles.html
1
<div class="well">
2
	<p>
3
		<b>path:</b> <i>{{path}}</i><br />
4
		<b>size: </b><i>{{profiles.length}}</i>
5
	</p>
6
	<fieldset>
7
		<legend>
8
			<h4>Profiles</h4>
9
		</legend>
10
		<ol>
11
			<li ng-repeat="id in profiles"><a href="#/profile/{{id}}">{{id}}</a></li>
12
		</ol>
13
	</fieldset>
14
</div>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/is/schemas.html
1
<div class="well">
2
	<fieldset>
3
		<legend>
4
			<h4>Registered schemas:</h4>
5
		</legend>
6
		<ol>
7
			<li ng-repeat="s in schemas"><a href="#/schema/{{s}}">{{s}}</a></li>
8
		</ol>
9
	</fieldset>
10
</div>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/is/services.html
1
<table class="table table-striped small">
2
	<thead>
3
		<tr>
4
			<th>#</th>
5
			<th>Service</th>
6
			<th>WSDL</th>
7
			<th class="text-center">Status <button type="button" class="btn btn-xs btn-primary" ng-click="pingServices()">verify</button></th>
8
			<th class="text-right">Subscriptions</th>
9
		</tr>
10
	</thead>
11
	<tbody ng-repeat="group in groups">
12
		<tr>
13
			<th colspan="5">
14
				Host: <i>{{group.host}}</i> - Port: <i>{{group.port}}</i> - Context: <i>{{group.context}}</i> 
15
			</th>
16
		</tr>
17
		<tr ng-show="group.services.length == 0">
18
			<td colspan="6">No services</td>
19
		</tr>
20
		<tr ng-repeat="s in group.services">
21
			<td>{{$index + 1}}</td>
22
			<td>
23
				<a href="#/profile/{{s.id}}" title="{{s.id}}" ng-show="s.id">{{s.name}}</a>
24
				<span ng-hide="s.id" class="text-muted"><i>missing profile</i></span>
25
			</td>
26
			<td><a href="{{s.wsdl}}">{{s.wsdl}}</a></td>
27
			<td class="text-center">
28
				<span class="label" ng-class="{'label-success' : s.status == 'ACTIVE', 'label-danger' : s.status == 'NOT_RESPONDING' || s.status == 'MISSING', 'label-default' : s.status == 'UNKNOWN', 'label-warning' : s.status == 'PENDING'}">{{s.status}}</span>
29
			</td>
30
			<td class="text-right">
31
				<a href="javascript:void(0)" 
32
					ng-show="s.subscriptions.length > 0" 
33
					data-toggle="modal" data-target="#subscriptionsModal"
34
					ng-click="setSubscriptions(s.subscriptions)">{{s.subscriptions.length}} subscription(s)</a>
35
			</td>
36
		</tr>
37
	</tbody>
38
</table>
39

  
40
<div id="subscriptionsModal" class="modal fade" tabindex="-1" role="dialog">
41
	<div class="modal-dialog modal-lg">
42
		<div class="modal-content">
43
			<div class="modal-header">
44
				<button type="button" class="close" data-dismiss="modal">&times;</button>
45
				<h4 class="modal-title">Subscriptions</h4>
46
			</div>
47
			<div class="modal-body">
48
			
49
				<div class="panel panel-info" ng-repeat="s in subscriptions">
50
					<div class="panel-heading">{{s.id}}</div>
51
					<table class="table table-condensed small">
52
						<tr>
53
							<th>Prefix</th>
54
							<td>{{s.prefix}}</td>
55
						</tr>
56
						<tr>
57
							<th>Resource type</th>
58
							<td>{{s.type}}</td>
59
						</tr>
60
						<tr>
61
							<th>Resource ID</th>
62
							<td>{{s.resourceId}}</td>
63
						</tr>
64
						<tr>
65
							<th>Xpath</th>
66
							<td>{{s.xpath}}</td>
67
						</tr>
68
					</table>
69
				</div>
70
			</div>                                
71
			<div class="modal-footer">
72
				<button class="btn btn-default" data-dismiss="modal">Close</button>
73
			</div>
74
		</div>
75
	</div>
76
</div>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/is/blackboard.html
1
<p>
2
	<button class="btn btn-sm btn-default" ng-click="refresh()"><span class="glyphicon glyphicon-refresh"></span> refresh</button>
3
</p>
4
<table class="table table-striped small">
5
	<thead>
6
		<tr>
7
			<th>Message Id</th>
8
			<th>Resource Type</th>
9
			<th class="text-center">Action</th>
10
			<th class="text-center">Date</th>
11
			<th class="text-center">Status</th>
12
			<th class="text-center">Error</th>
13
		</tr>
14
	</thead>
15
	<tbody>
16
		<tr ng-show="blackboards.length == 0">
17
			<td colspan="6">No blackboard messsages</td>
18
		</tr>
19
		<tr ng-repeat="b in blackboards">
20
			<td><a href="#/profile/{{b.profId}}">{{b.messageId}}</a></td>
21
			<td>{{b.resourceType}}</td>
22
			<td class="text-center">{{b.action}}</td>
23
			<td class="text-center">{{b.date}}</td>
24
			<td class="text-center"><span class="label label-default" ng-class="{'label-primary': b.actionStatus=='ASSIGNED', 'label-success': b.actionStatus=='ONGOING', 'label-success': b.actionStatus=='DONE', 'label-danger': b.actionStatus=='FAILED'}">{{b.actionStatus}}</span></td>
25
			<td class="text-center"><span class="text-danger glyphicon glyphicon-warning-sign" title="{{b.error}}" ng-show="b.error"></span></td>	
26
		</tr>
27
	</tbody>
28
</table>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/is/register.html
1
<form role="form">
2
	<div class="form-group">
3
		<label for="newProfileInput" class="control-label">New Profile</label>
4
		<textarea class="form-control" id="newProfileInput" ng-model="profile" rows="10"></textarea>
5
	</div>
6
	<button class="btn btn-default" ng-click="register()">Register</button>
7
</form>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/is/verify.html
1
<div class="well">
2
	<div class="row" style="margin: 40px">
3
		<button class="btn btn-lg btn-primary col-xs-4 col-xs-offset-4" ng-click="registerValidationWfs()">
4
			<span class="glyphicon glyphicon-import pull-left"></span>Register validation workflows
5
		</button>
6
	</div>
7
	<div class="row" style="margin: 40px">
8
		<a class="btn btn-lg btn-default col-xs-4 col-xs-offset-4" ng-disabled="!metaWfId" href="workflows.do?section={{section | encodeURIComponent}}&metaWf={{metaWfId | encodeURIComponent}}"><span class="glyphicon glyphicon-log-in pull-left"></span>Go to workflow page</a>
9
	</div>
10
	<div class="row" style="margin: 40px">
11
		<a class="btn btn-lg btn-default col-xs-4 col-xs-offset-4" ng-disabled="!family" href="workflow_journal.do?family={{family}}"><span class="glyphicon glyphicon-list pull-left"></span>Show history</a>
12
	</div>
13
</div>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/is/backup.html
1
<div class="well">
2
	<div class="row" style="margin: 40px">
3
		<button class="btn btn-lg btn-primary col-xs-4 col-xs-offset-4" ng-click="registerBackupWfs()">
4
			<span class="glyphicon glyphicon-import pull-left"></span>Register backup workflows
5
		</button>
6
	</div>
7
	<div class="row" style="margin: 40px">
8
		<a class="btn btn-lg btn-default col-xs-4 col-xs-offset-4" ng-disabled="!metaWfId" href="workflows.do?section={{section | encodeURIComponent}}&metaWf={{metaWfId | encodeURIComponent}}">
9
			<span class="glyphicon glyphicon-log-in pull-left"></span>Go to workflow page</a>
10
	</div>
11
	<div class="row" style="margin: 40px">
12
		<a class="btn btn-lg btn-default col-xs-4 col-xs-offset-4" ng-disabled="!family" href="workflow_journal.do?family={{family}}">
13
			<span class="glyphicon glyphicon-list pull-left"></span>Show history</a>
14
	</div>
15
</div>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/is/list.html
1
<div class="well">
2
	<fieldset>
3
		<legend>
4
			<h4>List collections</h4>
5
		</legend>
6
		
7
		<ul>
8
			<li ng-repeat="r in results" ng-show="r.size > 0">{{r.kind}}
9
				<ul>
10
					<li ng-repeat="t in r.types" ng-show="t.size > 0">{{t.name}}
11
						<a href="#/profiles/{{r.kind}}/{{t.name}}">{{t.size}} profiles(s)</a>
12
					</li>
13
				</ul>		
14
			</li>
15
		</ul>
16
	</fieldset>
17
</div>
modules/dnet-modular-is-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/is_manager.js
1
var module = angular.module('isManager', ['ngRoute', 'isManagerControllers']);
2

  
3
module.config([
4
	'$routeProvider',
5
	function($routeProvider) {
6
		$routeProvider
7
			.when('/list',                 { templateUrl: '../resources/html/is/list.html',          controller: 'listCollectionsCtrl' })
8
			.when('/profiles/:kind/:type', { templateUrl: '../resources/html/is/profiles.html',      controller: 'profilesCtrl' })
9
			.when('/profile/:id',          { templateUrl: '../resources/html/is/profile.html',       controller: 'profileCtrl' })
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff