APC Action Applications - Home Page

Frequently Asked Questions v2

 

Topic:

0. What's the benefit of Content Pooling?
1. What is Content Pooling?
2. How do I automatically feed only select items to other slices?
3. How do feed items from one slice to another
4. How can I control which fields are fed, and whether they are editable
5. I want to feed highlighted items from several slices to the front page.
6. How to setup Cross server networking (CSN)
7. Feeding: How to access the id field in a parent
8. How can I set mapping on Manual feeding.
9. How to link parent item?
10. How do I create an RSS feed from a slice
11. How do I set mapping on RSS import

There are two general kinds of benefits:

  1. Content - Pooling can give you access to a fresh stream of content for your site (in the form of your partners' articles); and
  2. Publicity - Pooling can help you get your own content out to new audiences (whenever you partners reprint your articles).
Content Pooling lets you exchange articles with any number of partner sites. You can create a pool with any number of partners. With Pooling, you always retain complete control: you can withold any item from your pool; and you can reject any item made available to you.

Through Value field on the Mapping page you can specify not only a new value, but also any AA expression, which is unaliased - example:

<a href="{source_href.....}">{source..........}</a>

In the Value field you can specify, which items should be fed and which not. It is done by modifying the value of the ‘Status Code’ of the receiving slice, according to field in the feeding slice.
Status codes are: 1=active, 2=Holding, 3=Trash, 4=Do not fed)

An example set-up:

1) Set Feeding, as usual ('Slice Admin' -> 'Inner Node Feeds') (see feeding FAQ)

2) Go to 'Slice Admin' -> 'Mapping' and select the your source slice

3) fill something like: {switch({category.......1})Enviro:1:4} for 'Status Code' and set FROM to '-- Value --'

After this all items from the source slice with category 'Enviro' will be fed into Active ('Status Code' value=1). Other will not be fed ('Status Code' value=4).

There are two feeding methods - authomatical and manual. Automatical feeding works only for new/updated item. By manual feeding it is possible to feed any selected item to another slice (if you have permission to do so).

Manual feeding
In Item Manager select the items you want to send to another slice. Select "Export" on the toolbar just below the itemlist. After clicking on "GO" a new window is shown where you can select destination slices. (You must have a permission in the destination slice - at least Author. If you are Editor or more in the destination slice, you can set the "Active" checkbox, which means to copy the items in the destination slice into the Active Bin. If the checkbox stays unchecked, the item is copied to the Holding bin).

The feeding is error-safe, it is impossible to feed one item to the same destination slice more than once.

Automatical feeding

Each Feed needs to be configured in both the slice where the items are entered and which will export items, and for the slice where the items are imported.

Select the slice where the items are entered. Select Admin->Content Pooling -> Inner Node Feeding. If you are willing for items to go to any other slice on the same host then check "Enable export to any slice". Otherwise uncheck this box, and move slices that you want to receive items to the Export Enable box.

Select the slice where items will be received. Make sure the slice you want to recieve from is in the Import box. As a courtesy send an email to the administrator of the slices you want to receive from.

The import process can be fine tuned in two ways.

In Admin->Content Pooling->Filters you can select which of the exporting slice's categories items come from, and to which categories of the importing slice they are delivered. Select the Active box if you want items in this category to be made Active, otherwise they will go in the Holding Bin for manual approval. There is currently no way to control which items are fed, only which category they go to.

In Admin->Content Pooling->Mapping you can control which fields of the source slice end up in which fields of the destination slice.

If you want to export items already in the slice, then go to the Item Manager, check the items to export, and choose "Export" and Go. This will give a choice of destination slices, which you can check along with whether they should be Active, or go to the Holding Bin for manual approval.

When you write an item which goes into the Active bin or when you approve an item, the feeding function is invoked. This function finds all slices where the item should be fed (depending on current feeding permissions ("Admin" -> "Content pooling - Import & Export") and feeding setings ("Admin" -> "Content pooling - Filters")). The feeding goes deeper and deeper between the slices until a cycle is detected or feeding into Holding bin is set.

Feeding one item from one slice to another means:

Let's look in the constants.php3 file:

# content table flags
define( "FLAG_HTML", 1 );
define( "FLAG_FEED", 2 );
define( "FLAG_FREEZE", 4 );
define( "FLAG_OFFLINE", 8 );
define( "FLAG_UPDATE", 16 );

# states of feed field of field table
define( "STATE_FEEDABLE", 0 );
define( "STATE_UNFEEDABLE", 1 );
define( "STATE_FEEDNOCHANGE", 2 );
define( "STATE_FEEDABLE_UPDATE",3);
define( "STATE_FEEDABLE_UPDATE_LOCKED",4);

# relation table flags
define( "REL_FLAG_FEED", 2 ); # 2 - just to be compatible with content table


There you see how the various flags can be set. The most important are the flags for the field table. For each field you can set whether this field is

These settings can be done on the "Admin" -> "Main settings - Fields" -> "Edit" -> "Feeding mode" page, where you can set for each field:

Depending on field table flags, the flags for content table are set:

After copying the contents, the relation table is updated. This table holds information about the feeding tree (from which item is the content fed to another). The relation table will be used for another purposes in future too (for holding discussion threads, ...), so each record for feeding if flagged as REL_FLAG_FEED.



There is solution for 'Internal feeding':

It could be done using field 'Mapping' ('Slice Admin -> Mapping').
One of the possibilities there is to select '-- Value --' for a field. The 'Value' is not ony static text, but you can use any AA alias construct there (just like: <a href="{source_href.....}">{source..........}</a>).

The solution is to specify such expression for 'status_code' field (which controls, in which bin resulting items appear:
1 - Approved
2 - Holding bin
3 - Trash
4 - Item is not fed

So, if you specify something like:

{switch({highlight.......})1:1:4}

for status_code field, only highlighted fields are fed (into Approved).


There is no way to do it for external (Inter Node or RSS) feeds. The only solution there is to feed all the items into one slice
and then show only highlighted items in destination slice (the
highlighted flag will be copied too, so there is no need for manual setting "highlighted" in destination slice) CSN is a feature which allows item exchange between two servers.

Developers note: The implementation is based on Moritz Both's specification:
http://plus.aldebaran.de/apc-aa/csn.html
http://plus.aldebaran.de/apc-aa/csnspec.html

--------------------------------------------------
A. Installation

Node = one installation of ActionApps.

Assume there are two nodes, which want to exchange items

Step 1 Set up the node details,
- must be done by sysdadmins, with shell access on both nodes, but they only have to be done once, no matter how many slices and how many nodes are configured, normally it will have be done when ActionApps was installed.

Set the ORG_NAME in config.php3 file to the name of your organization, e.g.:
define ("ORG_NAME","Econnect");

Step 2 Set the information about the collaborating nodes.
- must be done by a Superadmin on both nodes, once for each node that it imports or exports to.

Step 3 Setting import and export
- this can be done by the Slice Admin

3.1 On the exporting node,

There you can set the permissions for remote users, who will have the rights to get items from the current slice.

3.2 On the importing node,

There you can set, from which remote nodes and slices will items be fed.

3.3. Set the filters and mapping on the importing node

Filters and mapping you can set exactly the same way as for local feeding. See 'Slice Admin -> Filters' and 'Admin -> Mapping'

Step 4. Set the cron
ActionApps adds the task for CSN to the AA Cron on its setup. If you are superadmin, you can check it on AA -> Misc - Cron page. There should be task defined as:

 * 8,23,38,53 * * *   admin/xmlclient.php3 

In order the task from cron are started regulary, the cron must be well configured by the system administrator. If the cron is configured, the column 'last_run' on 'AA -> Misc - Cron' page is not empty and the value is time to time changed. Please read section:

or such link to your index (or fulltext) design (Admin -> Design -> Index -> Odd Rows). This will point to fulltext of parent item or to the fulltext of the same item, if the item is not fed.


Setup your slice as normal, got to Slice Admin -> Views -> type:RSS News.

You can edit the feed to more precisely pick what you want for each item. Use the _#RSS_* aliases to refine it.

The URL of the RSS feed should be at /apc-aa/view.php3?vid=xx

For most feeds you won't need to map them, unless you want the feed to go to Active rather than Hold bin.

To set the mapping, first create the feed in AA->RSS Feeds, then click on the feed and click Map. (or go to it directly from the AA->Mapping page.

If all you want to do is send it to the Active bin, then go to the bottom and change "Status" to "Value" and "1" (hold is "Value" and "2")

You can set quite complex feeding behavior by setting any field to "RSS field or expression" and then entering an RSS field name, or more complex expression.

Fields have a prefix and a value e.g. DC:TITLE, the allowed fields are:
PrefixAllowed ValuesWhere found in RSS
CHANNEL/ title, description, language, timestamp (AA only), link From the corresponding CHANNEL elements at the top of the feed except slice_id is from dc/identifier
ITEM/ title,description,link,id, guid, pubdate From the corresponding ITEM elements except id is from dc/identitifier)
DC/ title,creator,subject,description,date,source,language,relation,coverage From the corresponding DC elements within the ITEM

In addition, the following syntax is supported:

ITEM/DESCRIPTION|ITEM/TITLE Will look for the Description, and if that is not present use the title
DATE(ITEM/pubdate) Converts the specified field to a unix date
NOW Uses the current date and time
CONTENT Hard coded to find the content and determine if its HTML, given that the RSS standard makers keep moving things! Currently it looks in Item/encoded and and Item/items/bag/li/item/value
headline........ Will look for an APC-AA field, this only works if the sending RSS feed is from APC site, in which case Inter-node feeding would be better anyway.

Notes to Developers

It is relatively straightforward to modify RSS import as the standards mutate

 

This FAQ interface was developed by Jason at Commons.ca

APC: Internet and ICTs for social justice and development APC ActionApps is a free software content management system initiated by the Association for Progressive Communications (APC)
APC - Internet and ICTs for social justice and development