Left: | ||
Right: |
OLD | NEW |
---|---|
1 // Copyright 2014 Google Inc. All Rights Reserved. | 1 // Copyright 2014 Google Inc. All Rights Reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
623 ArrayList<DocId> docIds = new ArrayList<DocId>(); | 623 ArrayList<DocId> docIds = new ArrayList<DocId>(); |
624 for (String startPath : validatedStartPaths) { | 624 for (String startPath : validatedStartPaths) { |
625 if (startPath.equals("/")) { | 625 if (startPath.equals("/")) { |
626 docIds.addAll(listRootCabinets(dmSession)); | 626 docIds.addAll(listRootCabinets(dmSession)); |
627 } else { | 627 } else { |
628 IDfSysObject obj = | 628 IDfSysObject obj = |
629 (IDfSysObject) dmSession.getObjectByPath(startPath); | 629 (IDfSysObject) dmSession.getObjectByPath(startPath); |
630 docIds.add(docIdFromPath( | 630 docIds.add(docIdFromPath( |
631 startPath.substring(0, startPath.lastIndexOf("/")), | 631 startPath.substring(0, startPath.lastIndexOf("/")), |
632 obj.getObjectName(), | 632 obj.getObjectName(), |
633 obj.getObjectId().toString())); | 633 obj.getChronicleId().toString())); |
634 } | 634 } |
635 } | 635 } |
636 logger.log(Level.FINER, "DocumentumAdaptor DocIds: {0}", docIds); | 636 logger.log(Level.FINER, "DocumentumAdaptor DocIds: {0}", docIds); |
637 pusher.pushDocIds(docIds); | 637 pusher.pushDocIds(docIds); |
638 } catch (DfException e) { | 638 } catch (DfException e) { |
639 savedExceptions.add(e); | 639 savedExceptions.add(e); |
640 } finally { | 640 } finally { |
641 dmSessionManager.release(dmSession); | 641 dmSessionManager.release(dmSession); |
642 } | 642 } |
643 | 643 |
(...skipping 16 matching lines...) Expand all Loading... | |
660 logger.exiting("DocumentumAdaptor", "getDocIds"); | 660 logger.exiting("DocumentumAdaptor", "getDocIds"); |
661 } | 661 } |
662 | 662 |
663 /** Returns a list of paths for all the docbase's cabinets. */ | 663 /** Returns a list of paths for all the docbase's cabinets. */ |
664 private List<DocId> listRootCabinets(IDfSession session) throws DfException { | 664 private List<DocId> listRootCabinets(IDfSession session) throws DfException { |
665 ImmutableList.Builder<DocId> cabinets = ImmutableList.builder(); | 665 ImmutableList.Builder<DocId> cabinets = ImmutableList.builder(); |
666 | 666 |
667 // Select r_object_id to allow an object- or row-based query. See | 667 // Select r_object_id to allow an object- or row-based query. See |
668 // "To return results by object ID" in the DQL Reference Manual. | 668 // "To return results by object ID" in the DQL Reference Manual. |
669 String queryStr = MessageFormat.format( | 669 String queryStr = MessageFormat.format( |
670 "SELECT r_object_id, r_folder_path FROM dm_cabinet" | 670 "SELECT i_chronicle_id, r_folder_path FROM dm_cabinet" |
671 + "{0,choice,0#|0< WHERE {1}}", | 671 + "{0,choice,0#|0< WHERE {1}}", |
672 cabinetWhereCondition.length(), cabinetWhereCondition); | 672 cabinetWhereCondition.length(), cabinetWhereCondition); |
673 // Don't use MessageFormat syntax for this log message for testing purposes. | 673 // Don't use MessageFormat syntax for this log message for testing purposes. |
674 logger.log(Level.FINER, "Get All Cabinets Query: " + queryStr); | 674 logger.log(Level.FINER, "Get All Cabinets Query: " + queryStr); |
675 IDfQuery query = dmClientX.getQuery(); | 675 IDfQuery query = dmClientX.getQuery(); |
676 query.setDQL(queryStr); | 676 query.setDQL(queryStr); |
677 IDfCollection result = query.execute(session, IDfQuery.DF_EXECREAD_QUERY); | 677 IDfCollection result = query.execute(session, IDfQuery.DF_EXECREAD_QUERY); |
678 try { | 678 try { |
679 while (result.next()) { | 679 while (result.next()) { |
680 String objectId = result.getString("r_object_id"); | 680 String chronicleId = result.getString("i_chronicle_id"); |
681 for (int j = 0; j < result.getValueCount("r_folder_path"); j++) { | 681 for (int j = 0; j < result.getValueCount("r_folder_path"); j++) { |
682 String cabinet = result.getRepeatingString("r_folder_path", j); | 682 String cabinet = result.getRepeatingString("r_folder_path", j); |
683 logger.log(Level.FINER, "Cabinet: {0}", cabinet); | 683 logger.log(Level.FINER, "Cabinet: {0}", cabinet); |
684 cabinets.add(docIdFromPath(cabinet, objectId)); | 684 cabinets.add(docIdFromPath(cabinet, chronicleId)); |
685 } | 685 } |
686 } | 686 } |
687 } finally { | 687 } finally { |
688 result.close(); | 688 result.close(); |
689 } | 689 } |
690 | 690 |
691 return cabinets.build(); | 691 return cabinets.build(); |
692 } | 692 } |
693 | 693 |
694 @VisibleForTesting | 694 @VisibleForTesting |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1173 logger.log(Level.FINER, "Modified DocIds Query: {0}", queryStr); | 1173 logger.log(Level.FINER, "Modified DocIds Query: {0}", queryStr); |
1174 IDfQuery query = dmClientX.getQuery(); | 1174 IDfQuery query = dmClientX.getQuery(); |
1175 query.setDQL(queryStr); | 1175 query.setDQL(queryStr); |
1176 IDfCollection result = query.execute(session, IDfQuery.DF_EXECREAD_QUERY); | 1176 IDfCollection result = query.execute(session, IDfQuery.DF_EXECREAD_QUERY); |
1177 try { | 1177 try { |
1178 String lastModified = docsCheckpoint.getLastModified(); | 1178 String lastModified = docsCheckpoint.getLastModified(); |
1179 String objectId = docsCheckpoint.getObjectId(); | 1179 String objectId = docsCheckpoint.getObjectId(); |
1180 while (result.next()) { | 1180 while (result.next()) { |
1181 lastModified = result.getString("r_modify_date_str"); | 1181 lastModified = result.getString("r_modify_date_str"); |
1182 objectId = result.getString("r_object_id"); | 1182 objectId = result.getString("r_object_id"); |
1183 String chronicleId = result.getString("i_chronicle_id"); | |
1183 String name = result.getString("object_name"); | 1184 String name = result.getString("object_name"); |
1184 addUpdatedDocIds(builder, session, objectId, name); | 1185 addUpdatedDocIds(builder, session, chronicleId, name); |
1185 docsCheckpoint = new Checkpoint(lastModified, objectId); | 1186 docsCheckpoint = new Checkpoint(lastModified, objectId); |
1186 } | 1187 } |
1187 } finally { | 1188 } finally { |
1188 result.close(); | 1189 result.close(); |
1189 } | 1190 } |
1190 return true; | 1191 return true; |
1191 } | 1192 } |
1192 } | 1193 } |
1193 | 1194 |
1194 @VisibleForTesting | 1195 @VisibleForTesting |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1247 logger.log(Level.FINEST, | 1248 logger.log(Level.FINEST, |
1248 "Skipping already processed event {0} for chronicle ID {1}", | 1249 "Skipping already processed event {0} for chronicle ID {1}", |
1249 new String[] {eventId, chronicleId}); | 1250 new String[] {eventId, chronicleId}); |
1250 } else { | 1251 } else { |
1251 logger.log(Level.FINER, "Processing permission changes " | 1252 logger.log(Level.FINER, "Processing permission changes " |
1252 + "time_stamp_utc: {0}, " | 1253 + "time_stamp_utc: {0}, " |
1253 + "r_object_id: {1}, " | 1254 + "r_object_id: {1}, " |
1254 + "audited_obj_id: {2}, " | 1255 + "audited_obj_id: {2}, " |
1255 + "chronicle_id: {3}", | 1256 + "chronicle_id: {3}", |
1256 new String[] {eventDate, eventId, objectId, chronicleId}); | 1257 new String[] {eventDate, eventId, objectId, chronicleId}); |
1257 addUpdatedDocIds(builder, session, objectId, objectName); | 1258 addUpdatedDocIds(builder, session, chronicleId, objectName); |
1258 chronicleIds.add(chronicleId); | 1259 chronicleIds.add(chronicleId); |
1259 } | 1260 } |
1260 permissionsCheckpoint = new Checkpoint(eventDate, eventId); | 1261 permissionsCheckpoint = new Checkpoint(eventDate, eventId); |
1261 } | 1262 } |
1262 } finally { | 1263 } finally { |
1263 result.close(); | 1264 result.close(); |
1264 } | 1265 } |
1265 return true; | 1266 return true; |
1266 } | 1267 } |
1267 } | 1268 } |
1268 | 1269 |
1269 /** | 1270 /** |
1270 * A document can reside under multiple folder paths. | 1271 * A document can reside under multiple folder paths. |
1271 * Only push those paths that are under our start paths. | 1272 * Only push those paths that are under our start paths. |
1272 * | 1273 * |
1273 * @param builder builder for list of DocIds | 1274 * @param builder builder for list of DocIds |
1274 * @param objectId the ID of a Documentum object | 1275 * @param objectId the ID of a Documentum object |
JohnL
2017/02/15 01:36:08
Change this tag and the parameter name?
Srinivas
2017/02/17 00:59:12
Done.
| |
1275 * @param name the document name to append to the folder | 1276 * @param name the document name to append to the folder |
1276 * paths for a document, or null for a folder | 1277 * paths for a document, or null for a folder |
1277 */ | 1278 */ |
1278 private void addUpdatedDocIds(ImmutableList.Builder<Record> builder, | 1279 private void addUpdatedDocIds(ImmutableList.Builder<Record> builder, |
1279 IDfSession session, String objectId, String name) throws DfException { | 1280 IDfSession session, String objectId, String name) throws DfException { |
1280 IDfEnumeration enumPaths = session.getObjectPaths(new DfId(objectId)); | 1281 IDfEnumeration enumPaths = session.getObjectPaths(new DfId(objectId)); |
1281 while (enumPaths.hasMoreElements()) { | 1282 while (enumPaths.hasMoreElements()) { |
1282 IDfObjectPath objPath = (IDfObjectPath) enumPaths.nextElement(); | 1283 IDfObjectPath objPath = (IDfObjectPath) enumPaths.nextElement(); |
1283 String path = objPath.getFullPath(); | 1284 String path = objPath.getFullPath(); |
1284 DocId docId = docIdFromPath(path, name, objectId); | 1285 DocId docId = docIdFromPath(path, name, objectId); |
1285 if (isUnderStartPath(docId, validatedStartPaths)) { | 1286 if (isUnderStartPath(docId, validatedStartPaths)) { |
1286 builder.add(new Record.Builder(docId) | 1287 builder.add(new Record.Builder(docId) |
1287 .setCrawlImmediately(true).build()); | 1288 .setCrawlImmediately(true).build()); |
1288 } | 1289 } |
1289 } | 1290 } |
1290 } | 1291 } |
1291 | 1292 |
1292 private String makeUpdatedDocsQuery(Checkpoint checkpoint) { | 1293 private String makeUpdatedDocsQuery(Checkpoint checkpoint) { |
1293 StringBuilder query = new StringBuilder(); | 1294 StringBuilder query = new StringBuilder(); |
1294 query.append("SELECT object_name, r_object_id, r_object_type, ") | 1295 query.append("SELECT object_name, r_object_id, i_chronicle_id, ") |
1295 .append("i_folder_id, r_modify_date, ") | 1296 .append("r_object_type, i_folder_id, r_modify_date, ") |
1296 .append(dateToStringFunction) | 1297 .append(dateToStringFunction) |
1297 .append("(r_modify_date, 'yyyy-mm-dd hh:mi:ss') ") | 1298 .append("(r_modify_date, 'yyyy-mm-dd hh:mi:ss') ") |
1298 .append("AS r_modify_date_str FROM dm_sysobject ") | 1299 .append("AS r_modify_date_str FROM dm_sysobject ") |
1299 // Limit the returned object types to types specified in | 1300 // Limit the returned object types to types specified in |
1300 // documentum.documentTypes config property or dm_folder. | 1301 // documentum.documentTypes config property or dm_folder. |
1301 .append("WHERE ("); | 1302 .append("WHERE ("); |
1302 for (String typeName : validatedDocumentTypes) { | 1303 for (String typeName : validatedDocumentTypes) { |
1303 query.append("TYPE(").append(typeName).append(") OR "); | 1304 query.append("TYPE(").append(typeName).append(") OR "); |
1304 } | 1305 } |
1305 query.append("TYPE(dm_folder)) AND ") | 1306 query.append("TYPE(dm_folder)) AND ") |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1424 String path = docIdToRawPath(id); | 1425 String path = docIdToRawPath(id); |
1425 // Special root path "/" means return all cabinets. | 1426 // Special root path "/" means return all cabinets. |
1426 if (path.equals("/")) { | 1427 if (path.equals("/")) { |
1427 getRootContent(resp, id, listRootCabinets(dmSession)); | 1428 getRootContent(resp, id, listRootCabinets(dmSession)); |
1428 return; | 1429 return; |
1429 } | 1430 } |
1430 | 1431 |
1431 IDfPersistentObject dmPersObj; | 1432 IDfPersistentObject dmPersObj; |
1432 if (path.matches(".*:\\p{XDigit}{16}")) { | 1433 if (path.matches(".*:\\p{XDigit}{16}")) { |
1433 String objId = path.substring(path.length() - 16); | 1434 String objId = path.substring(path.length() - 16); |
1434 logger.log(Level.FINER, "Object Id: {0}", objId); | 1435 logger.log(Level.FINER, "Chronicle Id: {0}", objId); |
JohnL
2017/02/15 01:36:08
s/Id/ID/ since you're changing this line.
Srinivas
2017/02/17 00:59:12
Done.
| |
1435 try { | 1436 try { |
1436 dmPersObj = dmSession.getObject(new DfId(objId)); | 1437 dmPersObj = getObjectByChronicleId(dmSession, objId); |
1437 } catch (DfIdNotFoundException e) { | 1438 } catch (DfIdNotFoundException e) { |
JohnL
2017/02/15 01:36:08
This needs to be reworked. getObjectByQualificatio
Srinivas
2017/02/17 00:59:12
Done.
Srinivas
2017/02/17 00:59:12
Removed the try, catch block. In the other CL we a
| |
1438 // Check for a false positive regex match. | 1439 // Check for a false positive regex match. |
1439 dmPersObj = dmSession.getObjectByPath(path); | 1440 dmPersObj = dmSession.getObjectByPath(path); |
1440 } | 1441 } |
1441 } else { | 1442 } else { |
1442 logger.log(Level.FINE, "Path doesn't contain objectid: {0}", path); | 1443 logger.log(Level.FINE, "Path does not contain chronicle id: {0}", path); |
JohnL
2017/02/15 01:36:08
s/id/ID/
Srinivas
2017/02/17 00:59:12
Done.
| |
1443 dmPersObj = dmSession.getObjectByPath(path); | 1444 dmPersObj = dmSession.getObjectByPath(path); |
1444 } | 1445 } |
1445 | 1446 |
1446 if (dmPersObj == null) { | 1447 if (dmPersObj == null) { |
1447 logger.log(Level.FINER, "Not found: {0}", id); | 1448 logger.log(Level.FINER, "Not found: {0}", id); |
1448 resp.respondNotFound(); | 1449 resp.respondNotFound(); |
1449 return; | 1450 return; |
1450 } | 1451 } |
1451 | 1452 |
1452 IDfId dmObjId = dmPersObj.getObjectId(); | 1453 IDfId dmObjId = dmPersObj.getObjectId(); |
1453 IDfType type = dmPersObj.getType(); | 1454 IDfType type = dmPersObj.getType(); |
1454 //TODO (Srinivas): remove this code | 1455 //TODO (Srinivas): remove this code |
1455 if (!path.matches(".*:\\p{XDigit}{16}")) { | 1456 if (!path.matches(".*:\\p{XDigit}{16}")) { |
1456 id = docIdFromPath(path, dmPersObj.getObjectId().toString()); | 1457 id = docIdFromPath(path, |
1458 ((IDfSysObject)dmPersObj).getChronicleId().toString()); | |
1457 } | 1459 } |
1458 logger.log(Level.FINER, "Object Id: {0}; Type: {1}", | 1460 logger.log(Level.FINER, "Object Id: {0}; Type: {1}", |
1459 new Object[] {dmObjId, type.getName()}); | 1461 new Object[] {dmObjId, type.getName()}); |
1460 | 1462 |
1461 if (type.isTypeOf("dm_sysobject")) { | 1463 if (type.isTypeOf("dm_sysobject")) { |
1462 Date lastModified = dmPersObj.getTime("r_modify_date").getDate(); | 1464 Date lastModified = dmPersObj.getTime("r_modify_date").getDate(); |
1463 resp.setLastModified(lastModified); | 1465 resp.setLastModified(lastModified); |
1464 | 1466 |
1465 if (type.isTypeOf("dm_folder")) { | 1467 if (type.isTypeOf("dm_folder")) { |
1466 getFolderContent(resp, (IDfFolder) dmPersObj, id); | 1468 getFolderContent(resp, (IDfFolder) dmPersObj, id); |
(...skipping 24 matching lines...) Expand all Loading... | |
1491 throw new IOException("Error getting content:", e); | 1493 throw new IOException("Error getting content:", e); |
1492 } catch (URISyntaxException e) { | 1494 } catch (URISyntaxException e) { |
1493 throw new IOException("Error getting URI:", e); | 1495 throw new IOException("Error getting URI:", e); |
1494 } finally { | 1496 } finally { |
1495 if (dmSession != null) { | 1497 if (dmSession != null) { |
1496 dmSessionManager.release(dmSession); | 1498 dmSessionManager.release(dmSession); |
1497 } | 1499 } |
1498 } | 1500 } |
1499 } | 1501 } |
1500 | 1502 |
1503 private IDfPersistentObject getObjectByChronicleId(IDfSession dmSession, | |
1504 String chronicleId) throws DfException { | |
1505 IDfPersistentObject sysObj = dmSession.getObjectByQualification( | |
1506 "dm_sysobject where i_chronicle_id = '" + chronicleId + "'"); | |
1507 if (sysObj == null) { | |
JohnL
2017/02/15 01:36:08
This isn't doing anything, it's just return sysObj
Srinivas
2017/02/17 00:59:12
Removed this method and called getObjectByQualific
| |
1508 return null; | |
1509 } | |
1510 return sysObj; | |
1511 } | |
1512 | |
1501 /** | 1513 /** |
1502 * Returns {@code true} if the supplied {@code DocId} is under one of the | 1514 * Returns {@code true} if the supplied {@code DocId} is under one of the |
1503 * validated {@code startPaths}, {@code false} otherwise. | 1515 * validated {@code startPaths}, {@code false} otherwise. |
1504 * | 1516 * |
1505 * @param docId a DocId representing a document | 1517 * @param docId a DocId representing a document |
1506 * @param startPaths a List of normalized start paths | 1518 * @param startPaths a List of normalized start paths |
1507 */ | 1519 */ |
1508 private boolean isUnderStartPath(DocId docId, List<String> startPaths) { | 1520 private boolean isUnderStartPath(DocId docId, List<String> startPaths) { |
1509 String path = docIdToPath(docId); | 1521 String path = docIdToPath(docId); |
1510 for (String startPath : startPaths) { | 1522 for (String startPath : startPaths) { |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1689 DocId id) throws DfException, IOException { | 1701 DocId id) throws DfException, IOException { |
1690 IDfVirtualDocument vDoc = dmSysbObj.asVirtualDocument("CURRENT", false); | 1702 IDfVirtualDocument vDoc = dmSysbObj.asVirtualDocument("CURRENT", false); |
1691 IDfVirtualDocumentNode root = vDoc.getRootNode(); | 1703 IDfVirtualDocumentNode root = vDoc.getRootNode(); |
1692 int count = root.getChildCount(); | 1704 int count = root.getChildCount(); |
1693 for (int i = 0; i < count; i++) { | 1705 for (int i = 0; i < count; i++) { |
1694 IDfSysObject child = root.getChild(i).getSelectedObject(); | 1706 IDfSysObject child = root.getChild(i).getSelectedObject(); |
1695 String objId = child.getString("r_object_id"); | 1707 String objId = child.getString("r_object_id"); |
1696 String objName = child.getString("object_name"); | 1708 String objName = child.getString("object_name"); |
1697 logger.log(Level.FINER, "VDoc Child Object Id: {0}; Name: {1}", | 1709 logger.log(Level.FINER, "VDoc Child Object Id: {0}; Name: {1}", |
1698 new Object[] {objId, objName}); | 1710 new Object[] {objId, objName}); |
1699 DocId childDocId = docIdFromPath(docIdToPath(id), objName, objId); | 1711 DocId childDocId = docIdFromPath(docIdToPath(id), objName, objId); |
JohnL
2017/02/15 01:36:08
What about switching to chronicle ID here?
Srinivas
2017/02/17 00:59:12
Done.
Srinivas
2017/02/17 00:59:12
Yes, thanks.
| |
1700 logger.log(Level.FINER, "VDoc Child Object DocId: {0}", | 1712 logger.log(Level.FINER, "VDoc Child Object DocId: {0}", |
1701 childDocId.toString()); | 1713 childDocId.toString()); |
1702 resp.addAnchor(docIdEncoder.encodeDocId(childDocId), objName); | 1714 resp.addAnchor(docIdEncoder.encodeDocId(childDocId), objName); |
1703 } | 1715 } |
1704 } | 1716 } |
1705 | 1717 |
1706 /** Returns the Folder's contents as links in a generated HTML document. | 1718 /** Returns the Folder's contents as links in a generated HTML document. |
1707 * @throws URISyntaxException */ | 1719 * @throws URISyntaxException */ |
1708 private void getFolderContent(Response resp, IDfFolder dmFolder, DocId id) | 1720 private void getFolderContent(Response resp, IDfFolder dmFolder, DocId id) |
1709 throws DfException, IOException, URISyntaxException { | 1721 throws DfException, IOException, URISyntaxException { |
1710 resp.setNoIndex(!indexFolders); | 1722 resp.setNoIndex(!indexFolders); |
1711 | 1723 |
1712 if (!markAllDocsAsPublic) { | 1724 if (!markAllDocsAsPublic) { |
1713 getACL(resp, dmFolder, id); | 1725 getACL(resp, dmFolder, id); |
1714 } | 1726 } |
1715 // Include folder attributes as metadata. | 1727 // Include folder attributes as metadata. |
1716 getMetadata(resp, dmFolder, id); | 1728 getMetadata(resp, dmFolder, id); |
1717 resp.setDisplayUrl(new URI(MessageFormat.format(displayUrl, | 1729 resp.setDisplayUrl(new URI(MessageFormat.format(displayUrl, |
1718 dmFolder.getObjectId(), docIdToPath(id)))); | 1730 dmFolder.getObjectId(), docIdToPath(id)))); |
1719 | 1731 |
1720 logger.log(Level.FINER, "Listing contents of folder: {0} ", | 1732 logger.log(Level.FINER, "Listing contents of folder: {0} ", |
1721 dmFolder.getObjectName()); | 1733 dmFolder.getObjectName()); |
1722 IDfCollection dmCollection = | 1734 IDfCollection dmCollection = |
1723 dmFolder.getContents("r_object_id, object_name"); | 1735 dmFolder.getContents("i_chronicle_id, object_name"); |
1724 | 1736 |
1725 // TODO(bmj): Use maxHtmlSize in getFolderContent. | 1737 // TODO(bmj): Use maxHtmlSize in getFolderContent. |
1726 try (HtmlResponseWriter htmlWriter = createHtmlResponseWriter(resp)) { | 1738 try (HtmlResponseWriter htmlWriter = createHtmlResponseWriter(resp)) { |
1727 htmlWriter.start(id, dmFolder.getObjectName()); | 1739 htmlWriter.start(id, dmFolder.getObjectName()); |
1728 while (dmCollection.next()) { | 1740 while (dmCollection.next()) { |
1729 String objId = dmCollection.getString("r_object_id"); | 1741 String chronicleId = dmCollection.getString("i_chronicle_id"); |
1730 String objName = dmCollection.getString("object_name"); | 1742 String objName = dmCollection.getString("object_name"); |
1731 logger.log(Level.FINER, "Object Id: {0}; Name: {1}", | 1743 logger.log(Level.FINER, "Chronicle Id: {0}; Name: {1}", |
JohnL
2017/02/15 01:36:08
s/Id/ID/
Srinivas
2017/02/17 00:59:13
Done.
| |
1732 new Object[] {objId, objName}); | 1744 new Object[] {chronicleId, objName}); |
1733 DocId childDocId = docIdFromPath(docIdToPath(id), objName, objId); | 1745 DocId childDocId = docIdFromPath(docIdToPath(id), objName, chronicleId); |
1734 htmlWriter.addLink(childDocId, objName); | 1746 htmlWriter.addLink(childDocId, objName); |
1735 } | 1747 } |
1736 htmlWriter.finish(); | 1748 htmlWriter.finish(); |
1737 } finally { | 1749 } finally { |
1738 try { | 1750 try { |
1739 dmCollection.close(); | 1751 dmCollection.close(); |
1740 } catch (DfException e) { | 1752 } catch (DfException e) { |
1741 logger.log(Level.WARNING, "Error closing collection", e); | 1753 logger.log(Level.WARNING, "Error closing collection", e); |
1742 } | 1754 } |
1743 } | 1755 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1785 logger.log(Level.INFO, "Created a new session for the docbase {0}", | 1797 logger.log(Level.INFO, "Created a new session for the docbase {0}", |
1786 docbaseName); | 1798 docbaseName); |
1787 } finally { | 1799 } finally { |
1788 logger.log(Level.INFO, "Releasing dfc session for {0}", docbaseName); | 1800 logger.log(Level.INFO, "Releasing dfc session for {0}", docbaseName); |
1789 dmSessionManager.release(dmSession); | 1801 dmSessionManager.release(dmSession); |
1790 } | 1802 } |
1791 | 1803 |
1792 return dmSessionManager; | 1804 return dmSessionManager; |
1793 } | 1805 } |
1794 } | 1806 } |
OLD | NEW |