|
Frequently Asked Questions v2
|
Topic: AA Admin
0. How to import big exported slice&data?
1. Create new Wizard
2. How can I modify the fonts used in the AA interface?
3. How to integrate APC-AA with email
4. MultiLingual eXtension for ActionApps / How to setup ActionApps for multilingual web sites
5. Cron - how to automatically run tasks on given time?
We have slice data and structure exported to AA.XML file and we want to import it back to the AA. The problem is, that the AA.XML file is 24 MB.
The solution:
The problem could be in PHP setting. Here's what I had to change in php.ini file to get it going:
1. post_max_size: increased from 8M to 32M
2. upload_max_filesize: increased from 2M to 32M
Those first two were key -- from the php log the upload was clearly
exceeding both of these parameters. Obviously, if the upload was bigger
than 32M (ours was about 24M) this might need to go even bigger.
I also increased these others. I think the upload wouldn't have
completed in the default times, but I'm not sure which parts of the
operation count towards which of these:
1. max_execution_time: changed from 30 to 120 seconds
2. max_input_time: changed from 30 to 120 seconds
3. memory_limit: changed to 32M
The wizard is available to AA Administrators only. It enables to
- create a new slice
- copy its views from a source slice / template
- copy constants used by it to new constant groups
- add new user with Slice Editor (Item Manager) or Slice Administrator privileges
- and send her/him a welcome email message.
The wizard is closely related to the File Manager, which
contains additional features.
The user is created immediately after clicking on "Add Slice". The
next page with slice settings shows whether there was some error or the user
was successfully added. If you don't fill any user information, she/he is not
added. You can return to the wizard page by Back and try it again.
Only after successfully filling all the slice information (the same process
as with the usual Create New Slice) the views and constants are copied and (optionally)
the new user is assigned privileges to the slice.
The Email Welcome select box is filled from the wizard_welcome table. You can
use these aliases in the "email", "subject", "from"
fields:
- _#SLICNAME - slice name
- _#LOGIN___ - new user login name
- _#NAME____ - new user name
- _#ROLE____ - new user role (EDITOR / ADMINISTRATOR)
- _#ME_MAIL_ - administrator mail
- _#ME_NAME_ - administrator name
A copy of the welcome mail message is sent to the administrator's address (_#ME_MAIL_),
so that she/he may see the process went on successfully.
Edit the welcome messages on the "Wizard Welcomes" AA admin page.
An example is:
description |
Generic Item Manager Welcome |
email |
Welcome, you have been assigned an _#ROLE____ for the slice _#SLICNAME.
Your username is _#LOGIN___. See http://apc-aa.sf.net/faq for help on AA. |
subject |
Welcome, AA _#ROLE____ |
mail_from |
"_#ME_NAME_" <_#ME_MAIL_> |
The new constant group names are found by trying to add "_1", "_2",
"_3", ... at the end of the group name until a group with such name
does not exist.
The code used by the Wizard is shared with the Add Slice, Add User and Pemissions/Assign
scripts, so you can expect the same behavior and AA developers may easily maintain
it..
There are CSS files in the root directory that you can modify or create a
new CSS file and point to it from include/config.php3 (line 139).
There are several places where APC-AA sends mail, and it can be confusing,
especially since it is really easy to configure them wrongly so they don't work,
and little help for figuring out why. Lets consider 4 cases. The Bugs and Weaknesses
of each method are shown because they may help pick which method to use, and
also help guide as to places for further development.
Slice Admin or Editor wants notification of new items added to Hold bin, or
edited or whatever.
Use the Email Notification functionality, here you can
specify different messages to be sent when messages are added / edited to Active
/ Hold bins, and different recipient lists, so for example you can create a
message to an Editor whenever a new message arrives in a Hold bin, and maybe
a different message to the sysadmin when an item is moved into the Active bin
(usually by the Editor). The message could be just something like "An item
has been posted in Xyz slice" or by using aliases can include any fields
of the item posted.
Bug/Weakness: You can't use aliases in Subject line, this might be fixed in
some version (but is unlikely to be a priority!)
Limitation: The members of the list can only be changed by a slice admin, so
don't use this for Alerts ...
A number of people want to receive items posted to a slice
Use a reader management slice (see doc/reader.html)
in conjunction with Alerts (doc/alerts.html).
Bug/Weakness: its complex to setup, and frequently people don't succeed, if
you don't follow the Tutorial Step by Step (in doc/alerts.html)
you probably won't get it to work.
Bug/Weakness: In particular it requires creating an anonymous form, which depends
very much on the way its being used (e.g. called from something.shtml or site.php3).
One possible development fix would be creating a PHP3 script that took the slice-id
of an Alerts module as a parameter and did this much more simply.
Bug/Weakness: documentation says 5.3a: View with type "Alerts Digest",
when it means "Alerts Selection Set".
A number of people want to be in an email discussion, i.e. all posting to
each other.
Use a Reader Management Slice (see doc/reader.html)
in conjunction with Mailman, APC-AA is used to manage the mailman list
Bug/Weakness: you can no longer manage the lists (subscribe/unsubscribe) by
email to the Mailman account once you've done this, mailman will almost certainly
be sending out email telling the users they can!
Bug/Weakness: You have to understand both apc-aa AND mailman to get this to
work since doc/reader.html refers to tasks that require knowing where to find
and how to configure mailman.
Bug/Weakness: There is no link between information in a slice, or discussions,
and the email discussion, i.e. this is not - like yahoo groups - a web OR mail
interface to the same set of data.
Reports of failure (Jason Diceman) partly due to server setup
People wish to receive copies of new comments in Discussions by Email
See "FAQ/Discussions as Mail List", this allows
a field in each item to specify a mailing list.
Bug/Weakness: This field has to be added to every item, it can't be specified
at the slice level (make the field Required but not Shown and set a default).
This is particularly difficult if you want to retrofit discussions to an existing
slice, or something coming in over RSS.
Bug/Weakness: This can only go to a single email address, so you have to manage
the list somewhere else outside APC-AA (there is no way to for example link
it to Alerts).
Bug/Weakness: It doesn't appear to work, sends blank emails.
Summary
|
Template for Email |
Who gets the email |
How sent |
Bugs, Limitation and further development |
Notification |
Admin -> Slice -> Email Notification |
Directly from script updating |
Can't use aliases in Subject line
Can't self-manage recipients
|
Alerts |
Admin -> Slice -> Views -> Alerts View |
Readers from Reader slice, who can choose which to recieve |
By Cron |
Complex to setup (anon forms) |
Email Discussion |
Not applicable - its email to email |
Members managed by Reader Management slice |
Mailman handles all sending |
Requires understanding mailman to setup, reports of failure partly due to server setup
Cant subscribe/unsubscribe by email
No slice -> email or email -> slice
|
Discussion -> Email |
Admin -> Slice -> Views -> Discussion to Email |
One hard-coded email address |
Not sure, probably cron. |
Doesn't integrate with Alerts so no recipient management at all
Doesn't seem to work (Mitra).
Has to be added to each item in slice. |
Note:
There is no integration for receiving email, although there has been discussion
(where?) about posting articles by mail
MLX - MultiLingual eXtension for APC-ActionApps
Submitted by mimo on Fri, 07/10/2009 - 18:01
MLX adds content translation and interface translation features to ActionApps. All of this is now part of ActionApps core and these pages are here mainly for documentation and historic reasons.
(or mimo's language extension)
(C) Michael Moritz mimo/at/restoel.net
MLX Screenshots
Changelog
- 05/11/2004 MLXGet Text Documentation
- for changelog see APC AA CVS on SourceForge
- 05/10/2004 -- changed the way ids get stored, optimised sql queries and since MLX is now in APC-AA CVS removed the installation stuff from this page, to upgrade without CVS have a look at MLX installation -- the hard way
- 04/10/2004 -- now moved into APC AA CVS on SourceForge
- 03/10/2004 -- apc-aa-mlx-0.2: support for simple slice.php3 calls; better admin integration (using MLX tabs)
- 29/09/2004 -- first buggy release: basic admin interface functions
Step-by-Step Example of setting up a slice for MLX
- Create a new slice based on News Template and call it MLX Control Slice.
- Delete all deleteable fields from this slice.
- Add two new fields. Call one EN, the other one FR and choose type MLX Control for them.
- Unshow all other fields apart from these two. Have a look at MLX Screenshots to see what this should look like.
- Create a new slice. This one will hold the actual content (Content Slice). It can be any kind of slice.
- In Slice Settings select the MLX Control Slice you created before. Again, MLX Screenshots are your friend.
- Check that the slice contains a lang_code....... field.
- Add a field for the MLX information. It must be of type MLX Control. It doesnt have to be visible, so in most cases you want to hide it from the user by unticking Show.
- Done! You are ready to use the multilingual content slice.
Using MLX
MLX adds a little menu to the Add Item / Edit Item pages. This contains something like:
Add German | Edit English (view) | Edit Dari | etc.
Clicking on Add DE takes you to the Add Item page. This is prefilled with the contents of the original item. Once you have translated this content press the Insert button. MLX takes care of storing the information that keeps the original version of the article and the German translation together.
MLX and slice.php3 -- Displaying content using MLX on a web site
From version 0.2 MLX does actually do something do the output as well. This is configurable depending on what situation you are in. Here are three scenarios:
- You have a multilingual site. Some articles are translated, others only exist in the original language. If a vistor to your site chooses a language into which only some articles are translated you want to display the untranslated ones nevertheless (an example of this is the ESF2004 website). In this case you would use slice.php3 like this: add mlx=FR to the URL if the user selected French as his/her language. E.g. index.shtml?mlx=FR&listlen=10. MLX takes care of showing translations or original items for you. It will display an alternarive article (in this example a non-French one) if it exists one. If more than one other translation exists MLX uses the order in which the languages are defined in the MLX Control Slice. So the step-by-step example above would first look for an English version. But you (or the user may chose to) can even override this behaviour: The same way you pass the user's language choice to slice.php3 you can aslo set the order in which alternatives are used. With two languages this doesnt make sense, but given you had a third translation, let's say in German, you could pass the order like this: index.shtml?mlx=FR-DE-FR This would make MLX first look for a French version of the item, then a German one, and then a French one and display the first one found.
- You only want to display articles in the language the user has chosen. Use this syntax for your calls to slice.php3: index.shtml?mlx=FR-ONLY (This is similiar to using a condition)
- You want to display all articles including other language versions. Syntax: index.shtml?mlx=ALL. (This ignores MLX information)
MLX and view.php3
MLX supports views as well. Use set[vid]=mlx-(lang code)-(lang code 1)-..-(mode)
The _#MLX_LANG Alias
When using language defaulting this is helpful. It allows to print the current desired or default language in a view. This is hopefully helpful for creating language menus, displaying messages like "currently there isnt a translation for this article, so the original version is displayed". Have a look at the demo in MLX Screenshots for how this works.
FAQ
- Q: How do I MLX-alise a slice?
A: Follow the steps in the Step-by-Step example but skip creating the Content Slice (step 5). Make sure you set the MLX Control Slice as the MLX: Language Control Slice in the slice you want to MLX-alise and that you have a field of type lang_code....... in it. To MLX-alise an item you need to edit it in the Item Manager. This means you click on the headline and the press the Update button. Click on the headline again and MLX is ready.
Bugs & Limitations & TODOS
- Maybe add to fulltext view also in slice.php3
- Testing, testing, testing
Credits
- Huge thanks to Marek Tichy for discussing this and helping implementing it as I did not know anything about Action Apps? code when I started
(was on http://mimo.gn.apc.org/mlx)
The script cron.php3 -
similar to Unix cron - is able to run PHP scripts on given time.
If you want to send e-mail notifications if some condition is satisfied or if
you want to exchange items between slices regularly, you will find it
useful.
The reason for this script to exist is that it's not easy to run PHP scripts
by the Unix cron. It also allows us to use admin interface (AA -> Misc - Cron)
to add/modify new tasks to run.
If you want to run some task on given time (like running admin/xmlclient.php3
for Cross Server Item Exchange each 15 minutes), you have to do two steps:
- add new task on cron admin page (AA -> Misc - Cron)
- make you sure the cron.php3 is periodically started from unix cron
1. Add new task on cron admin page
The task you can set/edit on cron admin page (AA -> Misc - Cron). The fields
(their names
are taken from PHP getdate()) have the
following meaning: Let's call time units all from: minutes,
hours, mday (month day, 1-31), month, wday (week day, 0-7, where 7 and 0 both
mean Sunday). You may use three-letter month and week day names (like
"jan","feb","sun","mon"). A time unit may be set to:
* |
not set - jump over this field |
10 |
number: run only when time unit equals |
1-5 |
range: run when time unit equals 1 or 2 or 3 or 4 or 5 |
0-59/15 |
range with step: run when time unit (minutes in this case) equals
0 or 15 or 45 |
5,15-25/5,40 |
you may combine numbers, ranges and ranges with steps, separated by
comma |
- Don't write any whitespace (spaces, tabs) into the time units.
- Write script name into the "script" field. Use
relative path from apc-aa home dir, e.g.
"include/myscript.php3".
- If you need to send any parameters to the script,
write them into the "params" field in form
"var1=value1&var2=value2".
The task table is allready prefilled on APC ActionApps setup, so you should see something like:
time script params
* 1 * * * misc/alerts/alerts.php3 howoften=daily&lang=en (Alerts - daily diggest)
* 1 * * 1 misc/alerts/alerts.php3 howoften=weekly&lang=en (Alerts - weekly diggest)
* 1 1 * * misc/alerts/alerts.php3 howoften=monthly&lang=en (Alerts - monthly diggest)
* 1 * * * misc/alerts/admin_mails.php3 (Alerts - sending of subscription e-mails,...)
* 8,23,38,53 * * * admin/xmlclient.php3 (CSN - Item Exchange)
(it is just an example - the set of task could be changed in next release of ActionApps)
2. Start cron.php3 periodicaly from unix cron
This must be done by a system administrator (i.e. someone with root shell access), but only
has to be done once no matter how many task are sheduled then.
In order we can shedule tasks from ActionApps we
must run periodicaly the script cron.php3 (based in root apc-aa install directory). It is not
so easy to start php scripts directly from unix cron, that's why you should use aa-http-request
shell script (based in misc/ directory), which will start cron.php3 script for you.
The instructions for setup of the aa-http-request script is also inside the script. For setup
follow the nex few steps:
- For security reasons it is better to move the aa-http-request script to some
directory, where webserver don't have access to. For example to the directory
/usr/local/myscripts/aa-http-request
- Open the aa_http_request script
- Modify the HOST variable to point to your server where ActionApps are installed
Example: HOST=aa.ecn.cz
- Modify the AADIR variable to be filled by the path to root of AA instalation from
server root
Example: AADIR=/aaa (for AA installed on http://aa.ecn.cz/aaa)
- Set LYNX or PERL to absolute path of lynx or perl if you have either of them.
If neither are set, then the script will try telnet, which will not work if your
server uses virtual hosts.
Example:
LYNX=/usr/bin/lynx
PERL=/usr/bin/perl
- Save the changes and close the script
- In order to run this script from cron, it must have executable privileges
( chmod 755 aa-http-request )
- Test it, by running aa-http-request. If you have already configured some task
on AA -> Misc - Cron page (you probably have), then check if 'last_run' column
is changed for sheduled tasks
- Set the crontab so the script is started each 15 minutes e.g.
crontab -e
and put the line pointing at the aa-http-request:
1,16,31,46 * * * * /usr/local/myscripts/aa-http-request > /dev/null
This FAQ interface was developed
by Jason at Commons.ca
|
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 |