comparison artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java @ 275:e92d5944fe4b

Enabled the artifact database to retrieve requests to change the name of a specific collection. artifacts/trunk@2074 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 08 Jun 2011 07:36:43 +0000
parents 22a90706d32d
children d15f09d5b89d
comparison
equal deleted inserted replaced
274:92166f7c3842 275:e92d5944fe4b
1542 root.setTextContent(success ? OPERATION_SUCCESSFUL: OPERATION_FAILURE); 1542 root.setTextContent(success ? OPERATION_SUCCESSFUL: OPERATION_FAILURE);
1543 1543
1544 return result; 1544 return result;
1545 } 1545 }
1546 1546
1547
1548 public Document setCollectionName(String uuid, Document doc, CallMeta meta)
1549 throws ArtifactDatabaseException
1550 {
1551 Document result = XMLUtils.newDocument();
1552 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator(
1553 result,
1554 ArtifactNamespaceContext.NAMESPACE_URI,
1555 ArtifactNamespaceContext.NAMESPACE_PREFIX);
1556
1557 Element root = ec.create("result");
1558 result.appendChild(root);
1559
1560 String name = XMLUtils.xpathString(
1561 doc, XPATH_COLLECTION_NAME, ArtifactNamespaceContext.INSTANCE);
1562
1563 logger.info("Set name of collection '" + uuid + "' to: " + name);
1564
1565 if (name == null || name.length() == 0) {
1566 logger.warn("The new name is emtpy. No new name set!");
1567 root.setTextContent(OPERATION_FAILURE);
1568 return result;
1569 }
1570
1571 boolean success = backend.setCollectionName(uuid, name);
1572 root.setTextContent(success ? OPERATION_SUCCESSFUL: OPERATION_FAILURE);
1573
1574 return result;
1575 }
1576
1577
1547 public DeferredOutput outCollection( 1578 public DeferredOutput outCollection(
1548 String collectionId, 1579 String collectionId,
1549 Document format, 1580 Document format,
1550 CallMeta callMeta) 1581 CallMeta callMeta)
1551 throws ArtifactDatabaseException 1582 throws ArtifactDatabaseException

http://dive4elements.wald.intevation.org