Project

General

Profile

« Previous | Next » 

Revision 8585

Couple modifications:
-use "pid" throughout so as not to confuse docids and pids
-ensure any failures in the set do not prevent synching for other pids in the set

View differences:

ReplicationService.java
424 424
				SyncAccessPolicy syncAP = new SyncAccessPolicy();
425 425
				response.setContentType("text/html");
426 426
				out = response.getWriter();
427
				if (params.containsKey("docids")) {
428
					String docIds = ((String[]) params.get("docids"))[0];
429
					logMetacat.debug("Attempting to sync access policies for docids: " + docIds);
430
					ArrayList<String> ids = new ArrayList<String>(
431
							Arrays.asList(docIds.split("\\s*,\\s*")));
427
				if (params.containsKey("pid")) {
428
					String[] pids = params.get("pid");
429
					logMetacat.debug("Attempting to sync access policies for pids: " + pids);
430
					ArrayList<String> pidsToSync = new ArrayList<String>(Arrays.asList(pids));
432 431
					try {
433
						List<Identifier> syncedIds = syncAP.sync(ids);
434
						out.write("<html><body>Syncing access policies has completed.</body></html>");
432
						List<Identifier> syncedPids = syncAP.sync(pidsToSync);
433
						out.write("<html><body>Syncing access policies has completed for " + syncedPids.size() + " pids.</body></html>");
435 434
					} catch (Exception e) {
436 435
						logMetacat.error("Error syncing all access polies: "
437 436
								+ e.getMessage());

Also available in: Unified diff