Revision 4812
Added by daigle about 15 years ago
DocumentImpl.java | ||
---|---|---|
61 | 61 |
import edu.ucsb.nceas.metacat.util.AuthUtil; |
62 | 62 |
import edu.ucsb.nceas.metacat.util.MetacatUtil; |
63 | 63 |
import edu.ucsb.nceas.metacat.util.SystemUtil; |
64 |
import edu.ucsb.nceas.metacat.util.UtilException; |
|
64 | 65 |
import edu.ucsb.nceas.utilities.FileUtil; |
65 | 66 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
66 | 67 |
import edu.ucsb.nceas.utilities.StringUtil; |
... | ... | |
1724 | 1725 |
currentName, docid, doctype, parentId)); |
1725 | 1726 |
} |
1726 | 1727 |
} |
1727 |
if( MetacatUtil.pathsForIndexing.contains(currentName) && |
|
1728 |
leafData.trim().length() != 0 ){ |
|
1729 |
logMetacat.debug("paths found for indexing: " + currentName); |
|
1730 |
pathsFoundForIndexing.put(currentName, new PathIndexEntry( |
|
1731 |
leafNodeId, currentName, docid, leafParentId, leafData, |
|
1732 |
leafDataNumerical)); |
|
1733 |
} |
|
1728 |
try { |
|
1729 |
if (SystemUtil.getPathsForIndexing().contains(currentName) |
|
1730 |
&& leafData.trim().length() != 0) { |
|
1731 |
logMetacat.debug("paths found for indexing: " + currentName); |
|
1732 |
pathsFoundForIndexing.put(currentName, new PathIndexEntry( |
|
1733 |
leafNodeId, currentName, docid, leafParentId, leafData, |
|
1734 |
leafDataNumerical)); |
|
1735 |
} |
|
1736 |
} catch (UtilException ue) { |
|
1737 |
logMetacat.warn("Could not get index paths: " + ue.getMessage()); |
|
1738 |
} |
|
1739 |
|
|
1734 | 1740 |
} |
1735 | 1741 |
|
1736 | 1742 |
// process relative xpaths |
... | ... | |
1748 | 1754 |
logMetacat.debug("B: " + path +"\n"); |
1749 | 1755 |
pathList.put(path, new PathIndexEntry(leafNodeId, path, docid, |
1750 | 1756 |
doctype, parentId)); |
1751 |
if( MetacatUtil.pathsForIndexing.contains(path) && |
|
1752 |
leafData.trim().length() != 0 ){ |
|
1753 |
logMetacat.debug("paths found for indexing: " + currentName); |
|
1754 |
pathsFoundForIndexing.put(path, new PathIndexEntry( |
|
1755 |
leafNodeId, path, docid, leafParentId, leafData, |
|
1756 |
leafDataNumerical)); |
|
1757 |
} |
|
1757 |
try { |
|
1758 |
if (SystemUtil.getPathsForIndexing().contains(path) |
|
1759 |
&& leafData.trim().length() != 0) { |
|
1760 |
logMetacat.debug("paths found for indexing: " + currentName); |
|
1761 |
pathsFoundForIndexing.put(path, new PathIndexEntry(leafNodeId, |
|
1762 |
path, docid, leafParentId, leafData, leafDataNumerical)); |
|
1763 |
} |
|
1764 |
} catch (UtilException ue) { |
|
1765 |
logMetacat.warn("Could not get index paths: " + ue.getMessage()); |
|
1766 |
} |
|
1758 | 1767 |
} |
1759 | 1768 |
// process absolute xpaths |
1760 | 1769 |
if (id == rootNodeId) { |
... | ... | |
1765 | 1774 |
logMetacat.debug("C: " + fullPath +"\n"); |
1766 | 1775 |
pathList.put(fullPath, new PathIndexEntry(leafNodeId, fullPath, |
1767 | 1776 |
docid, doctype, parentId)); |
1768 |
if( MetacatUtil.pathsForIndexing.contains(fullPath) && |
|
1769 |
leafData.trim().length() != 0 ){ |
|
1770 |
logMetacat.debug("paths found for indexing: " + currentName); |
|
1771 |
pathsFoundForIndexing.put(fullPath, new PathIndexEntry( |
|
1772 |
leafNodeId, fullPath, docid, leafParentId, leafData, |
|
1773 |
leafDataNumerical)); |
|
1774 |
} |
|
1777 |
try { |
|
1778 |
if (SystemUtil.getPathsForIndexing().contains(fullPath) |
|
1779 |
&& leafData.trim().length() != 0) { |
|
1780 |
logMetacat.debug("paths found for indexing: " + currentName); |
|
1781 |
pathsFoundForIndexing.put(fullPath, new PathIndexEntry( |
|
1782 |
leafNodeId, fullPath, docid, leafParentId, leafData, |
|
1783 |
leafDataNumerical)); |
|
1784 |
} |
|
1785 |
} catch (UtilException ue) { |
|
1786 |
logMetacat.warn("Could not get index paths: " + ue.getMessage()); |
|
1787 |
} |
|
1775 | 1788 |
} |
1776 | 1789 |
} |
1777 | 1790 |
} |
1778 | 1791 |
|
1779 | 1792 |
/** |
1780 |
* Delete the paths from the xml_index table on the database in preparation |
|
1781 |
* of a subsequent update. |
|
1782 |
* |
|
1783 |
* @param conn the database connection to use, keeping a single transaction |
|
1784 |
* @throws SQLException if there is an error deleting from the db |
|
1785 |
*/ |
|
1793 |
* Delete the paths from the xml_index table on the database in preparation |
|
1794 |
* of a subsequent update. |
|
1795 |
* |
|
1796 |
* @param conn |
|
1797 |
* the database connection to use, keeping a single transaction |
|
1798 |
* @throws SQLException |
|
1799 |
* if there is an error deleting from the db |
|
1800 |
*/ |
|
1786 | 1801 |
private void deleteNodeIndex(DBConnection conn) throws SQLException |
1787 | 1802 |
{ |
1788 | 1803 |
//String familyId = MetacatUtil.getDocIdFromString(docid); |
Also available in: Unified diff
Format indexPaths in metacat.properties. Remove from build.properties and build.xml. Move indexPath list getter from MetacatUtil to SystemUtil.