I'll help you find category data in OpenText Content Server version 16.2 using a step-by-step approach:
- Understand the Category Structure
- In OpenText, categories are metadata associated with nodes (documents/files)
- Categories are typically stored in multiple database tables
- The primary tables for category information are usually:
DCONTENTCATEGORY
DCONTENTCATEGORYVALUE
- Retrieve Category Information via OScript
// Basic OScript to fetch category data
function GetCategoryData(nodeID)
{
// Declare database connection
Database db;
db = Context.Database;
// Prepare SQL query to fetch category details
string sqlQuery = "SELECT c.CategoryName, cv.CategoryValue " +
"FROM DCONTENTCATEGORY c " +
"JOIN DCONTENTCATEGORYVALUE cv ON c.CategoryID = cv.CategoryID " +
"WHERE cv.DataID = :nodeID";
// Execute query
ResultSet results = db.Execute(sqlQuery, nodeID);
// Process results
while (results.Next())
{
string categoryName = results.GetString("CategoryName");
string categoryValue = results.GetString("CategoryValue");
// Log or process category data
Context.Log("Category: " + categoryName + ", Value: " + categoryValue);
}
}
- Key Considerations
- Use
DataID to link categories to specific nodes
- Ensure proper database connection and error handling
- Consider performance for large datasets
- Recommended Approach
- Use parameterized queries to prevent SQL injection
- Add error handling and logging
- Consider caching results if frequently accessed
- Additional Database Exploration
- Check
DCONTENTCATEGORYVALUE table for specific node category mappings
- Join with
DCONTENTCATEGORY to get full category details
Would you like me to elaborate on any of these steps or provide more specific code for your use case?
Note: Since this involves database and OScript specifics, I recommend testing in a development environment first and consulting OpenText documentation for exact implementation details.