Package com.storedobject.ai
Class Topic
java.lang.Object
com.storedobject.core.StoredObject
com.storedobject.core.Name
com.storedobject.ai.Topic
- All Implemented Interfaces:
Displayable,HasName,StringFiller,HasId
Represents a specific topic characterized by its name and associated logic.
This class extends the functionality of the
Name class and provides additional behavior
for managing and validating knowledge logic associated with the topic.
It is immutable and provides static utility methods for working with topic-related data.- Author:
- Syam
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]Retrieves an array of column definitions for the topic entity.booleancasAccess(SystemUser user) Determines whether the specifiedSystemUserhas access to the topic.static voidAdds required column definitions for the `Topic` class to the givenColumnsobject.static voidCustomizes the metadata of a UI field.static TopicRetrieves aTopicinstance by its name.Class<?> Retrieves the knowledge logic class associated with this topic.getLogic()Retrieves the logic associated with this topic.Retrieves the name of the topic.static ObjectIterator<Topic> list(SystemUser user) Retrieves an iterator ofTopicobjects that the specifiedSystemUserhas access to.static ObjectIterator<Topic> Retrieves an iterator ofTopicobjects that match the specified name.voidSets the logic associated with the topic.voidValidates the data integrity and ensures all required properties of theTopicare properly set.Methods inherited from class com.storedobject.core.Name
getName, getUniqueCondition, indices, setName, toStringMethods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, getContemporaryOf, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listDeletedIds, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loadAttributesFrom, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toDisplay, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateDelete, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
-
Constructor Details
-
Topic
public Topic()Constructs a new, empty instance of the Topic class. This default constructor is used to create an uninitialized object of Topic.
-
-
Method Details
-
columns
Adds required column definitions for the `Topic` class to the givenColumnsobject.- Parameters:
columns- theColumnsobject to which the column definitions will be added
-
browseColumns
Retrieves an array of column definitions for the topic entity.- Returns:
- An array of strings representing the column definitions, mapping database column names to user-friendly names. For example, "Name AS Topic" and "Logic AS Knowledge Logic".
-
get
-
list
Retrieves an iterator ofTopicobjects that match the specified name.- Parameters:
name- the name of the topics to be listed- Returns:
- an iterator of
Topicobjects that match the specified name
-
getTopicName
Retrieves the name of the topic.- Returns:
- The name of the topic as a String.
-
setLogic
Sets the logic associated with the topic.- Parameters:
logic- the logic to be associated with this topic; typically represents a class name or identifier related to knowledge logic functionality.
-
getLogic
-
validateData
Validates the data integrity and ensures all required properties of theTopicare properly set. If the associated knowledge logic class cannot be resolved, an exception is thrown.- Overrides:
validateDatain className- Parameters:
tm- theTransactionManagerinstance used for handling transactional operations- Throws:
Exception- if theKnowledgeLogicclass is not set or valid
-
getKnowledgeLogicClass
Retrieves the knowledge logic class associated with this topic. If the class has already been resolved, it returns the cached class. Otherwise, it attempts to resolve the class using the logic field. If the class is abstract or any error occurs during resolution, it returns null.- Returns:
- the
Class<?>representing the knowledge logic class, ornullif the logic class cannot be resolved or is abstract.
-
customizeMetadata
Customizes the metadata of a UI field. Updates the caption of the metadata if the field name matches specific criteria.- Parameters:
md- the metadata of the UI field to be customized
-
casAccess
Determines whether the specifiedSystemUserhas access to the topic. If the user's ID matches the current ID, the stored access status is returned. Otherwise, the access permission is recalculated based on the user's ability to access the associated knowledge logic class.- Parameters:
user- theSystemUserwhose access is being checked; may benull- Returns:
trueif the user has access to the topic,falseotherwise
-
list
Retrieves an iterator ofTopicobjects that the specifiedSystemUserhas access to. It filters the topics based on the user's access permissions.- Parameters:
user- theSystemUserwhose access permissions are used to filter the topics; may benull- Returns:
- an iterator of
Topicobjects that the user has access to
-