APC Action Applications - Home Page

Frequently Asked Questions v2

 

Topic:

0. How to import big exported slice&data?
1. ERROR: "No slice found for you" - I lost me installation ID ("AA_ID" in config.php3)
2. MultiLingual eXtension for ActionApps / How to setup ActionApps for multilingual web sites
3. How do I update my APC-AA installation to the latest version?
4. Error: Access denied for user: 'aadbuser@xxxx'
5. What are the hosting requirements for APC-AA?

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

If you get the error: "No slice found for you" after logging into AA after doing a CVS update, then you may have forgotten to fill in the AA_ID in the config.php3 file

If you were a loser (like I have been) and did back-up your AA_ID, it can be retrieved from the AA database...

Using phpMyAdmin or your excellent MySQL skills:
Look for entries in "perms" table that have aa in "object_type" column, "objectid" is your installation ID.

MLX - MultiLingual eXtension for APC-ActionApps

 

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

  1. Create a new slice based on News Template and call it MLX Control Slice.
  2. Delete all deleteable fields from this slice.
  3. Add two new fields. Call one EN, the other one FR and choose type MLX Control for them.
  4. Unshow all other fields apart from these two. Have a look at MLX Screenshots to see what this should look like.
  5. Create a new slice. This one will hold the actual content (Content Slice). It can be any kind of slice.
  6. In Slice Settings select the MLX Control Slice you created before. Again, MLX Screenshots are your friend.
  7. Check that the slice contains a lang_code....... field.
  8. 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.
  9. 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:

  1. 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.
  2. 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)
  3. 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

  1. 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)

This FAQ assumes you did the original installation from CVS (see Installation of ActionApps Doc )

First, check that you really want to update. There is usually a stable release and a developer release. The instructions below will update to the latest release from CVS - which is what most of the people discussing things on the apc-aa-general mailing list are using. This might not be as stable as a release you may be running.

Back-up Your Files and DB

The CVS will write over your current config file, usually located in /apc-aa/includes/config.php3. The key values you will need to re-enter after updating and may not be able to remember are: AA_ID, DB_HOST, DB_NAME, DB_USER, DB_PASSWORD. Without these correct values, AA will not work.

You should also back-up all your apc-aa files, encase the update fails and you need revert back.

Once you have done your back-ups, login to shell on you account and cd to the apc-aa directory and run

cvs -n update

This will display the changes and potential conflict - look for lines starting "C" these are conflicts that need a developer to figure out. You'll have to ask this list if you get one of these.

NOTE: It is common to get 'timed out' type errors from the CVS, which is hosted at SourceForge.net. Just keep trying every few minutes

If it all looks good, run

CVS update -dPAC

This will:
-d Build directories, like checkout does. (if there is new directory in the repository, then it is created)
-P Prune empty directories.
-A Reset any sticky tags/date/kopts. (allways load HEAD branch of the CVS)
-C Overwrite locally modified files with clean repository copies.
(For more options try "cvs --help update")

You should then compare the version number at the top of /apc-aa/includes/config.php3 to see if it is newer then your backed up config.php3 file. If not, you can simplly upload your backed-up version over the new one. If the new config file is different, you will need to manually write in your settings, based on the backed-up version.

Access http://yourhost/apc-aa/sql_update.php3, this will update the database to the latest version. The script always refreshes the database structure to the newest version - no matter if you allready have the newest structure.

The script makes a backup of the tables, but there is not yet a documented way to restore the old version, and note that re-running the script overwrites the last copy of the backup.

Warning: Access denied for user: 'aadbuser@xxxxx' (Using password: YES) in /usr/local/web/phplib/db_mysql.inc on line 73 Database error: pconnect(xanadu.cyborganic.org, aa-user, $Password) failed. MySQL Error: 0 () Please contact foobar@somewhere.com and report the exact error message. Session halted.

Typically this means that the DB_HOST, DB_USER, DB_PASSWORD, DB_NAME setup during editing config.php3 in Install 4.1 don't match the one you gave permissions to in Install4.2. In particular note that if the DB_HOST is absolute e.g. "aa.apc.org" then the permissions are going to have to include the machine name that the Apache server runs on e.g. aadb@bigserver

Requirements for ActionApps Unix Hosting

Optional:

Please add your comments below about AA installs that have and have not worked for you...

 

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