Tuesday, March 31, 2009

Pasting Text From Word


Word to CMS

One issue with content management systems is that desktop computer users in organizations tend to have their information stored in the proprietary microsoft word format. Word is notorious for producing obtuse and convoluted HTML that does not play well with others.

The problem with a cms occurs when the desktop user opens Word and copies the text into the cms editor and publishes to the web site. Later they are shocked to see that the formatting has changed.

We decide to do a test of the default TinyMCE joomla editor and the JCE editor extension using a simple word document and one with a heavily formatted complex table with colors and other stuff. Tables are one of the hardest things to convert.

Installing JCE

First we have to install JCE. Off to http://www.joomlacontenteditor.net/downloads where we need 3 parts - the editor extension and 2 plugins for the editor. Here are the task for this bit:
  1. Click Administrative Component
  2. Select com_jce_152.zip
  3. Click back arrow
  4. Click Editor Plugin
  5. Select plg_jce_152.zip
  6. Click back button
  7. Select JCE Utilities
  8. Click Joomla 1.5.x
  9. Select plg_jceutilkities_217.zip
Now that we have the files all downloaded it's time to install. Before doing this you have to edit the php.ini file in the \xampp\apache\bin folder to increase the timeout setting. I changed mine to:

max_execution_time = 480

and saved the file. Now you can run XAMPP and start up Joomla. The reason for the change is that the JCE scripts timeout when running on a USB stick. I timed the plugin install at almost 8 minutes! Next we need to install the extension and plug-ins for JCE.

Installing JCE
  1. Select Extensions, Install/Uninstall
  2. Browse to com_jce_152.zip
  3. Click Upload File and Install
  4. Select Extensions, Install/Uninstall
  5. Browse to plg_jceutilkities_217.zip
  6. Click Upload File and Install
The install works but displays an error message:

Unable to add Article Breaks plugin to Plugins table

This is because the Article Breaks plugin is already installed from our previous JCE install attempt. You can confirm this by looking at thedatabase, there is a row for the Article Breaks plugin in the jos_jce_plugins mySQL table. However, this does not stop the editor from working so you can ignore the error.

We then tried to install the editor plug-in plg_jce_152.zip and it returned the following error:

JInstaller::install: There is already a folder called 'F:\xampp\htdocs\joomla\plugins\editors\jce.php'. Please initially check whether:

This was because the previous installation attempt had whitescreened (timed-out) and so the file jce.php already existed.

The solution was to delete jce.php from the xampp\htdocs\joomla\plugins\editors folder and run the install again. This time it worked.

Configure the Joomla Editor

Select Site, Global Configuration Manager
Select Editor - JCE 1.5.2 from the Default WYSIWYG dropdown menu
Click SAVE

Now you have access to the JCE editor which has lots of little icons. Designers should read William Horton's Icon Book. too many applications have icons with no readily discernable meaning. Anyway now it is time for the word paste test.

Pasting From Word

The test consists of opening files in Word, copying the formatted text with CTRL C and pasting it to the joomla editor with CTRL V, Saving the article and previewing it in the user view. No editing or changes are permitted in the cms editor.

We open the simple word file and copy and paste to the default and JCE editors with no problem. All formatting is preserved so let's move on to the complex word document.

We paste into the default editor. It preserves the table, the colors, borders etc but changes the format of the header.

We try JCE using the Paste From Word function which opens a small window into which you can paste your copied word text.

The result is disappointing - the header is ok with some small changes, but the table has lost all the color! Does this mean JCE is worse that the default TinyMCE editor?

We decide to just paste in the word text without using the 'Paste From Word' function. To our amazement it works perfectly - all the table is there, complete with colors and the heading formatting is exactly the same as the word document - no need to mess about.

Conclusion

Obviously, more testing is required before coming to any conclusion but the test does indicate that word to joomla may not be a problem. If I was doing this i would create a test suite of documents submitted by users based on their most commonly used files and their most complex files and run them through the JCE editor and show the results to the users.

------------------------------------------------------------------------

Note that if you already have JCE installed you will get an error message:

* Component Install: Another Component is already using directory: "G:\xampp\htdocs\joomla\components\com_jce" * Component Install: Another Component is already using directory: "G:\xampp\htdocs\joomla\administrator\components\com_jce"

The solution is to remove the old extension before installing the new.

To Remove an Extension
  1. Select Extensions, Install/Uninstall
  2. Click Components, Modules, Plugins, Languages, or Templates to find your extension
  3. Select the extension
  4. Click the Uninstall button.

Friday, March 27, 2009

LIS 9710 Posts

Posts from 9710



Just to keep everything in the one place and because we won't use the other thing again.

Portable Apps for Mac



The portable apps environment we have been using in class is only for windows but FreeSMUG (the free software mac users group) page now has a portable apps environment and downloads for osx.



The page is at: http://www.freesmug.org/portableapps



Most of the applications are the same open source ones such as Audacity, Firefox, VLC etc - which is good because you can have cross-platform coverage. However, there are some very interesting appz like:



Cletx - http://celtx.com/overview.html is media pre-production software for the entire pre-production process - write scripts, storyboard scenes and sequences, develop characters, breakdown & tag elements, schedule production etc.

as well as the mac only appz like ical and ichat.



Installing Drupal on Ubuntu - part 1



In the past installing drupal was very difficult as you had to install apache, php,mysql separately and set them up and then install drupal.



I just found out in ubuntu 8.10 there is an entry for Drupal5 in the synaptic package manager. So with the shiny new frankencomputer i decided to give it a whirl.

I selected the package and it install LAMP (minus phpmyadmin, i think) and asks a couple of questions such as setting up a mysql root password etc.



It does not seem to create a menu item or link anywhere. There is an index.html file created in var\www which can be viewed from http://127.0.0.1 to prove LAMP is running but where is the drupal admin page located?

looks like /usr/share where apache2 is, which has a folder called default-site with the index.html ‘it works’ page.

the user/share/drupal5 folder has the index.php page and the install.php page.

Do we have to set up a virtual directory in apache to tell it to use this? Time to RTFM i guess…This is probably why we ended up using Joomla.

XAMPP Tutorial NotesJanuary 20, 2009

Installing Configuring and Developing With XAMPP



NOTE: The article says to start and stop processes by running start and stop.bat files, this is for installed versions. Since we are using XAMPP as a portable application do not use those files to start and stop the servers. Use the XAMPP control panel.



PHP Hello World



PHP is the programming language in LAMP. We will write a small program as an example using Notepad.





Note that php code begins with a bracket and p plus a question mark and lines of php code end with a semi-colon and the php code ends with a ?> and that the file must have a .php extension.



Only files with .php are executed, files with .htm or .html are ignored and passed straight to the web server for sending to the user’s browser.



Save the file with a filename of helloworld.php to your USB stick in the xampp\htdocs folder.



Create a Database and Insert Data



Click the back arrow of your web browser to return to the XAMPP screen



Under Tools, click phpMyadmin



Type in addressbook as the database and click CREATE



Type colleague as the table name with 5 fields and click GO



When creating the id field select the radio button under the primary key icon



When alll 5 fields are defined click SAVE (we might decide to make email or phone allow null values)



NOTE: this page shows you the actual SQL used to create the table. Copy this code to your session log or diary that you are keeping in Notepad.



It also has a create PHP code button that will provide the code to create the table from PHP.Copy the PHP code to your notepad session log/diary.



Click on the INSERT menu item at the top of the page.



Select Restart Insertion and select 5 Rows from the dropdown menu



Add the data as shown in the handout by clicking on the text box in the Value column.



DO NOT add a value for the primary key as this has been set to autonumber.



Entering data into mySQL with myPHPadmin



Once the data for the 5 records has been typed in click the GO button on the bottom of the page to insert all 5 records.



Copy the SQL statement into your diary in notepad.



Note that how the first field inserted is just the name of the field with



no specified value - the database will automatically assign id numbers for each record. You might also want to click CREATE PHP code and copy that code to your diary.



Click the BROWSE menu item at the top of the screen to see the data in the database. Note the id numbers.



Write the PHP program



Switch over to Notepad and create a new document and type the code:



// connect and select a database


mysql_connect(”localhost”,”root”,”");

mysql_select_db(”addressbook”);

// Run a Query

$result = mysql_query(”SELECT * FROM colleague”);


mysql_connect connects the web server to the database and requires a host address, username, and password(our mysql database does not have a password yet - it is blank thus the “”)mysql_select_db selects a database and requres a database name (a database server can have many databases) mysql_query sends a SQL statement to the database server and returns a result.

We are also using a variable called $result to hold the results of the query. Variables in PHP are indicated by a dollar sign $. A variable is a container that can hold anything we want (sort of like tupperware!).



Home PC Kills Apache - Skype is the culprit

January 29, 2009

Some students have reported that the XAMPP control panel runs apache and mysql but then the servers quit.

As it turns out this is due to a decision by Skype to use PORT 80 as a secondary PORT for communicating with their Main Server. Port 80 of course is the standard port for web traffic and so Skype and Apache collide.

There are a number of possible solutions:

Start Skype, selecting TOOLS, OPTIONS, Connections and un-check the use of PORT 80 as an alternative port for incoming calls. Then close and re-open Skype. XAMPP should now run.

The second solution is to change the port on which Apache operates. In a related post we detailed how to edit the httpd.conf file for Apache to can tell Apache to “listen”only on 127.0.0.1 and the same approach can be done to get apache to listen on another port. Change the Listen line from using 80 to 8080 and then restart Apache after saving the configuration file. The only problem with this is instead of typing in the regular http://localhost/ as the address, you’ll have to type in http://localhost:8080/

Some have asked what is a port? We will cover in class next week but you might want to see:

http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

If you are using VISTA you probably have worse problems. You might try this video:

http://www.youtube.com/watch?v=owVu-ZpLrZc

Changing Apache to only use Localhost

February 4, 2009

Some windows configurations will block XAMPP, specifically the Apache web server on port 80. Most people use hardware firewalls on their routers instead of the windows firewall but if you have windows security problems the following may help:

You can change the Apache web server so that it is ‘bound’ only to the loopback network interface known as localhost which has an IP address of 127.0.0.1

To do this:

  1. Insert your XAMPP usb stick
  2. Goto the xampp\apache\conf folder
  3. Select the httpd.conf file and right-click
  4. Select Copy from the menu
  5. Select Edit, Paste or press CTRL C to make a backup copy of the Apache configuration file
  6. Now select httpd.conf, right-click and choose Edit from the menu
  7. Scroll down the file and find the Listen section, which looks like this:

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the
# directive.

Find the line with Listen 80 and put a # in front of it to turn it into a comment. Type in a new line:

Listen 127.0.0.1:80

and select File, Save from the menu. This means the Apache web server will only listen for requests coming from localhost, the machine you are on - not for requests coming over the network or internet. This is how it should be for a development environment. We were going to cover this in the session on security but it might help those who are having trouble running XAMPP under specific windows setups.


Home PC Kills Apache - Skype is the culprit

January 29, 2009

Some students have reported that the XAMPP control panel runs apache and mysql but then the servers quit.

As it turns out this is due to a decision by Skype to use PORT 80 as a secondary PORT for communicating with their Main Server. Port 80 of course is the standard port for web traffic and so Skype and Apache collide.

There are a number of possible solutions:

Start Skype, selecting TOOLS, OPTIONS, Connections and un-check the use of PORT 80 as an alternative port for incoming calls. Then close and re-open Skype. XAMPP should now run.

The second solution is to change the port on which Apache operates. In a related post we detailed how to edit the httpd.conf file for Apache to can tell Apache to “listen”only on 127.0.0.1 and the same approach can be done to get apache to listen on another port. Change the Listen line from using 80 to 8080 and then restart Apache after saving the configuration file. The only problem with this is instead of typing in the regular http://localhost/ as the address, you’ll have to type in http://localhost:8080/

Some have asked what is a port? We will cover in class next week but you might want to see:

http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers


XAMPP and PHP Sessions

February 27, 2009

We assign a php session variable with:

$_SESSION['UserID'] = $Username;

and later check it with:

if (isset($_SESSION['UserID']))

but it does not work. We check it out with echo but it is always empty. This is odd as the same code works perfectly on the web server running WAMP.

The WAMP server is php4 and the XAMPP usb stick is PHP 5. Maybe we should add:

session_write_close();

To the program.

The other possibility is that windows security is to blame - this morning after another reboot for an update the trend anti-virus software quarantined the ATI control panel as it is a risk as well as the Snagit screen capture software. Soon you won’t be able to run any applications on windows…

Found a post where the user edited php.ini and changed line #839 from:

;session.save_path = /tmp

to

session.save_path = /tmp

save and restart php. I don’t think that is the problem as i checked the xampp\tmp directory and found the session file. It has the correct contents:

UserID|s:1:”5″;

so why is the code not working?

Tuesday, March 24, 2009

Joomla Drive Letters on a USB

Joomla and Hard-Coded Drive Letters

We have been using USB sticks running XAMPP which have worked well. Now that we installed joomla we note that the global configuration and joomlapack use absolute paths that include drive letters.

This poses a problem in that the drive letter on a pc can range from D: on machines with no optical to E or F: if the optical is listed as 2 drives to J: on my home machine. In fact, i plugged into the same machine after lunch and the assigned letter is now G: instead of the F: it was before lunch!

The ultimate solution would be relative paths based on xampp as the top level directory. We need to investigate this option!

So now we have the perfect test case - the xampp stick has been assigned G: instead of F: so let's see what happens.

We select Site, Global Configuration and note the settings:

F:\xampp\htdocs\joomla\logs
F:\xampp\htdocs\joomla\tmp

Our thesis is that installing an extension should fail. Let's test it out with a calendar events module.

Select Extensions, Install/Uninstall
Browse to mod_events_cal_1.4.2-1.zip and click Install
As expected we get this error:
  • JFolder::create: Infinite loop detected
  • Warning! Failed to move file.
Now let's change the global configuration to use the G: drive letter currently assigned by windows.

Off to Site, Global Configuration and note the settings:

F:\xampp\htdocs\joomla\logs
F:\xampp\htdocs\joomla\tmp

Click Save and now we try to install the same extension. Unfortunately we get:
Your Extension appears to be written for an older version of Joomla!. You must enable the System - Legacy Plugin in the Plugin Manager if you wish to complete this task.
Makes you wonder is some that list themselves as 1.5 versions are really not. So let's try another. We try com_avreloaded-1.2.4.zip and this time the script executes. It's a big sucker and i'm worried about it exceeding the 240 seconds max time. Success!
  • SubInstall: Successfully installed plugin " AllVideos Reloaded Plugin ".
  • SubInstall: Successfully installed plugin " AllVideos Reloaded Editor Button ".
  • SubInstall: Successfully installed plugin " AllVideos Reloaded System Plugin ".
  • SubInstall: Successfully installed module " AllVideos Reloaded Module ".
  • Install Component Success
This extension provides a nice quickstart intro text after it installs:

Before inserting local media, first use Joomla's media manager to create two folders named audio and videos in your images/stories folder. Then, use Joomla's media manager to upload your media there. If this does not work initially, you might have to change Joomla's global settings in order to allow upload of other files than just images.

While editing your content, use the new AVR Media button at the bottom of the editor window for inserting media. To embed remote videos from a video sharing site, in the dialog that opens, simply paste the URL of the page displaying the video into the first field, then hit RETURN to start the auto-recognition. If the URL is supported, the rest of the form will be completed automatically. The last field shows the media tag, which can be edited to add custom attributes. Finally, hit the Insert button and the content of this field will be inserted at the current cursor position in the editor.

To insert local media, use the same AVR Media button, but select the Local Media tab. There, you can select one of the previously uploaded media files. After selection of a media file, the rest of the fields should be filled automatically.

For more information - especially before using the advanced features of the component views -, please read the included documentation. Even though AllVideos Reloaded is trying hard to make it easy for you, embedding multi media is a complex matter. For getting the most out of your media, reading documentation is a must. You can invoke the documentation at any time in the plugin description of the Content - AllVideos Reloaded plugin or by clicking the Help button in one of the AllVideos Reloaded component views.
The Demo site provides a collection of useful examples too.

Ok - we have proved that the common 'infinite loop' extensions problem is a path issue and that the drive letter can be changed ok as you move from pc to pc with your gpysy web server.

Let's try another - the google maps module which is also big but it errors with:
Your Extension appears to be written for an older version of Joomla!. You must enable the System - Legacy Plugin in the Plugin Manager if you wish to complete this task.
Actually, this illustrates one of the problems of extensible designs common with open-source programs. While they spur innovation by lessing the barriers to new functionality, they inhibit upgrading to new versions as upgrades may break useful or essential 3rd party modules. You cannot guarantee all 3rd party modules will run in the new version without doing an install of the new version and testing and in fact, some modules will never run with newer versions as the authors may not update them. The joomla project team recognizes this paradox by providing a 'legacy mode' for older 3rd party modules - which i have not tested yet.

One last test - can we delete the drive letter and have just a directory path? Let's try it out.

Select Site, Global Configuration
Change the log file and temp file paths to:

\xampp\htdocs\joomla\logs
\xampp\htdocs\joomla\tmp

and click SAVE. Let's try ContentTemplater-v0.4.4.zip. The script runs but generates this error:
It was not possible to delete the selected file.: 'nl-NL.com_nonumber-installer.ini'
but then we also get:
Content Templater (component & editor button) has been installed successfully
and it shows up in the Components menu so it worked. So drive letters can be removed after install and Joomla still functions. Woo woo!

The other thing to change is the joomlapack configuration setting as that is also hard-coded.

Select Components, Joomlapack and this error is displayed:
Detected errors prohibit intended operation
The status tab shows Output directory unwritable which makes sense as drive F: no longer exists, we are now assigned G: as a letter. Stupid drive letters, so 1980's.

Click Configuration and change the Output Directory from F:\xampp\backup to \xampp\backup and click SAVE. Success! we see the message:
JoomlaPack is ready to backup your site
This means that for everything we install we need to delete the current drive letter in the install and SAVE. We check the configuration.php file and see:

var $log_path = '\\xampp\\htdocs\\joomla\\logs';
var $tmp_path = '\\xampp\\htdocs\\joomla\\tmp';

Big Idea for Classes

This gives me an idea - one could set up a pre-defined joomla site with certain extensions installed and configured such as the editor, explorer and backup etc and then backup the site and upload the backup to the course web site. Students could then download and restore the backup so everyone would be starting from the same point. It would be possible to have multiple different backups made for different purposes such as the web programming course or the web usability course or the digital libraries course even the young adults web site evaluation assignment. In fact, if it is possible to create a USB environment and then mass duplicate it so that each student in the class gets a pre-configured stick (with the FIMS logo on it).

ToDo:

Fix Allvideos problem
Fix the JCE editor problem and test the Paste From Word function
Copy the joomla/xampp content from LIS9710 to here to preserve the record of this project

Backing up Joomla

Backup with Joomlapack

We now have the joomlapack extension installed and want to see about backing up. We select components, joomlapack which displays the control panel for the extension. Only problem is we have a warning message:

JoomlaPack is ready to backup your site, but there are potential issues

This does not appear fatal but what are the 'issues'? We look under status and see:

Default output directory in use

Since this is a hyperlink we click on the error message and it takes us to http://www.joomlapack.net/help-support-documentation/warnings/q203.html which explains:
You got to this page because JoomlaPack detected that you are using the default backup output and / or temporary directories. This page will inform you on the potential pitfalls and security concerns of the default configuration, as well as how to secure your installation.
Sweet. Nice that error messages have explanations.
The temporary directory files holds database dumps (.sql files), while the database dump step is running. They are deleted upon proceeding to the next step, if the process ends with catchable errors or when a new backup is started (if the previous backp attempt failed). If the backup fails with a PHP fatal error, these files remain in place.
Ok - so we need to change the default. JoomlaPack uses the temporary directory specified in \xampp\htdocs\joomla\configuration.php so we take a look. About the only thing like a temp directory is :

var $tmp_path = 'F:\\xampp\\htdocs\\joomla\\tmp';

There is no temp_dir variable in the file. Taking a look at the joomlapack default output directory in the configuration tab we see:

F:\xampp\htdocs\joomla\administrator\components\com_joomlapack\backup

So do we create one and set it to another folder? It would see desirable to store the site backups in a folder outside of the web root (htdocs) tree. We create a backup folder in the xampp directory. There may be some things we need to do to make this writable and accessble from Joomla but let's try it out. We set the Output Directory to:

F:\xampp\backup

One more drive letter to change when the USB Stick moves to another computer. It would be very useful to be able to specify relative paths instead of drive letters. Reading further along we see the main issue behind changing the default backup directory is one of security.

The other issue listed under the Status Details is that zip file format is selected which is the default. Clicking the link reveals the issues with .ZIP:
  • It is very disk and database intensive; on some overloaded hosts the process might fail during the archiving stage

  • A ZIP file consists of two parts: the actual file data and the Central Directory, an appendix to the archive with a list of the included files. For efficiency reasons the Central Directory is written on a separate file and the two files are "glued" together at the end of the process. On sites with a great number of files, this might cause the process to fail.

  • There are several limitation concerning the calculation of CRC checksums, a necessary step to creating ZIP archives. JoomlaPack can detect most of them and warn you, as failure to calculate correct CRC's will result in non-conforming archives requiring several workarounds to extract them. Moreover, even on newer systems, the calculation of a large file's CRC might cause the process to fail with a timeout.

Ok so we also need to change the default format of the backup to use .JPA which is the optimized joomlapack archive format. Makes you wonder why the default is set to .ZIP

We click the Configuration icon and expand the Profile Settings, Advanced and set the Archiver Engine to JPA JoomlaPack Archive.

Click SAVE. We get the green go-ahead message:

JoomlaPack is ready to backup your site

Ok, let's start the backup and go for an orange.

We're back and SUCCESS!. Backup up successfully and created a log file. We take a peek and it offers us the chance to download the log which we do as joomlapack debug log.txt and it has the right output directories. In \xampp\backup are two files, the joomlapack debug log.txt file and site-localhost-20090324-141353.jpa which is the backup.

Of course the only real test of a backup is a restore. The best test would be to restore on a clean install of joomla. The problem is - we did a clean install of joomla to solve the extensions problem so there is nothing really worth restoring. But this will be useful as students can create joomla sites and submit the backups which i then restore on a clean install to check their designs.

Friday, March 20, 2009

Joomla XAMPP extensions problem fixed

The Problem

Joomla installs on XAMPP no problem. But trying to install an extension caused any number of error messages

* JFolder::create: Infinite loop detected
* Warning! Failed to move file.

or

Fatal error: Maximum execution time of 60 seconds exceeded

or it would say done and 'whitescreen' with nothing displayed. The same downloaded extensions installed no problem on MAMP and WAMP so the issue is solely with Joomla and the setup of the XAMPP environment.

I searched the net for an answer and got found lots of conflicting advice about basedir and paths but no examples of a working setup. All of the suggested remedies failed to solve the problem so after wasting hours we finally got smart and decided to start from scratch.

We deleted our existing joomla (after backing it up). The we:
  1. Created a folder called tmp under \xampp\htdocs
  2. Created a joomla folder under xampp and extracted the 1.5.9 files to it
  3. Edited php.ini in the \xampp\apache\bin folder and made these changes:
  • LINE 239 expose_php = Off
  • LINE 247 max_execution_time = 240
  • LINE 302 display_errors = Off
Next we installed joomla and when installed deleted the installation directory. We then checked the site's global configuration for the server and system.

path to log folder F:\xampp\htdocs\joomla\logs
path to tmp folder F:\xampp\htdocs\joomla\tmp

Note that these drive letters refer to the current assigned letters on the current windows pc. When we move the stick to another machine they will change. This most likely means we have to edit the global configuration each time. The joomla gui stores all its settings in the xampp\htdocs\joomla\configuration.php file.

  1. Select extenstions, install/uninstall
  2. Click Browse and choose a downloaded extension file like com_joomlapack-2.1-free.zip
  3. Click Upload File & Install

After what seems a long time the success message is displayed and joomlapack now appears on the Components menu and is in the Extensions,Install/Uninstall,Components list.

TODO

  • Test moving USB to other computers and install extension (we assume will fail)
  • Change global configuration to match drive letter and install extensio

Monday in the lab

Drive letter assigned in GRC is F: so it should work as the global configuration is the same. Ok so let's install an extension. We try the JCE 1.51 and....

Install Component Success!

Took a bit of time - almost timed out. We have timeout set to 240 on a usb stick so maybe a longer timeout or a faster usb stick is in order!

We select Components, JCE Administration, Configuration but get the following error message:

Editor is not enabled. Please enable the editor in the Joomla! Plugin Manager.

So off to Extensions, Plug-in Manager and set the view to All. So where is JCE? I don't see it listed.

We go to Components, JCE Administration, Control Panel and see there is an INSTALL icon.
So we click it. It seems to do nothing as we still get the Editor is not enabled error message. Not very impressive. No new entry in the joomla plugin manager, there should be an entry named 'Editor JCE - 1.5.1' but there is not. A quick look around the net confirms this is a common problem but not clear solution so far.

Took a look at the global configuration under site but the JCE editor is not listed.

On the plus side we were able to download and install a template.

Thursday, March 19, 2009

Joomla - Extensions will not Install

While Joomla running on a USB stick with xampp works pretty well, we cannot install any extensions so no new modules, themes or other neat stuff. The problem is the paths for the log and tmp. They get hard-coded at installation and while you can easily change them in the global configuration settings the question is to what? And do you have to change the php basedir setting too?

The joomla documentation is vague and provides no examples of a working configuration. So we decided to install joomla on the old windows 2000 server in the basement. This runs the apple 360 laser printer - old but reliable and it will not die, and the big old 17" HP scsi scanner. It also runs an old version of LAMP that the malagasy project uses so that maintenance can be done when needed.

So we download and unpack the joomla .zip from the joomla web site. Version 1.5.9 is the latest. Actually, i forgot this server does not have phpmyadmin installed so let's just fire up WAMP on a machine and do an install there.

We create a joomla folder in c:\wamp\www and extract the Joomla_1.5.9.zip files there. We next click on the php.ini file in a text editor or at least we wait while windows finishes extracting and copying files. You get so used to osx and linux where this kind of file manager tie up never happens....Of course we can switch to notepad and open the file and set display errors=off but since we are just wanting to do this to see what the paths are we decide not to.

So we start wampserver and goto http://localhost/phpmyadmin to create the joomla database with:

CREATE DATABASE `joomla`
DEFAULT
CHARACTER SET utf8

COLLATE
utf8_unicode_ci;


Next we set create a new user called joomla for the joomla database with localhost only.

GRANT USAGE ON * . * TO 'joomla'@'localhost'
IDENTIFIED
BY '******'
WITH
MAX_QUERIES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR
0
MAX_UPDATES_PER_HOUR
0 ;


Now to set the permissions to everything for the joomla user on the joomla database on localhost.

GRANT ALL PRIVILEGES ON `joomla` . *
TO
'joomla'@'localhost'
WITH
GRANT OPTION ;


Now that the mysql bits are taken care of, time to install joomla which is a browser-based install. All we have to do is goto http://localhost/joomla and the index.php installation file runs.

We select English as the language, we note the non-fatal warning about php having display errors set to on and ignore it, carefully read the EULA, and select mysql as the database type, localhost as the host hame, joomla as the username and password and joomla as the database name. Since this is a local install and not on a remote server we do not turn on FTP. We give it a site name, our email address, a password for the admin user and load the sample data.

Now we go back to the file manager and delete the joomla/installation folder and then click on the Admin icon to get to the back-end control panel. We login as the admin user.

We select Site, Global Configuration and click on the System settings. Here are what it did:

The path to the Log Folder is: C:\wamp\www\joomla\logs so we were correct in that the installation hard-codes the path. This does make portable operation a bit difficult. It would be better IMHO if the path was relative to the web root (/joomla/logs).

The path to the temp-folder is C:\wamp\www\joomla\tmp which has the same issue as above.
We think the Joomla global configuration settings are held in the joomla/configuration.php file. So we check that and see:

var $log_path = 'C:\\wamp\\www\\joomla\\logs';
var $tmp_path = 'C:\\wamp\\www\\joomla\\tmp';

This is exactly what we need to know - the actual format of the setting in the php file. The question now is how to change that for an XAMPP install. We also note the improved format of the configuration file along with comments. This is one of the improvements in 1.5.9 over the 1.5.8 version we installed a couple of weeks ago. Raises the question on how to upgrade.

But before we do that best to test if extensions can be loaded on the wamp setup.

Testing Loading Extensions

This is the big test - on Xampp installs any extension install using Extenstions, Install/Uninstall fails with the error:

* JFolder::create: Infinite loop detected
* Warning! Failed to move file.


We believe the problem is related to the fact the install drive letter is most likely different from the current drive letter. This happens when you move your USB stick or pocket drive from windows machine to machine.

We select Extensions, Install/Uninstall
Click BROWSE
We choose a new theme we downloaded 1206321574.zip
Click Upload File & Install
Install Template Success!

So off to the template manager to see our new toy. The default template is milkyway so we change it to js_jamba which is our new template and take a preview. Very St. Patrick's day.

Ok, lets try some extensions like joomlapack 2.1 from http://www.joomlapack.net and and joomlaexplorer 1.6.3 and JCE 1.51.

Success - joomlapack installs and adds itself to the Components menu. Sweet. JCE installs successfully and adds itself to the components menu but joomlaexplorer gives a warning - older version of joomla.

Ok now we need to shut down WAMP and bring up XAMPP but before we do that let's check the settings in the xampp/joomla/condiguration.php file.

var $log_path = '\\xampp\\htdocs\\joomla\\logs';
var $tmp_path = '\\xampp\\htdocs\\joomla\\tmp';

Which is basically the same as the WAMP one that works, except we had removed the drive letter in the joomla global configuration settings. That didn't work. This raises the question of do the paths have to be hard-coded? ouch if true! but it does present a workaround - change the drive letter in the global configurations to match the drive letter assigned by windows - a pain in the butt but it can be done while a more flexible solution is found.

So let's test out our theory by changing the setting in Joomla and trying to install again.

Run Xampp and bring up joomla
Select Site, Global Configuration
Our current drive letter is J: so we add that to the Path to Temp-folder so it is now:

J:\xampp\htdocs\joomla\tmp
Click SAVE
In the System tab we change the Path to Log folder to:
J:\xampp\htdocs\joomla\logs
Click SAVE

We get the message that the global configuration details have been updated. Ok let's check the configuration.php file to be sure.

var $log_path = 'J:\\xampp\\htdocs\\joomla\\logs';
var $tmp_path = 'J:\\xampp\\htdocs\\joomla\\tmp';

Which look right. Now the big test- let's load the same template theme we did in WAMP.

Select Extensions, Install/Uninstall
Select the .zip file of the extension
Click File Upload and Install

We get an error - could not find an XML setup file in the package
We try joomlapack next. We get a timeout error - max of 60 seconds exceeded

The likely problem is that we made some changes to php.ini and other files based on postings to web sites. This may have made things worse. So we need to undo those changes or restore from the backup.

We select restore from backup so we can have some lunch...

With the previous backup restored we try again to install the template. No joy. Ok let's restore the backup before the backup. We want to go to the point before we made changes to php files. Although we commented those changes and kept notes, there were a number of them and it is just easier to restore to an original configuration.

Ok we have the backup restored. Back to install the extension. Same could not find an xml file. Try a second theme. This is better - we get an error but it says the extension is for an older version. Let's try JCE. We get a white screen on this one. Localhost seems to be running very slow. I think i'll shut the whole thing down and go from scratch. I had problems in the past with time-outs and since i went to lunch that may be a factor.

No joy here.

The next option is an upgrade from .8 to .9, right new we are running 1.5.8 (select help, system info) and there is a patch to upgrade to 1.5.9 (1.5.8 to 1.5.9 Upgrade Package) at http://www.joomla.org/download.html and patches to upgrade from other versions to 1.5.9 at http://joomlacode.org/gf/project/joomla/frs/.

The methods seems to be to unpack the files and to copy them to your joomla folder overwriting the old files. Ok so we try that and we are now at 1.5.9

Back to the extension install routine. No joy with the theme, we try joomlapack. Same 60 second time out. The other option is a clean install of joomla.

Fresh Install of Joomla

We delete the joomla directory and start again. This time we install 1.5.9 from scratch. Odd it times out - which proves our point about localhost being slow on this machine. Why? We get waiting for localhost. The device is a usb 2.0 80 gig SATA drive so it is not slow. Windows doing something stupid? We edit the registry to remove some sketchy looking stuff - god, xp is a pain of an os.

Let's try a usb stick. First we edit configuration.php so that the drive letters match, then launch joomla. This was a fresh install from yesterday it is 1.5.9 and has no changes to files.

We try to install an extension starting with the theme that worked in WAMP. We get the error about xml setup file not found. At least it was quick. We try joomlapack. Waiting for localhost. It white screens. Try JCE. Waiting for localhost and it white screens. Shut it down.

Maybe we should try another machine. Off to the laptop. What a difference - localhost is zippy - must be something on the other windows machine that slows usb connections to a crawl. Wonder if that is part of the problem in the lab the other day - anti-virus software trying to deal with that usb virus by scanning every read/write.

We try to install the extension and get the same:

'Error Could not find an XML setup file in the package'

Try another. JCE. This time we get a message:

Another component is already using directory com/jce

We see that both JCE and Joomlapack actually created folders in the joomla/administrator/components and joomla/components directories. This was from the previous aborted installs.

We delete the folders and try again. It times out after 60 seconds. Should we change php.ini to increase the max_execution_time value? Ok - why not - we change it to 120 seconds, save and restart the servers and try to install an extension again. It whitescreens. (says done as before). but of course does not show up in the components list like with WAMP.

This makes me wonder if Joomla on XAMPP can install extensions. We need to find a working example.

Apache and php.ini

One thing just occured to me - we have been editing the php.ini file in the php directory but i recall that Apache has it's own php.ini file in the xampp\apache\bin folder

This might explain why in the lab yesterday we turned off the display but joomla still reported it as on. Let's take a look at file.

Intereresting this is set to nothing.

;open_basedir =

May affect ftp mode but should not affect local installs so we leave it alone. We do change the next line from on to expose_php = Off and increase the script execution time to 2 minutes with max_execution_time = 120 and turn off error display with display_errors = Off

We see the file upload directory is set to \xampp\tmp although that is used for php session variables and not by joomla.

enough for today. Will try and find a solution tomorrow...


















Sunday, March 15, 2009

The PSP PIM


A Sony PSP personal information manager?

I got my son a Nintendo DS at christmas and I was quite impressed by the hardware so started looking at how you might use it as a non-game platform. However, the difficulty of actually getting things on the closed platform was a deterrent. But today a sony psp came by way as a trade for some computer stuff.

The psp is quite an advanced piece of hardware in a small handheld device, it is unfortunately marketed as a game console when it could be so much more. My son was fascinated by the music/movie modes while i was interested in the wifi, rss, web browsing ebook and audio book potential. I want to move pdf and html files and mp3 audio books plus training videos to use it as portable learning tool.

The controls are a bit odd - i can't get used to X being enter - enter is a positive step and X has the connotation of canceling an action.

The first thing we did was update the firmware from 3.5 to 5.03 which in retrospect may have been a mistake. Apparently sony, with their usual thickhead approach uses updates to 'brick' third party applications. Gee, way to downgrade the value of the platform. Looks like a lot of people do not upgrade for this reason. Went off to a pawn shop and tested all the psp models they had but all were version 3 firmware or higher.

Another sony stupidity - the usb port uses a mini usb connector, which is fine right? - no problem as i have a box full of such cables. Except sony uses a custom connector unlike all the others . I was fortunate to actually have one sony cable left over from the purple vaio is used to have.

The first task was to configure it for the wireless network. I added the MAC address of the psp to the access list on the wireless access point and then set up an entry for the house network on the PSP. It found the WAP and picked up an IP address with pretty good signal strength.

Another annoyance - connecting to wifi is a 2 step process - you have to select network type (infrastructure) and then a stored connection. Why can't the saved setting select the network type? or assign a default to network types. Again the default is based on an intended audience of head to head gaming.

Update - actually once you create a defined connection you can just click on that and it selects infrastructure mode for you. So that is ok.

However, running the web browser was frustrating - typing http://www.google.ca was an exercise in stupidity. And the design of the application seemed clumsly - i really missed the nintendo ds touch screen at this point. I found a program online that will convert your bookmarks to psp format. Will try that later. Anyway, when we finally seemed to get the thing going it reported a network error and could not connect. It seems to have lost the wireless network connection. Will have to troubleshoot this.

I did some poking around and found that lots of people want to read pdf and other materials on a psp but that sony makes it hard to use the device you bought for the purpose you want. It does seem there are some apps out there so will try to get them installed and report back. Also need to get a pim apps too.

Update

Well, without being able to go back to system 1.5 there is no homebrew possibility. I did play with the included sony stuff and got the web browser to work. It's a little difficult entering http:// addresses but once in, you can bookmark them. I did find a couple of annoying things, first i ram out of memory and second i could not enter an http:// address that because with an IP number of 1 such as 192.168.1.1 so i could do some router maintenance or 192.168.1.100 so i could manage the switch or the print server for that matter. The browser worked good for a while and then the device lost the wireless and disconnected itself.

Anyway, i've added a pic of the web running on a psp. The unit is a bit too heavy because of the cd drive etc, for comfortable web browsing so i ordered an Apple ipod touch to try that out.

Update:

You can transfer MP4 movie files from linux and have them work. All you need is to create a .jpg file with the same name as the movie. To convert movies to mp4 format you can use PSVC from http://pspvc.sourceforge.net. Once downloaded you have to run the setup script.

The default INSTALL DIRECTORY is /usr/local and you have to run the script as root, probably best to open a terminal window and use:

sudo ./install /usr/local

i'll install this on the weekend and test out a movie conversion.

Why don't content producers (beside iTunes) make these things available? It is a pain to have to convert every damn cd and movie you buy to the format you want, what a waste of time.

An old salesman once told me his secret, 'Don't get in the way of the customer'. The way audio and video is sold makes piracy the easier option. You can't seem to buy the product you want. I went to HMV and Best Buy on the weekend to buy some SACD and DVD-A discs for the super high end 5.1 sound system and neither one seemed to stock them and the staff had no idea what i was talking about. No wonder cd sales are in the toilet. The only place you can find quality product is on torrents...which means rogers or bell gets all the money.

Wednesday, March 4, 2009

Joomla on OSX Server

Decided to install Joomla on the mac mini running osx 10.5 to see how it goes. If successful this could be used to demonstrate to IT a solution to students having to create web sites. Right now we use a combination of coding by hand using php on LAMP, Dreamweaver static web pages on panther and god knows what else.

First let's take a look at the documentation which is the web technologies administation document. We have the Apache web server (only 1.3), although version 2 is installed in /opt/apache2, PHP and mySQL. OSX also support webdav which could be useful for student access. It also has blogs with RSS and Atom support based on Blojsom (http://wiki.blojsom.com/wiki/display/blojsom3/About+blojsom).

Configuration Notes

We start with the web server. To set one up you have to:

1. Create a folder for the website on the server
2. Create a default page in that folder (directory browsing is turned off by default- edit the apache conf file to turn it on)
3. Create a series of subfolders by class, group or student
4. Set webdav access to those folders. This involves creating a realm which sets the access priviledges for a folder. The students will need read/write access to their folder.

Access Notes
  • The apache process runs under the username of www and is a member of the www group (see Users & Groups List).
  • The www group needs read access files within a website
  • The www group needs read/write access to files within the website
  • The www user also needs access to files and folders in the WebDAV realm and to the /var/run/davlocks folder.
  • The website administrator (Owner) needs read/write access to files in the website
  • The everyone user needs to have No Access
We note the conflicting statements on page 17 of the manual about the www group. Since the www user serves web pages read access only makes sense. We shall see. I think they mean the www user needs read access to files and read/execute access to folders because you can't read a directory in a folder without execute rights.

Testing the Web Server

The webserver root is /Library/WebServer/Documents and it contains index.html
We run Safari and goto http://localhost and see the web page so that is working.

Each user has a website folder in their home directory.
We enter http://localhost/~gnickers into Safari and the bank 'Your Website' page is displayed so that is working.

Configure a WebSite

Click on the Server Admin icon
Select the Web Service (we note that Apache is in fact 2.2 - the docs are outdated)
We click the Settings tab and set the server to 50 persistent and 50 connections total. The web site now has a description, a domain and is using the /Library/WebServer/Documents folder. WE check the apache modules and see that PHP5 is checked but that DAV_Module is unchecked. We goto the Options tab and place a tickmark in:
  • Folder Listing
  • WebDav
  • Wiki
  • Blog
but remove the tick marks in webmail, webcal and mailing list. Ok let's take a look at realms.

Realms

Not that realms are enabled we see the Everyone user is there with no access. So we click to add a user. The list of Users & Groups pops up. Where is the www user and www group that is supposed to be running apache? Not listed. We drag gnickers over and make my access read/write. We drag over student and make them read only. We drag over the workgroup and make it read only. To make a test we run safari and go back to http://localhost

It asks us to login which is good and we do with the gnickers account. There are menu items for users and groups. The workgroup is listed but we can't create a wiki as it gives an error message. So we try users and the gnickers user is successful in creating a blog. We go to add a post and boom! - Safari terminates. Ok, run safari again and go back - the first post is listed but with no real text so try to post again and Safari terminates.

No good and we are only on page 22 of the manual and haven't even gotten to Joomla! yet. The differences between the manual and the software do not fill us with confidence. Wondering if the server version of OSX is overkill for what we want to do - it might be easier to use the client osx and install MAMP which we have used before and works very well. I found a short article at http://www.318.com/techjournal/?p=47 which list the steps to install joomla on osx server - there are 19 steps which is a lot more than required to install on my usb stick. Will have to think about this....

Time for Little Dorritt on TVO.