Start page

Mykola Zharkikh (Kyiv)

Personal site

?

News publishing

News in Smereka is a node of NEWS_ITEM_CLASS class. This class defines the attributes Title, Text, Publication date, Complete information id and Category Id. Besides this such node has a set of standard Smereka node attributes.

Designed in this way news can be used to build different ways of delivery to news readers, such as HTML pages, RSS feeds or email newsletters.

One can post news items using the standard Smereka editor, but it is quite tiring job. So a special command "News publication" implemented for it's simplification and automation. This command associated with the button on the toolbar to the left of the inspector.

To use this command one should download in editor the node which is information cause, and click "News publishing". Then Smereka makes the following:

1. Looks in a subdomain or domain for a node of NEWS_FOLDER_CLASS class, which is a news aggregator. The node with oldest hierarchical position is selected (so that does not include among their ancestors the other node of NEWS_FOLDER_CLASS class).

2. Creates a new child node subordinate news aggregator. It takes the access level that hides it from anonymous visitors.

3. Insert smeretag into the Text attribute, which gives the title for the information cause node. If the site is multilingual, all language versions of the Text attribute gain this value.

4. Assign current date to the Publication date attribute.

5. Assign information cause node id to the Complete information id attribute.

6. Assign the date of publication, reduced to a day in the format YYYY-MM-DD (eg 2010-02-14), to the Symbolic name attribute.

7. Checks number of news items, subordinate to news aggregator, and if this number exceeds a certain number (default – 30), excessive items moved to the archive. Archive is the node of NEWS_FOLDER_CLASS class, which is a last child node of the aggregator (if such node does not exists, it is created automatically).

8. Downloads newly created element in the editor.

Then the editor have less manual work: insert news title, additional explanations in the text, pick the category (part of site), to which news item belong, and publish it by providing public access level to the node.