|
Written by Joe
|
|
Wednesday, 25 June 2008 03:49 |
Building site with Joomla, Usefull Joomla extensions
- Automatically generated site sitemap (html & google xml sitemap) - Recommend XMap plug-in
- Forum (integrated into Joomla, use the same user management system) - Recommended FireBoard Forum plug-in
- Voting system - simple to use Joomla built-in vote Poll enough. The need for complex voting can use plug-in pollXT
- Latest News, Most Popular - Recommend mod_latestByCategoryOrSection
- Site statistics - can each day, month, year to view the site visit a few, Unique Visitor few, referrence site, visitors ip & state, etc - to use plug-in Joomla Visits
- Site document management - can joomla background upload, download, compression, delete, copy paper, etc. - to use plug-in JoomlaXplorer
- Multi-language management - can use http://xxx.com/cn/products visit of Chinese products page, of course, their need to increase the content of their translation into Chinese, can be very convenient to complete the background - the use of Joom! Fish inserted Pieces
- Contact us - an online e-mail to you the plug-in - the use of Joomla enough built-in plug-in
- Web Links - can be used to manage Links - the use of Joomla enough built-in plug-in
- Joomla Watch - from the current background check those pages visitors are here (also know that the user visit the website of the track) - the use of plug-in JoomaWatch
- User-friendly (search engine friendly SEF) URL - joomla system because it is difficult to see the url, sh404SEF plug-ins can change this situation, you can also customize the page url
- Background Editor - used to edit the contents of the article WYSIWYG editor - recommended JCE plug-in
- Database backup - very necessary, the daily Joomla database backup e-mail sent to you in - the use of Jombackup daily mysql backup bot plug-in
- Keyword, title Optimization - According to the article content can be automatically generated SEO keywords and title, for certain words you can set weight - using j oomSEO plug-in
These are my own Web site to use the function, the following are not used, but a very useful function:
- Communities - into Joomla, the use of a user management system with the community, - the use of Community Builder plug-in
- E-commerce - similar to shopping on the Internet - using plug-in VirtueMart
- Blog - Blog - recommended Blogg-X plug-in
- Google Ads - a plug-google ads on the website if you have google ads, you need it--MultiAds
- Download (documentation) management - If your site has a lot of things to download (for instance, Affiliate site) strongly recommended the use of plug-in DOCman
- Ticket System - can be used to support or bug report system - currently the only one free plug-in - WebAmoeba Ticket Systemc plug-in, it is not very strong, but can be used
|
|
Written by Joe
|
|
Wednesday, 25 June 2008 03:20 |
|
I have been using Joomla! 1.5 over half an year now.
To select the extensions that most suitable for me,I had digged Joomla! Extensions directory page by page,
and tried the extensions each by each. After done that, I select top 10 extensions that I like most.
I hope the list can do help to you too.
-
Xmap
Xmap is a component based on the popular Joomap component. Xmap
allows you to create a map of your site using the structure of your
menus. This component adds new powerful options to Joomap and fixes
several bugs reported by many users of Joomap.
Get it here
-
MultiAds
This plugin allows you insert at most four area(Google adsense, other ads, even any html code) into different area of the article.
You can dispay your ads in any of the following areas:
1.Before the content, that is between the title and the content.
2.At the top of the content.
3.At the bottom of the content.
4.After all content has been shown.
Get it here
Smartsef
Smartsef BETA 1.0 is out. The smartsef component is an url rewriting component for Joomla 1.5. With Smartsef you can turn Joomla 1.5 into real SEF url's without numbers or other logic within the URL's. Smartsef gives you full control over the Joomla 1.5. generated URLs and the order how they must displayed.
Get it here
SectionEx
SectionEx (com_sectionex) will list all articles within a section, grouped by categories. It combines and extends Joomla!'s build in "Section Layout" and "Category List Layout".
SectionEx is written for Joomla! 1.5 using its model-view-controller architecture.
Get it here
-
Phoca Gallery with Slideshow
Phoca Gallery is a Joomla! component. It is a simple image gallery with slideshow. The slideshow is based on Dynamic Drive's Ultimate Fade-In Slideshow v1.51 (http://www.dynamicdrive.com/ ).
Requirements:
* Joomla!1.5 (stable or any later version)
* PHP 4.4.1 (or any later version) with GD library (graphics library for thumbnails creation).
Get it here
-
mod_latestByCategoryOrSection
If the current menu using com_content, this mod will display latestly Contents of the category or section selected by the menu.
For frontpage and some other cases(the active is not using com_content), it will display the latest contents just as mod_latest does.It works properly in Joomla 1.5 version natively
Get it here
-
Missing Metadata module
The Missing Metadata module adds a panel to the Control Panel of the Joomla Administrator interface that lists any published articles that have empty metadescription or metakeys fields. Search engines (particularly Google) use the metadescription text as the summary text for site-listings displayed in search results. Any articles that fails to include this metadata will suffer in their web presence and search engine ranking. After installation, be sure to active the module in the Module Manager > Administrator modules pane and set the position to CPanel so the module will appear properly.
Get it here
-
Linkr Extension for linking articles
This extension lets you quickly link to articles in your Joomla! site when you are creating content. You can either search for your article with the search box, or find it by selecting the section and category. Finally, the link class, title, rel and url are completely customizable, making Linkr the perfect linking extension for Joomla!
Get it here
-
Content static
Do you want your Joomla site much faster and more scalable?
You can just make your site static with Content static plugin.
After making the article content static, you will never need a lot of SQL to load a page from the database, load a lot of module's and plugins.
You can just access the static page with the url.
The plugin will generate the static content when the user first access the article, from then on, it will have nothing to with Joomla, it just like a static html web.
Get it here
Attachments for content articles
The 'Attachments' extension for Joomla! allows files to be uploaded and attached to content articles. 'Attachments' includes a plugin to display attachments at the end of articles and a component for uploading and managing attachments. There are options to control who can see the attachments and who can upload them, along with many other options to increase its flexibility and usefulness. To install 'Attachments', unzip the download file and install the two plugins and the component.
Get it here
|
|
Written by Joe
|
|
Monday, 23 June 2008 03:11 |
|
Apache DBCP(Database Connection Pools) provides an easy way to
access the database with connection pools. Here is a simple dbcp wrap.
You can use it to get a database connection.
To make the following code run, you need commons-dbcp.jar,commons-logging.jar in class path.
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import org.apache.commons.dbcp.ConnectionFactory;
import org.apache.commons.dbcp.DriverManagerConnectionFactory;
import org.apache.commons.dbcp.PoolableConnectionFactory;
import org.apache.commons.dbcp.PoolingDataSource;
import org.apache.commons.pool.ObjectPool;
import org.apache.commons.pool.impl.GenericObjectPool;
public class ConnectionProvider {
public static void main(String[] args) throws Exception {
ConnectionProvider provider = new ConnectionProvider(
"com.mysql.jdbc.Driver", "jdbc:mysql://localhost/elsak",
"elsak", "password");
Connection conn = provider.connection();
System.out.println(conn);
close(conn);
}
private PoolingDataSource dataSource = null;
public ConnectionProvider(String driver, String url, String user,
String password) {
try {
Class.forName(driver);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
dataSource = setupDataSource(url, user, password);
}
public synchronized Connection connection() {
try {
return dataSource.getConnection();
} catch (SQLException e) {
e.printStackTrace();
return null;
}
}
public static void close(Connection con) {
try {
con.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
public static void close(ResultSet rs) {
try {
if (rs != null) {
rs.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
public static void close(ResultSet rs, Statement stmt) {
try {
if (rs != null) {
rs.close();
}
} catch (SQLException e) {
}
try {
if (stmt != null) {
stmt.close();
}
} catch (Exception ex) {
}
}
public static void close(Statement stmt) {
try {
if (stmt != null) {
stmt.close();
}
} catch (Exception ex) {
}
}
private PoolingDataSource setupDataSource(String connectURI, String user,
String password) {
//
// First, we'll need a ObjectPool that serves as the
// actual pool of connections.
//
// We'll use a GenericObjectPool instance, although
// any ObjectPool implementation will suffice.
//
GenericObjectPool.Config config = new GenericObjectPool.Config();
config.maxActive = 150;
config.maxIdle = 100;
config.minIdle = 30;
config.maxWait = 1000;
ObjectPool connectionPool = new GenericObjectPool(null, config);
//
// Next, we'll create a ConnectionFactory that the
// pool will use to create Connections.
// We'll use the DriverManagerConnectionFactory,
// using the connect string passed in the command line
// arguments.
//
// Properties p = new Properties();
// p.setProperty("user", SQLConstants.USER_NAME);
// p.setProperty("password", SQLConstants.PASSWORD);
// p.setProperty("useUnicode", "true");
// p.setProperty("characterEncoding", "UTF-8");
ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(
connectURI, user, password);
// ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(
// connectURI, p);
//
// Now we'll create the PoolableConnectionFactory, which wraps
// the "real" Connections created by the ConnectionFactory with
// the classes that implement the pooling functionality.
//
PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(
connectionFactory, connectionPool, null, null, false, true);
//
// Finally, we create the PoolingDriver itself,
// passing in the object pool we created.
//
PoolingDataSource poolingDataSource = new PoolingDataSource(connectionPool);
return poolingDataSource;
}
}
|
|
Written by Joe
|
|
Monday, 23 June 2008 02:33 |
|
The httpclient is a great help to write http client programs. The following code is a demo of how to use httpclient.
With HttpClientHelper, you can easily download html,image,flash,pdf ect. HttpClientHelper also helps you do some form submit.
package base.helper;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
public class HttpClientHelper {
private HttpClient client = null;
private String baseUrl;
private String encoder;
public HttpClientHelper(String baseUrl, String encoder) {
createClient();
this.baseUrl = baseUrl;
this.encoder = encoder;
}
private void createClient() {
System.getProperties().setProperty("httpclient.useragent",
"Mozilla/4.0");
client = new HttpClient(new MultiThreadedHttpConnectionManager());
}
/**
* Download the url as html String
*
* @param url
* the url to be download.
* @return
*/
public String html(String url) {
url = MiscHelper.toAbsoluteUrl(this.baseUrl, url);
GetMethod get = new GetMethod(url);
get.setRequestHeader("User-Agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows 2000)");
get.setFollowRedirects(true);
try {
client.executeMethod(get);
return MiscHelper.method(get, this.encoder);
} catch (Exception e) {
createClient();
e.printStackTrace();
} finally {
get.releaseConnection();
}
return null;
}
/**
* Download the url conent and save into the file. It can use to download
* images,pdf,flash etc.
*
* @param url
* @param file
* @return
*/
public boolean file(String url, File file) {
url = MiscHelper.toAbsoluteUrl(this.baseUrl, url);
GetMethod get = new GetMethod(url);
get.setRequestHeader("User-Agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows 2000)");
get.setFollowRedirects(true);
boolean result = true;
try {
client.executeMethod(get);
InputStream in = get.getResponseBodyAsStream();
FileOutputStream out = new FileOutputStream(file);
byte[] buffer = new byte[1024];
int count = -1;
while ((count = in.read(buffer)) != -1) {
out.write(buffer, 0, count);
}
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
createClient();
result = false;
} finally {
get.releaseConnection();
}
return result;
}
public boolean file(String url) {
int i = url.lastIndexOf('/');
String fileName = url.substring(i + 1);
return file(url, new File(fileName));
}
/**
* Submit the form to the url.
* @param url
* @param params
* @return
* @throws HttpException
* @throws IOException
*/
public String postForm(String url, List params)
throws HttpException, IOException {
url = MiscHelper.toAbsoluteUrl(this.baseUrl, url);
PostMethod authpost = new UTF8PostMethod(url);
authpost.setRequestHeader("ContentType",
"application/x-www-form-urlencoded;charset=UTF-8");
// authpost.addRequestHeader("Content-Type","Content-Type: text/html;
// charset=utf-8");
// Prepare login parameters
NameValuePair[] postParams = new NameValuePair[params.size()];
params.toArray(postParams);
authpost.setRequestBody(postParams);
client.executeMethod(authpost);
authpost.releaseConnection();
int statuscode = authpost.getStatusCode();
if ((statuscode == HttpStatus.SC_MOVED_TEMPORARILY)
|| (statuscode == HttpStatus.SC_MOVED_PERMANENTLY)
|| (statuscode == HttpStatus.SC_SEE_OTHER)
|| (statuscode == HttpStatus.SC_TEMPORARY_REDIRECT)) {
Header header = authpost.getResponseHeader("location");
if (header != null) {
String newuri = header.getValue();
if ((newuri == null) || (newuri.equals(""))) {
newuri = "/";
}
return newuri;
}
}
return null;
}
public static class UTF8PostMethod extends PostMethod {
public UTF8PostMethod(String url) {
super(url);
}
@Override
public String getRequestCharSet() {
// return super.getRequestCharSet();
return "UTF-8";
}
}
}
|
|
|