Skip to main content

This version of the product is no longer supported, and this documentation is no longer updated regularly. See the latest version of this content.Opens in a new tab

News.NewsReader

class News.NewsReader extends %ZEN.Component.page

This ZEN page presents a simple News Aggregator UI in which a number of iKnow features are demonstrated. Call the %Build() method on News.NewsDomain to populate the domain based on a number of RSS feeds and then run this page to get started.

To keep the code simple, the central table on this page just queries a simple SQL table News.Results.Sources that holds the results for the current user action. By default the table will be populated with the most recent articles, but depending on filter selections or buttons clicked by the user, different queries (iKnow or SQL) will be used to fill this table.

Property Inventory

Method Inventory

Properties

property Agency as %String;
Agency filter, if selected by the user (Module 3, exercise 4)
Property methods: AgencyDisplayToLogical(), AgencyGet(), AgencyIsValid(), AgencyLogicalToDisplay(), AgencyLogicalToOdbc(), AgencyNormalize(), AgencySet()
property CurrentAction as %String;
Current action, as selected by the user
Property methods: CurrentActionDisplayToLogical(), CurrentActionGet(), CurrentActionIsValid(), CurrentActionLogicalToDisplay(), CurrentActionLogicalToOdbc(), CurrentActionNormalize(), CurrentActionSet()
property CurrentPage as %Integer [ InitialExpression = 1 ];
Current page of results
Property methods: CurrentPageDisplayToLogical(), CurrentPageGet(), CurrentPageIsValid(), CurrentPageLogicalToDisplay(), CurrentPageNormalize(), CurrentPageSet(), CurrentPageXSDToLogical()
property Domain as %Integer [ InitialExpression = ##class(News.NewsDomain).%GetDomainId() ];
ID of the domain used by this demo
Property methods: DomainDisplayToLogical(), DomainGet(), DomainIsValid(), DomainLogicalToDisplay(), DomainNormalize(), DomainSet(), DomainXSDToLogical()
property DomainName as %String [ InitialExpression = ##class(News.NewsDomain).%GetDomainName() ];
Name of the domain used by this demo
Property methods: DomainNameDisplayToLogical(), DomainNameGet(), DomainNameIsValid(), DomainNameLogicalToDisplay(), DomainNameLogicalToOdbc(), DomainNameNormalize(), DomainNameSet()
property FavoritesDictionary as %String [ InitialExpression = "My Favorites" ];
Name of the dictionary containing "favorite terms" (Module 4, exercise 5)
Property methods: FavoritesDictionaryDisplayToLogical(), FavoritesDictionaryGet(), FavoritesDictionaryIsValid(), FavoritesDictionaryLogicalToDisplay(), FavoritesDictionaryLogicalToOdbc(), FavoritesDictionaryNormalize(), FavoritesDictionarySet()
property IFindSearchString as %String;
IFind search string as provided by the user (Module 5, exercise 5)
Property methods: IFindSearchStringDisplayToLogical(), IFindSearchStringGet(), IFindSearchStringIsValid(), IFindSearchStringLogicalToDisplay(), IFindSearchStringLogicalToOdbc(), IFindSearchStringNormalize(), IFindSearchStringSet()
property InputConfig as %String [ InitialExpression = "AllLanguages" ];
Name of the configuration to use for indexing manual input
Property methods: InputConfigDisplayToLogical(), InputConfigGet(), InputConfigIsValid(), InputConfigLogicalToDisplay(), InputConfigLogicalToOdbc(), InputConfigNormalize(), InputConfigSet()
property SelectedEntity as %Integer;
Entity ID as selected by the user when clicking on an entity (Module 3, exercise 6)
Property methods: SelectedEntityDisplayToLogical(), SelectedEntityGet(), SelectedEntityIsValid(), SelectedEntityLogicalToDisplay(), SelectedEntityNormalize(), SelectedEntitySet(), SelectedEntityXSDToLogical()
property SelectedSource as %Integer;
Source ID as selected by the user when clicking on an action
Property methods: SelectedSourceDisplayToLogical(), SelectedSourceGet(), SelectedSourceIsValid(), SelectedSourceLogicalToDisplay(), SelectedSourceNormalize(), SelectedSourceSet(), SelectedSourceXSDToLogical()
property Subtitle as %String [ InitialExpression = "Recent articles" ];
Subtitle, as derived by RefreshTables()
Property methods: SubtitleDisplayToLogical(), SubtitleGet(), SubtitleIsValid(), SubtitleLogicalToDisplay(), SubtitleLogicalToOdbc(), SubtitleNormalize(), SubtitleSet()
property SummaryLength as %Integer [ InitialExpression = 0 ];
Length of the summary to be displayed in the article reading pane (Module 3, exercise 6)
Property methods: SummaryLengthDisplayToLogical(), SummaryLengthGet(), SummaryLengthIsValid(), SummaryLengthLogicalToDisplay(), SummaryLengthNormalize(), SummaryLengthSet(), SummaryLengthXSDToLogical()
property Topic as %String;
Topic filter, if selected by the user (Module 4, exercise 4)
Property methods: TopicDisplayToLogical(), TopicGet(), TopicIsValid(), TopicLogicalToDisplay(), TopicLogicalToOdbc(), TopicNormalize(), TopicSet()

Methods

method %OnAfterCreatePage() as %Status
Ensure the main table is refreshed when opening the page a first time
method AddFavoriteSource(pSourceId As %Integer, pCount As %Integer = 5) as %String [ ZenMethod ]
Add the top entities in a whole source as favorite terms to the Favorites dictionary Module 4, exercise 5
method AddFavoriteTerm(pTerm As %String, pMatch As %Boolean = 1) as %String [ ZenMethod ]
Add favorite term to the Favorites dictionary, indexing all sources at the end Module 4, exercise 5
method DrawArticle(pSeed As %String) as %Status
Display the article contents in the article reading popup
method DrawSource(pTable As %ZEN.Component.tablePane, pName As %String, pSeed As %String) as %Status
Draws the main characteristics of a source in the main table
method DrawSourceActions(pTable As %ZEN.Component.tablePane, pName As %String, pSeed As %String) as %Status
Draws the action buttons for a source in the main table
method DrawSourceMeta(pTable As %ZEN.Component.tablePane, pName As %String, pSeed As %String) as %Status
Draws a metadata field (passed in through pSeed) for a source in the main table
method GetArticleInfo() as %ZEN.proxyObject [ ZenMethod ]
Utility method: return information about the current source as a proxy object
method IndexArticle(pTitle As %String, pText As %String) as %String [ ZenMethod ]
This method is called by submitInput() and will index the submitted text pText using direct text loading.
method RefreshTables() as %Status [ ZenMethod ]
Refreshes the contents of the main sources table based on the values of the different page properties containing the current action, user selections and filter criteria
clientmethod addFavorite(favorite, type) [ Language = javascript ]
Drives adding favourites
clientmethod goToUI(page) [ Language = javascript ]
Utility method: browse to a %iKnow.UI page
clientmethod nextPage(direction) [ Language = javascript ]
Browse to the next page
clientmethod onChangeFilters() [ Language = javascript ]
Utility method: refresh current view based on current filter values
clientmethod onTypeSearch(text) [ Language = javascript ]
Utility method: launch iFind search from the search box
clientmethod readArticle(srcId) [ Language = javascript ]
Opens the article reading popup
clientmethod refreshAll() [ Language = javascript ]
Utility method: refresh the main sources table and page subtitle
clientmethod reset() [ Language = javascript ]
Resets the current action
clientmethod showByEntity(entId) [ Language = javascript ]
Triggers the "byEntity" action
clientmethod showMatches(srcId) [ Language = javascript ]
Opens the matches detail popup
clientmethod showSimilar(srcId) [ Language = javascript ]
Triggers the "similarSources" action
clientmethod submitInput() [ Language = javascript ]
This method is called when manual input is being submitted
clientmethod summarize() [ Language = javascript ]
In the article reading pane, refresh the article to display a summary of the selected length

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab