Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

How-To Tutorials - Web Development

1802 Articles
article-image-kentico-cms-5-website-development-workflow-management
Packt
07 Oct 2010
3 min read
Save for later

Kentico CMS 5 Website Development: Workflow Management

Packt
07 Oct 2010
3 min read
  Kentico CMS 5 Website Development: Beginner's Guide A clear, hands-on guide to build websites that get the most out of Kentico CMS 5's many powerful features Create websites that meet real-life requirements using example sites built with easy-to-follow steps Learn from easy-to-use examples to build a dynamic website Learn best practices to make your site more discoverable Practice your Kentico CMS skills from organizing your content to changing the site's look and feel Get going with example starter sites such as a corporate site, an e-commerce site, and a community-driven website to jumpstart your web development Written by Thom Robbins, the Web Evangelist for Kentico Software LLC Read more about this book (For more resources on CMS, see here.) Workflow management Workflow is a way to automate a business process for publishing content. Using workflow allows you to delegate portions of the business process to different users or groups for approval. Kentico CMS allows you to use workflow for all documents, including uploaded files. The workflow engine organizes the process of content creation, updates, and publishing content. The following diagram shows an example document lifecycle with workflow. It's important to keep in mind that document versioning is tightly bound with workflow and allows document comparison and version rollback. Time for action – configuring workflow The Kentico CMS workflow process is designed as a state machine. This means that workflows are event driven. A workflow contains three or more states, with only one state active at any given time. Based on an event, a transition is made to another state. Once a transition is made to the final state, the workflow is completed. Within each workflow step, members of authorized roles are allowed to modify, approve, or reject a document. Now, let's configure a workflow for the News folder. In CMS Site Manager, select the Development tab, select Workflows, and click New workflow, as shown in the following screenshot: For the New workflow, enter the Display Name as Approval and Code Name as Approval, as shown in the following screenshot: Select the Steps tab and click on the New workflow step link, as shown in the following screenshot: Quick tip The Edit, Published, and Archived steps are automatically created for every workflow and can't be deleted. These steps use the default system security. Enter the following information and select OK. Select the Roles tab and click Add roles, as shown in the following screenshot: Select the CMS Desk Administrators role and select OK. Select the Scope tab and click on the New workflow scope link, as shown in the following screenshot: What is a workflow scope? The workflow scope defines the folder, documents, and languages that are included in the workflow. In the Starting alias path, click the Select button, as shown in the following screenshot: Select News and then click the Select button, as shown in the following screenshot: Select OK, as shown in the following screenshot, to save the workflow scope.
Read more
  • 0
  • 0
  • 2461

article-image-kentico-cms-5-fundamentals-site-security
Packt
07 Oct 2010
4 min read
Save for later

Kentico CMS 5: Fundamentals of Site Security

Packt
07 Oct 2010
4 min read
  Kentico CMS 5 Website Development: Beginner's Guide A clear, hands-on guide to build websites that get the most out of Kentico CMS 5's many powerful features Create websites that meet real-life requirements using example sites built with easy-to-follow steps Learn from easy-to-use examples to build a dynamic website Learn best practices to make your site more discoverable Practice your Kentico CMS skills from organizing your content to changing the site's look and feel Get going with example starter sites such as a corporate site, an e-commerce site, and a community-driven website to jumpstart your web development Written by Thom Robbins, the Web Evangelist for Kentico Software LLC Read more about this book (For more resources on CMS, see here.) Fundamentals of site security I don't think anyone can dispute that security management is an essential part of our daily routine. We need to make sure that we protect customer data and guard the site from any unwanted intruders. Security management is the process that we use to decide who has access to the site, what areas they are able to see, and what documents they can view and interact with. Kentico CMS security is managed using the: Site Manager Administration tab to edit system-wide data CMS Desk Administration tab to edit data related to a specific website The security model that we use to maintain and administer the system is based on the following: Users — This is an individual user who is assigned a system account. Roles — Security groups that contain users. Because a user can belong to multiple roles, their permissions are calculated as a sum of all permissions granted to all roles they belong to. Document permissions — Document permissions are granted to both users and roles. At runtime, document permissions are calculated as a sum of all permissions granted to the user and their assigned roles. UI personalization — UI personalization is used to remove specific portions of the user interface. Don't forget! Security permissions are calculated at runtime. These are a combination of global settings and individual website settings. It's important to remember that if the user or any of their roles are denied access to a resource, they are always denied access to that resource, even if one of their roles is allowed access. Time for action – creating a new role Now, let's create a new role and assign it to a user using these steps: In CMS Site Manager, select the Administration tab, Roles, and New role, as shown in the following screenshot: What roles are there? Roles are one of the easiest ways to apply security to your users. The system contains a variety of pre-defined roles that are available in the Roles menu item, as shown in the previous screenshot. In the New role dialog, enter the following information and select OK. Select the Add users tab, as shown in the following screenshot: Select the user Joe Brown from the list and select OK, as shown in the following screenshot: Have a go hero – mapping roles As we just saw, the system contains a default set of pre-defined user roles that can be found in Site Manager, the Administration tab, and Roles. Spend some time studying the roles contained in the Site Manager Administration Roles and understand how they fit into your website security model. Once that is completed, put together a proposal that defines any additions or changes that may be needed. What just happened? When you clicked the New role button, you first identified the name of the role used across all system management areas. Once the role was created, you then added the user Joe Brown to the role. Time for action – adding a user to another role Users can belong to multiple roles within the system. Let's add our user Joe Brown to another role using the CMS Desk interface using these steps: Log in to CMS Desk as Global Administrator, select the Administration tab, click Users, and select the manage user roles icon ,as shown in the following screenshot: Select CMS Basic users, click the move right (>) button and select Close, as shown in the following screenshot: Select the edit user icon, as shown in the following screenshot: Select the General tab, uncheck the Is global administrator box, and select OK, as shown in the following screenshot: Why are we doing this? If Joe is a Global Administrator, he will automatically have access to all system resources. Select the Log in as this user link, as shown in the following screenshot: Select OK to change the user prompt, as shown in the following screenshot: Verify that you are logged in as the User: Joe Brown, as shown in the following screenshot:
Read more
  • 0
  • 0
  • 1339

article-image-advanced-aspects-inserting-and-deleting-data-mysql
Packt
01 Oct 2010
10 min read
Save for later

Advanced aspects of Inserting and Deleting data in MySQL

Packt
01 Oct 2010
10 min read
  MySQL Admin Cookbook 99 great recipes for mastering MySQL configuration and administration Set up MySQL to perform administrative tasks such as efficiently managing data and database schema, improving the performance of MySQL servers, and managing user credentials Deal with typical performance bottlenecks and lock-contention problems Restrict access sensibly and regain access to your database in case of loss of administrative user credentials Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible Read more about this book (For more resources on MySQL, see here.) Inserting new data and updating data if it already exists Manipulating data in a database is part of everyday work and the basic SQL means of INSERT, UPDATE, and DELETE make this a pretty straightforward, almost trivial task—but is this always true? When considering data manipulation, most of the time we think of a situation where we know the content of the database. With this information, it is usually pretty easy to find a way of changing the data the way you intend to. But what if you have to change data in circumstances where you do not know the actual database content beforehand? You might answer: "Well, then look at your data before changing it!" Unfortunately, you do not always have this option. Think of distributed installations of any software that includes a database. If you have to design an update option for this software (and the respective databases), you might easily come to a situation where you simply do not know about the actual database content. One example of a problem arising in these cases is the question of whether to insert or to update data: "Does the data in question already (partially) exist?" Let us assume a database table config that stores configuration settings. It holds key-value pairs, with name being the name (and thus the key) of the setting and value its value. This table exists in different database installations, one for every branch office of your company. Your task is to create an update package to set a uniform upper limit of 25% for the price discount that is allowed in your sales software. If no such limit has been defined yet, there is no respective entry in the config table, and you have to insert a new record. If the limit, however, has been set before (for example by the local manager), the entry does already exist, in which case you have to update it to hold the new value. While the update of a potentially existing entry does not pose a problem, an INSERT statement that violates uniqueness constraints will simply cause an error. This is, however, typically not acceptable in an automated update procedure. The following recipe will show you how to solve this problem with only one SQL command. Getting ready Besides a running MySQL server, a SQL client, and an account with appropriate user rights (INSERT, UPDATE), we need a table to update. In the earlier example, we assumed a table named sample.config with two character columns name and value. The name column is defined as the primary key: CREATE TABLE sample.config ( name VARCHAR(64) PRIMARY KEY, value VARCHAR(64)); How to do it... Connect to your database using your SQL client Execute the following command: mysql> INSERT INTO sample.config VALUES ("maxPriceDiscount","25%") ON DUPLICATE KEY UPDATE value='25%';Query OK, 1 row affected (0.05 sec) How it works... This command is easily explained because it simply does what it says: it inserts a new row in the table using the given values, as long as this does not cause a duplicate entry in either the primary key or another unique index. If a duplicate record exists, the existing row is updated according to the clauses defined after ON DUPLICATE KEY UPDATE. While it is sometimes tedious to enter some of the data and columns two times (once for the INSERT and a second time for the UPDATE), this statement allows for a lot of flexibility when it comes to the manipulation of potentially existing data. Please note that when executing the above statement, the result differs slightly with respect to the number of affected rows, depending on the actual data present in the database: When the record does not exist yet, it is inserted, which results in one affected row. But if the record is updated rather than inserted, it reports two affected rows instead, even if only one row gets updated. There's more... The INSERT INTO … ON DUPLICATE UPDATE construct does not work when there is no UNIQUE or PRIMARY KEY defined on the target table. If you have to provide the same semantics without having appropriate key definitions in place, it is recommended to use the techniques discussed in the next recipe. Inserting data based on existing database content In the previous recipe Inserting new data and updating data if it already exists, we discussed a method to either insert or update records depending on whether the records already exist in the database. A similar problem arises when you need to insert data to your database, but the data to insert depends on the data in your database. As an example, consider a situation in which you need to insert a record with a certain message into a table logMsgs, but the message itself should be different depending on the current system language that is stored in a configuration table (config). It is fairly easy to achieve a similar behavior for an UPDATE statement because this supports a WHERE clause that can be used to only perform an update if a certain precondition is met: UPDATE logMsgs SET message= CONCAT('Last update: ', NOW()) WHERE EXISTS (SELECT value FROM config WHERE name='lang' AND value = 'en');UPDATE logMsgs SET message= CONCAT('Letztes Update: ', NOW()) WHERE EXISTS (SELECT value FROM config WHERE name='lang' AND value = 'de');UPDATE logMsgs SET message= CONCAT('Actualisation derniere: ', NOW()) WHERE EXISTS (SELECT value FROM config WHERE name='lang' AND value = 'fr'); Unfortunately, this approach is not applicable to INSERT commands, as these do not support a WHERE clause. Despite this missing option, the following recipe describes a method to make INSERT statements execute only if an appropriate precondition in the database is met. Getting ready As before, we assume a database, a SQL client (mysql), and a MySQL user with sufficient privileges (INSERT and SELECT in this case). Additionally, we need a table to insert data into (here: logMsgs) and a configuration table config (please refer to the previous recipe for details). How to do it... Connect to your database using your SQL client. Execute the following SQL commands: mysql> INSERT INTO sample.logMsgs(message) -> SELECT CONCAT('Last update: ', NOW()) -> FROM sample.config WHERE name='lang' AND value='en';Query OK, 0 rows affected (0.00 sec)Records: 0 Duplicates: 0 Warnings: 0 How it works... Our goal is to have an INSERT statement take into account the present language stored in the database. The trick to do so is to use a SELECT statement as input for the INSERT. The SELECT command provides a WHERE clause, so you can use a condition that only matches for the respective language. One restriction of this solution is that you can only insert one record at a time, so the size of scripts might grow considerably if you have to insert lots of data and/or have to cover many alternatives. There's more... If you have more than just a few values to insert, it is more convenient to have the data in one place rather than distributed over several individual INSERT statements. In this case, it might make sense to consolidate the data by putting it inside a temporary table; the final INSERT statement uses this temporary table to select the appropriate data rows for insertion into the target table. The downside of this approach is that the user needs the CREATE TEMPORARY TABLES privilege, but it typically compensates with much cleaner scripts: After creating the temporary table with the first statement, we insert data into the table with the following INSERT statement. The next statement inserts the appropriate data into the target table sample.logMsgs by selecting the appropriate data from the temporary data that matches the language entry from the config table. The temporary table is then removed again. The final SELECT statement is solely for checking the results of the operation. Deleting all data from large tables Almost everyone who works with databases experiences the constant growth of the data stored in their database and it is typically well beyond the initial estimates. Because of that you often end up with rather large data sets. Another common observation is that in most databases, there are some tables that have a special tendency to grow especially big. If a table's size reaches a virtual threshold (which is hard to define, as it depends heavily on the access patterns and the data structures), it gets harder and harder to maintain and performance degradation might occur. From a certain point on, it is even difficult to get rid of data in the table again, as the sheer number of records makes deletion a pretty expensive task. This particularly holds true for storage engines with Multi-Version Concurrency Control (MVCC): if you order the database to delete data from the table, it must not be deleted right away because you might still roll back the deletion. So even while the deletion was initiated, a concurrent query on the table still has to be able to see all the records (depending on the transaction isolation level). To achieve this, the storage engine will only mark the records as deleted, but the actual deletion takes place after the operation is committed and all other transactions that access this table are closed as well. If you have to deal with large data sets, the most difficult task is to operate on the production system while other processes concurrently work on the data. In these circumstances, you have to keep the duration of your maintenance operations as low as possible in order to minimize the impact on the running system. As the deletion of data from a large table (typically starting at several millions of rows) might take quite some time, the following recipe shows a way of minimizing the duration of this operation in order to reduce side effects (like locking effects or performance degradation). Getting ready Besides a user account with appropriate privileges (DELETE), you need a sufficiently large table to delete data from. For this recipe, we will use the employees database, which is an example database available from MySQL: http://dev.mysql.com/doc/employee/en/employee.html This database provides some tables with sensible data and some pretty large tables, the largest having more than 2.8 million records. We assume that the Employees database was installed with an InnoDB storage engine enabled. To delete all rows of the largest table employees.salaries in a quick way, please read on. How to do it...
Read more
  • 0
  • 0
  • 8356

article-image-running-multiple-mysql-server-instances-parallel-linux-server
Packt
01 Oct 2010
5 min read
Save for later

Running Multiple MySQL Server Instances in Parallel on a Linux Server

Packt
01 Oct 2010
5 min read
  MySQL Admin Cookbook 99 great recipes for mastering MySQL configuration and administration Set up MySQL to perform administrative tasks such as efficiently managing data and database schema, improving the performance of MySQL servers, and managing user credentials Deal with typical performance bottlenecks and lock-contention problems Restrict access sensibly and regain access to your database in case of loss of administrative user credentials Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible Read more about this book (For more resources on MySQL, see here.) Introduction On most Linux setups, MySQL comes as a readymade installation package, making it easy to get started. It is, however, a little more complicated to run multiple instances in parallel, often a setup handy for development. This is because in contrast to Windows, MySQL is usually not installed in a self-contained directory, but most Linux distribution packages spread it across the appropriate system folders for programs, configuration files, and so on. You can, however, also install MySQL in its own directory, for example, if you need to use a version not available as a prepared package for your Linux distribution. While this gives you the greatest flexibility, as a downside you will have to take care of wiring up your MySQL server with the operating system manually. For example, you will need to hook up the startup and shutdown scripts with the appropriate facilities of your distribution. In more recent distributions, you can make use of a tool called mysqld_multi, a solution that lets you set up multiple instances of MySQL daemons with varying configurations. In this recipe, we will show you how to set up two parallel MySQL servers, listening on different TCP ports and using separate data directories for their respective databases. Getting ready This recipe is based on an Ubuntu Linux machine with the 8.04 LTS version. mysqld_multi comes with the MySQL packages for that operating system. If you are using other distributions, you need to make sure you have mysqld_multi installed to be able to follow along. Refer to your distribution's package repositories for information on which packages you need to install. You will also need an operating system user with sufficient privileges to edit the MySQL configuration file—typically /etc/mysql/my.cnf on Ubuntu—and restart services. As for AppArmor or SELinux, we assume these have been disabled before you start to simplify the process. How to do it... Locate and open the my.cnf configuration file in a text editor. Create the following two sections in the file: # mysqld_multi test, instance 1[mysqld1]server-id=10001socket=/var/run/mysqld/mysqld1.sockport=23306pid-file=/var/run/mysqld/mysqld1.piddatadir=/var/lib/mysql1log_bin=/var/log/mysql1/mysql1-bin.log# mysqld_multi test, instance 2[mysqld2]server-id=10002socket=/var/run/mysqld/mysqld2.sockport=33306pid-file=/var/run/mysqld/mysqld2.piddatadir=/var/lib/mysql2log_bin=/var/log/mysql2/mysql2-bin.log Save the configuration file. Issue the following command to verify the two sections are found by mysqld_multi: $ sudo mysqld_multi report Initialize the data directories: $ sudo mysql_install_db --user=mysql --datadir=/var/lib/mysql1$ sudo mysql_install_db --user=mysql --datadir=/var/lib/mysql2 Start both instances and verify they have been started: $ sudo mysqld_multi start 1$ sudo mysqld_multi report Connect to both instances and verify their settings: $ mysql -S /var/run/mysqld/mysql1.sockmysql> SHOW VARIABLES LIKE 'server_id'; How it works... mysqld_multi uses a single configuration file for all MySQL server instances, but inside that file each instance has its individual [mysqld] section with its specific options. mysqld_multi then takes care of launching the MySQL executable with the correct options to use the options from its corresponding section. The sections are distinguished by a positive number directly appended to the word mysqld in the section header. You can specify all the usual MySQL configuration file options in these sections, just as you would for a single instance. Make sure, however, to specify the minimum set of options as in the recipe steps previously stated, as these are required to be unique for every single instance. There's more... Some special preparation might be needed, depending on the particular operating system you are using. Turning off AppArmor / SELinux for Linux distributions If your system uses the AppArmor or SELinux security features, you will need to make sure these are either turned off while you try this out, or configured (for permanent use once your configuration has been finished) to allow access to the newly defined directories and files. See the documentation for your respective Linux distribution for more details on how to do this. Windows On Windows, running multiple server instances is usually more straightforward. MySQL is normally installed in a separate, self-contained folder. To run two or more independent server instances, you only need to install a Windows service for each of them and point them to an individual configuration file. Considering the alternative MySQL Sandbox project As an alternative to mysqld_multi you might want to have a look at MySQL Sandbox, which offers a different approach to hosting multiple independent MySQL installations on a single operating system. While mysqld_multi manages multiple configurations in a single file, MySQL Sandbox aims at completely separating MySQL installations from each other, easily allowing even several MySQL releases to run side by side. For more details, visit the project's website at http://mysqlsandbox.net Preventing invalid date values from being stored in DATE or DATETIME columns In this recipe, we will show you how to configure MySQL in a way such that invalid dates are rejected when a client attempts to store them in a DATE or DATETIME column using a combination of flags for the SQL mode setting. See the There's more... section of this recipe for some more detailed information on the server mode setting in general and on how to use it on a per-session basis. Getting ready
Read more
  • 0
  • 0
  • 10583

article-image-mysql-admin-configuring-innodb-and-installing-mysql-windows-service
Packt
01 Oct 2010
3 min read
Save for later

MySQL Admin: Configuring InnoDB and Installing MySQL as a Windows Service

Packt
01 Oct 2010
3 min read
In order to prevent the transactional nature of InnoDB from completely thwarting its performance, it implements what is called the redo log. In this recipe, we will present the relevant settings to (re-)configure a database server's redo log. Getting ready As the redo log setup is a part of the server configuration, you will need an operating system user account and sufficient rights to modify the server's configuration file. You will also need rights to restart the MySQL service because the redo log cannot be reconfigured on the fly. Moreover, an administrative MySQL user account is required to prepare the server for the shutdown, necessary as part of the procedure. Caution: As this recipe will modify the configuration of parameters critical to data integrity, you should make a backup copy of the configuration file before editing it! How to do it... Connect to the server using your administrative account. Issue the following command: mysql> SET GLOBAL innodb_fast_shutdown=0;Query OK, 0 rows affected (0.00 sec) Verify the setting like this: mysql> SHOW VARIABLES LIKE 'innodb_fast_shutdown'; Log off from MySQL and stop the MySQL server. Locate the MySQL configuration file, usually called my.cnf or my.ini (on Windows) and open it in a text editor. Locate the following parameters in the [mysqld] section (you values will vary, of course): [mysqld]...innodb_log_group_home_dir=/var/lib/mysql/redologinnodb_log_file_size=32Minnodb_log_buffer_size=64Minnodb_log_files_in_group=2... Edit the above configuration settings to their new values. If you require help on how to find suitable values, see the There's more... section of this recipe. Save the configuration file. Navigate to the directory configured for innodb_log_group_home_dir. If there is no such setting in your configuration file, navigate to MySQL's data directory that is then taken as the default. Move the files whose names start with ib_logfile to a backup location. Do not copy them; they must be removed from their original location. Restart the MySQL server. Verify that new files are created as you configured them: $ ls -l /var/lib/mysqld/redolog If you do not see the new files appear and the server does not start up correctly, check the MySQL error log for messages. Usually, the only thing that can go wrong here is that you either mistyped the directory name or did not actually remove the previous ib_logfile files. To restore everything back to the original configuration, restore your configuration file from the backup and restore the ib_logfile files you moved out to the backup to their original location. What just happened... By setting innodb_fast_shutdown to 0, you told the server to finish writing any pending changes to the disk before actually exiting. This makes sure there are no remaining transactions in the current redo logs that could get lost when these files are replaced. After that you could change the configuration to new values, possibly using a different number of files and different sizes. Then, before restarting, you could move the old redo log files out of the way. This is important because otherwise MySQL would complain about a mismatch between the settings file and the actual situation on disk. When it comes up finding no redo log files, it will create new ones with the settings just configured.
Read more
  • 0
  • 0
  • 7395

article-image-deployment-feature-alfresco-3
Packt
29 Sep 2010
3 min read
Save for later

The Deployment Feature of Alfresco 3

Packt
29 Sep 2010
3 min read
  Alfresco 3 Web Content Management Create an infrastructure to manage all your web content, and deploy it to various external production systems A complete guide to Web Content Creation and Distribution Understand the concepts and advantages of Publishing-style Web CMS Leverage a single installation to manage multiple websites Integrate Alfresco web applications with external systems Read more about this book (For more resources on Alfresco 3, see here.) Alfresco WCM staging has an autodeploy option in its default workflow, allowing end users, at the time of submit, to enforce automatic deployment of approved changes directly to the live website without having to manually initiate deployment. The Submit Items window has an Auto Deploy checkbox, as shown in the following screenshot: Upon approval, if the auto deploy option is on, the workflow will perform a deployment to those live servers that have the Include In Auto Deploy option enabled. For more details about enabling this option, refer the Configuring a web project to use FSR section in the previous article. Deploying to a test server The Test Server Deployment functionality provides in-context preview by allowing a contributor to deploy their content to an external target (either an ASR or FSR), from which it can be rendered by any web application technology that can either read from a filesystem or access an ASR via HTTP (which includes all of the major web application technologies in use today, including Java, .NET, PHP, Ruby, Python, CGI, and so on). Once a test server has been deployed to, it is allocated to the user or workflow that performed the deployment. Once the user or workflow has finished with the test server it is released and returned to the pool of test servers. This happens automatically in the case of a workflow sandbox and manually via a UI action for User Sandboxes. The following process has to be followed to use the test server: Set up a test server pool. Deploy to a test server. Preview the content. Release the test server. Setting up a test server pool The following are the steps to configure a Web Project to use an FSR. Navigate to Company Home Web Projects | <web project name>|. Select the Edit Web Project Settings from the Action menu. Click on Next to reach the Configure Deployment Servers window. Click on the Add Deployment Receiver link as shown in the following screenshot: For Type, select Test Server, specify the Display Name, Host name, and the Target Name. Click on the Add button. Similarly configure another test server, say with "cignex-test2" as the target. Ensure that the FSR is running on the test server. The targets "cignex-test1" and "cignex-test2" are configured in FSR. Deploy to a test server Let's say, you as a content manager would like to deploy your User Sandbox to the test server for testing purposes. Go to your User Sandbox and from the More Actions menu choose Deploy as shown in the following screenshot: The Deploy Sandbox window displays, listing all of the unallocated test servers as shown in the next screenshot. Select a test server to use (only one test server can be allocated to a sandbox at a time), and click on OK. The Monitor Deployment information displays once the deployment completes. If an error occurs, the reason for the error is shown under the Deployment Failed message:
Read more
  • 0
  • 0
  • 1445
Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at $19.99/month. Cancel anytime
article-image-content-delivery-alfresco-3
Packt
29 Sep 2010
11 min read
Save for later

Content Delivery in Alfresco 3

Packt
29 Sep 2010
11 min read
  Alfresco 3 Web Content Management Create an infrastructure to manage all your web content, and deploy it to various external production systems A complete guide to Web Content Creation and Distribution Understand the concepts and advantages of Publishing-style Web CMS Leverage a single installation to manage multiple websites Integrate Alfresco web applications with external systems Read more about this book (For more resources on Alfresco 3, see here.) Introduction to content delivery Alfresco provides a framework for pushing content from a stage (or authoring) server to live and test servers, as shown in the following figure: The Alfresco content production environment produces an approved view of a web project called a snapshot. Consider each snapshot as a web project version. Alfresco deployment takes a snapshot and pushes it out to either live or test servers. Consider a sample scenario as shown in the following diagram, where the content from the stage server is deployed to live servers. When snapshot version 2 is deployed to live servers, then the Alfresco deployment engine only copies the files which are either new or modifed and removes the files which are deleted when compared to snapshot version 1. The deployment engine is smart, which affects only few files rather than copying all of the files of a web project. Now that the snapshot version 2 is live (deployed to live servers), the editorial staff may work on a future version 3. Let's say for some reason there is an issue with snapshot version 2, which is live. You have the option of rolling it back to the previous good version of snapshot version 1. You can roll forward or you can roll back to a specific version of a web project snapshot version. This feature is very powerful even from a legal audit point of view, wherein you have an ability to reproduce the website as of a specific date. Further, the deployment process may be automated so that it happens automatically when content is approved for publishing. The deployment framework provides a flexible and highly-configurable system to allow you to tailor the system to your requirements. If the Alfresco-supplied components are not suitable, you can plug in your own authenticators, transport implementations, content transformers, and deployment targets. Live server vs. Test server Alfresco WCM enables previewing the content within the stage server environment. After content creation, the Editorial staff may preview web pages to verify the content, as well as the look and feel. Similarly the content reviewers and business owners may preview to review the web pages during the workflow process. Because of this powerful feature, you may not need a separate test server to preview and approve the content. The stage server itself is used for both authoring and testing the content. Hence, the content is authored and approved on the stage server and then deployed to the live servers directly. However, there can be a situation where you may need a separate test server. For example, if you are deploying content to another frontend application outside of Alfresco such as a PHP or .NET application, or situations when the virtualization server is not capable of providing the preview. Starting with the version 2.2 release Alfresco introduced the concept of a Test Server. You deploy the content from a Staging Sandbox to the live server and you deploy content from User Sandbox or from a workflow to the test server. Static vs. Dynamic delivery model Within the live or test server environment, you can push out content to a fat filesystem to be served up by Apache or IIS, or you can push your content into another runtime instance of Alfresco. Pushing content to a fat filesystem environment is also known as Static Deployment and it is achieved using Alfresco File System Receiver (FSR). Pushing content to another runtime instance of Alfresco is also known as Dynamic Deployment and it is achieved using Alfresco Server Receiver (ASR). In static deployment, the web pages are already rendered (or baked) before deploying. In dynamic deployment, since the content is in the runtime instance of Alfresco, the web pages will be generated (or fried) at runtime. The following is a summary of static and dynamic delivery models:     Static "Bake" Model Dynamic "Fry" Model Delivery Technology Web Servers Application Servers Page Compositing Submission time Request time Content deployed to File System Alfresco Runtime Content Search Not supported Supported out of the box Content Security Not supported Supported out of the box Personalization Limited Unlimited Performance Ultimate Less than the "bake" model   You can consider a hybrid deployment (both static and dynamic) for some business applications. You can define certain static content of the web project such as images, videos, and scripts to be deployed to the filesystem and certain dynamic content such as web pages to be deployed to the Alfresco runtime. This approach gives you good performance as well as personalized and dynamically changing content in a production environment. FSR for static delivery A File System Receiver (FSR) will need to be installed and configured on each live or test server to receive published static content from the Alfresco Staging Server. The FSR is a small, standalone server that receives updates from an Alfresco repository running Web Content Management; content is published to a fat filesystem. The published fat files will typically be served by a web server such as Apache, for static content or an application server such as Tomcat, JBoss, or IIS for web applications (WARs, PHP files, and so on). FSR requires filesystem access and must run as a user with appropriate rights to the target filesystem. The FSR is a standalone Java Daemon (no Tomcat or other app server required) and it has minimal resource requirements. The FSR supports the invocation of custom Java code and/or programs. Therefore, it can be used to perform additional tasks post-deployment such as search engine indexing, pushing content to a Content Delivery Network (CDN), or replicating content to other systems or repositories. The destination file server receiver has to be running with its RMI registry port and service port (44100 and 44101 by default) opened. Installing FSR If you refer to SourceForge at http://sourceforge.net/projects/alfresco/files/, you will notice three different downloads of FSR. A Microsoft Windows installer file (Alfresco-DeploymentCommunity-3.3-Setup.exe), a Linux installer file (Alfresco-DeploymentCommunity-3.3-Linux-x86-Install) for automatic installation, and a ZIP file (alfresco-community-deployment-3.3.zip) for manual installation. I would prefer using the ZIP file and manually installing the standalone deployment receiver. Both Windows and Linux installers have certain limitations as they do not provide configuring various deployment targets. Unzip the deployment ZIP file into a convenient location (it does not make its own directory) on a live or test server. Notice a file named deployment.properties, which contains the configuration information. The folder deployment includes default target information. To configure the filesystem receiver, open the deployment.properties file in the text editor of your choice. Choose locations for each of the following: ; filesystem receiver configuration deployment.filesystem.datadir=D:/07_MUN_WORK/alfresco_book_wcm_32e/ deployment-data/depdata deployment.filesystem.logdir=D:/07_MUN_WORK/alfresco_book_wcm_32e/ deployment-data/deplog deployment.filesystem.metadatadir=D:/07_MUN_WORK/alfresco_book_ wcm_32e/deployment-data/depmetadata deployment.filesystem.autofix=true deployment.filesystem.errorOnOverwrite=false ; Deployment Engine configuration deployment.rmi.port=44100 deployment.rmi.service.port=44101 ; Stand alone deployment server specific properties deployment.user=admin deployment.password=admin deployment.filesystem.datadir: This is the location in which the filesystem deployment receiver stores deployed files during a deployment, before committing them to their final locations. deployment.filesystem.logdir: This is the location in which the filesystem deployment receiver stores deployment time log data. deployment.filesystem.metadatadir: This is the location in which the filesystem deployment receiver stores metadata about deployed content. deployment.filesystem.autofix: The file system deployment target can either issue an error upon detecting a problem or automatically fix the problem. The autofix parameter controls whether the File System Deployment Target will attempt to fix the metadata itself or just issue a warning. Set the value to true to fix, or false to not fix. deployment.filesystem.errorOnOverWrite: The file system deployment target can issue an error upon overwriting the files. Set the value to false to overwrite the files, which is needed when updating the existing files. deployment.rmi.port: The port number to use for the RMI registry. Choose this so as not to conflict with any other services. By default, the standalone deployment receiver uses 44100. deployment.rmi.service.port: The port number to use for RMI service. Choose this so as not to conflict with any other services. By default this is 44101. Note that while specifying the directory locations on Microsoft Windows, either use forward slashes or escape the backslashes. For example, C:/dir1/dir2 or C:dir1dir2> Configuring your deployment targets You can configure as many target filesystem receivers as you need on a single live or test server. By default, a single filesystem receiver is defined with simple configuration via deployment.properties. Deployment targets are placed in the deployment folder with the filename deployment/*target.xml. To define more targets, follow the pattern of deployment/default-target.xml. There are two steps involved Definition of your target information in the deployment.properties file. Registration of your target with the deployment engine using an XML file. Let's create a deployment target for the CIGNEX website and let's name it as cignex-live1 target. As a first step to configure filesystem receiver, open the deployment.properties file in the text editor of your choice and add the cignex-live1 filesystem target configuration as follows: ; cignex-live1 filesystem target configuration deployment.filesystem.cignex-live1.metadatadir= ${deployment. filesystem.metadatadir}/cignex-live1 deployment.filesystem.cignex-live1.rootdir= D:/07_MUN_WORK/alfresco_book_wcm_32e/deployment-data/targets/cignex- live1 deployment.filesystem.cignex-live1.name=cignex-live1 deployment.filesystem.cignex-live1.user=admin deployment.filesystem.cignex-live1.password=admin Now to register this new target, you need to create a target XML file in the deployment folder. You can refer to an existing target file, default-target.xml, in the deployment folder for more information. Copy deployment/default-target.xml as the deployment/cignex-live1-target.xml file. Open the deployment/cignex-live1-target.xml file in your text editor of choice and replace the keyword default with the keyword cignex-live1. With these simple two steps, you have configured a new target named cignex-live1. Start and stop deployment receiver To run the receiver, execute deploy_start.sh(or deploy_start.bat) as the user on that server. Remember this user will be the owner of the deployed content. To stop the receiver, execute the deploy_stop.sh or deploy_stop.bat file. Using FSR from Alfresco WCM staging Now that the FSR is configured and running, you can use it from Alfresco staging to deploy the content. Configuring a web project to use FSR The following are the steps to configure a Web Project to use an FSR. Navigate to Company Home | Web Projects | <web project name>. Select Edit Web Project Settings from the Action menu. Click on Next to reach the Configure Deployment Servers window. Click on the Add Deployment Receiver link as shown in the following screenshot. Fill out the form as needed. The minimum required fields to be filled out, assuming default settings, are the Host name where the FSR is located and the Target Name. The following table contains the description of each of the FSR configuration fields.   Field Name Description Type Live Server or Test Server. You deploy the content from Staging Sandbox to the live server. And you deploy the content from User Sandbox or from workflow to the test server. Display Name A descriptive label for the server, used by the UI. Display Group The deployment receivers configured using the same Display Group name will be treated as one batch during deployment. Transport Name Name of the network protocol connection to the remote filesystem receiver. By default it is RMI. Host The host name of the destination server, can be a name or IP address. Port The RMI port to connect to on the destination server. URL The runtime URL of the destination server. Can be used to preview the deployment, upon a successful deployment. User Name The username to use to connect to the destination server. Password The password to use to connect to the destination server. Source Path The path of the folder to deploy, for example /ROOT/site1. Excludes A single regular expression (multiple rules can be defined within the expression) of items to exclude from the deployment, for example .*.jpg$|.*.gif$. Target Name The name of a target to deploy to, configured in the FSR. Include in Auto Deployment If checked, then this target will be included in auto deployment. Click on the Add and Finish buttons to complete the configuration.
Read more
  • 0
  • 0
  • 2628

article-image-drupal-site-configuration-performance-maintenance-logging-and-errors-and-reports
Packt
28 Sep 2010
9 min read
Save for later

Drupal Site Configuration: Performance, Maintenance, Logging and Errors and Reports

Packt
28 Sep 2010
9 min read
  Drupal 7 A comprehensive beginner's guide to installing, configuring, and building a professional Drupal 7 website Set up, configure, and deploy a Drupal 7 website Easily add exciting and powerful features Design and implement your website's look and feel Promote, manage, and maintain your live website In-depth coverage of Drupal's new core features, including image handling and fields Extended media coverage Completely new coverage on Views Improved and updated coverage on themes and theming Over 150 online quiz questions and exercises included Revised and updated for Drupal 7 based on comments from thousands of readers Read more about this book (For more resources on Drupal, see here.) Performance Every once in a while, someone makes a site that becomes wildly popular. Having many people visiting all at once can put some serious strain on the server's resources and cause all sorts of problems as the congestion builds. If you are unsure about what resources are available on your site, check with the hosting service and find out what they provide in the way of disk space, monthly transfer, and transfer speed. Many hosting services will boast unlimited bandwidth, but won't talk about connection speed. In other words, they don't meter how much water you use because they only let you switch the hosepipe on half way. It's important to know the limitations of the hardware and network resources, but don't fall into the trap of believing this is the most important thing to know. Ensuring that there are facilities in place to handle a large amount of traffic will go some way in ensuring that your site scales well. It's a time-honored tradition in the corporate world to throw extra resources at computing problems—buying the latest, fastest servers to help speed up slow applications, upgrading network hardware to allow data to travel more freely, and so on. Invariably though, poorly designed software, or software that is poorly tuned for performance always finds a way to utilize all the resources one can throw at it and still want more. More often than not, it is better to look at why software is chewing up resources and see what can be done to either stop it or at least alleviate the problem, so that the software utilizes its resources wisely. Drupal already has several strategies in place to help you, the site administrator, decide how and when to use resource-intensive modules and how to maximize the site's efficiency. Caching This section provides several options to improve the performance of your site, and as nothing in this world is really free, you need to understand that, by and large, obtaining a performance boost comes at the expense of something else—namely, how up-to-date content is. The following screenshot shows the performance page: The first option, CLEAR CACHE, is useful while making modifications to a site because it helps to ensure that changes are definitely displayed and not held up while the site cache is still in operation. Having the ability to clear the cache in order to view precisely how pages are being built is useful, but comes at a price. Remember that if you have a large site with lots of content, then Drupal will have to do a lot of work to rebuild its cache, and it is possible that users may notice a slowdown during this time. It is important to only enable caching on a live site, and not on the development machine, because changes to a page show up only when the cache expires—causing confusion if you are expecting something else during testing. As you know, Drupal uses PHP to build web pages that are returned to a user's browser. Most of the time, these pages are unchanged between requests, and Drupal ends up repeating the work of building the same page before sending it off to the other users who requested it. It makes sense to tell Drupal that if it has created a web page once, it should store a copy of this page and serve that copy instead of going through the trouble of recreating it. The process of storing copies of web pages in order to reduce the amount of effort required to repeatedly create a page is known as caching. The trade-off when using page caching is that any changes to a page are only shown to the users once that cached version has expired and been replaced. This makes caching a suitable method for boosting performance whenever content is not updated very often or when it is not important to have new content presented immediately. You will need to decide how long you think it is suitable to go before any updates made to a page must be shown—the longer you leave a page cached, the less work Drupal has to do, but the longer it will take for new content to show on the site. If your site is a daily blog, then by all means set the cache for up to a day at a time. If your site is a super busy, breaking news portal, then clearly you would opt for a cache time in minutes. Drupal also has the ability to cache the content of blocks, which can be a real performance boost for authenticated users (since page caching is only available for anonymous users). Blocks are constructed independently from the page as a whole, and often require expensive database requests or other operations in order to provide the information they contain. Enabling block caching means that blocks no longer have to query the database (or whatever else it is they are doing) each time a page refreshes. Rather, they simply serve up the cached version and save on all that work. Again, make sure you carefully weigh up the benefits between having fresh content and having high performance. Bandwidth optimization BANDWIDTH OPTIMIZATION, shown at the bottom of the page in the previous screenshot, deals with how to best transfer data from your server across the Internet to the users' browsers. The way in which data is transferred plays a big role in optimizing performance. In general, the most important things to remember are: Keep files small Keep the number of files down As shown, Drupal can aggregate and compress disparate CSS and JavaScript files in order to reduce the size and number of requests made to a server. Obviously, this has a huge number of benefits, especially if you are charged for bandwidth usage. Again, don't aggregate files during development. Turn this feature on only once the site has gone live, otherwise you are in for some serious frustration when changes to themes or scripts don't show up or behave as expected. Maintenance I should make the following point very clear: All major development or changes to a site should be performed on the development machine and thoroughly tested before being implemented or ported to the live site. There will be times, however, when you simply have to make some changes directly to the live site—even if it is only to implement upgrades that have already been tested out on the development server. If this is the case, then rather than allow users to browse a site under maintenance, visit the Maintenance mode page in the Development section, and select Put site into maintenance mode, provide a Maintenance mode message to display if the default one is not suitable, and get on with your work. Be very careful when working in maintenance mode because once you have logged out you are effectively locked out too. This is because, by default, only one user (that is the administrative user) can do anything on the site while it is offline. If you log off and try logging in again, you are no longer the administrative user; you are instead anonymous and are shown only the offline message: This is not very helpful if you do happen to be the site administrator; so Drupal allows the login page to be accessed as normal. Navigate to http://localhost/ drupal/user, and you will be able to log in as the administrator and use the site without hindrance. Make sure you know the administrator's password before going into maintenance mode. Everyone else is locked out until the site is no longer under maintenance. Logging and errors Go to Logging and errors in the DEVELOPMENT section of the Configuration overlay. This page provides a few options used to control how errors are displayed and logged: Error messages to display allows you to decide whether to write errors to the screen or not. While you are busy building the site, it's useful to view All messages in order to determine what has gone wrong and when. However, once it is time to go live you should change this to None for security reasons. Doing so prevents Drupal from displaying information to malicious users who might be able to use it in an attack on your site. The final setting, Database log entries to keep, at least to begin with, is sensible. You may wish to increase or decrease the number of records stored on the system depending on how much work you have to do in order to maintain the site properly. Remember that Drupal can properly maintain the site's event logs only if the cron jobs are being run regularly. Having only one setting to make is not that exciting, but once the site is live and messages are no longer visible through the pages, you can check the logs in the Reports section. Doing this on a regular basis is a good strategy to ensure that the site continues to run smoothly. Error messages, warnings, and so on are effectively windows into the operations of the site, and are indispensable tools.
Read more
  • 0
  • 0
  • 1957

article-image-basics-wordpress-and-jquery-plugin
Packt
27 Sep 2010
10 min read
Save for later

The Basics of WordPress and jQuery Plugin

Packt
27 Sep 2010
10 min read
  WordPress 3.0 jQuery Enhance your WordPress website with the captivating effects of jQuery. Enhance the usability and increase visual interest in your WordPress 3.0 site with easy-to-implement jQuery techniques Create advanced animations, use the UI plugin to your advantage within WordPress, and create custom jQuery plugins for your site Turn your jQuery plugins into WordPress plugins and share with the world Implement all of the above jQuery enhancements without ever having to make a WordPress content editor switch over into HTML view   Read more about this book (For more resources on WordPress and jQuery, see here.) WordPress plugins overview So themes change the look of WordPress without affecting its functionality. But what if you want to change or add functionality? WordPress plugins allow easy modification, customization, and enhancement to a WordPress site. Instead of having to dig in to the main files and change the core programming of WordPress, you can add functionality by installing and activating WordPress plugins. The WordPress development team took great care to make it easy to create plugins using access points and methods provided by the WordPress' Plugin API (Application Program Interface). The best place to search for plugins is: http://wordpress.org/extend/plugins/. The following is a screenshot of the WordPress plugin directory's main page: (Move the mouse over the image to enlarge.) Once you have a plugin, it's a simple matter of decompressing the file (usually just unzipping it) and reading the included readme.txt file for installation and activation instructions. For most WordPress plugins, this is simply a matter of uploading the file or directory to your WordPress installation's wp-content/plugins directory and then navigating to the Administration | Plugins | Installed panel to activate it. The next screenshot shows the Plugins admin panel with the activation screen for the default Askimet, Hello Dolly, and new WordPress Importer plugins: So how does a WordPress plugin differ from a jQuery plugin? In theory and intent, not that much, but in practice, there are quite a few differences. Let's take a look at jQuery plugins. jQuery plugins overview jQuery has the ability to allow you to take the scripts that you've created and encapsulate them into the jQuery function object. This allows your jQuery code to do a couple of key things. First, it becomes more easily ported over to different situations and uses. Second, your plugin works as a function that can be integrated into larger scripts as part of the jQuery statement chain. The best place to browse for jQuery plugins is the jQuery plugins page (http://plugins.jquery.com/), as seen in the next screenshot: In addition to having jQuery already bundled, WordPress has quite a few jQuery plugins already bundled with it as well. WordPress comes bundled with Color, Thickbox as well as Form and most of the jQuery UI plugins. Each of these plugins can be enabled with the wp_enqueue_script either in the theme's header.php file or function.php file, in WordPress. In this article, we'll shortly learn how to enable a jQuery plugin directly in a WordPress plugin. Of course, you can also download jQuery plugins and include them manually into your WordPress theme or plugins. You'd do this for plugins that aren't bundled with WordPress, or if you need to amend the plugins in anyway. Yes, you've noticed there's no easy jQuery plugin activation panel in WordPress. This is where understanding your chosen theme and WordPress plugins will come in handy! You'll soon find you have quite a few options to choose from when leveraging jQuery. Now that we have an overview of what WordPress themes, plugins, and jQuery plugins are, let's learn how to take better advantage of them. The basics of a WordPress plugin The goal here is to show you the structure of a simple WordPress plugin and the basics of how to construct one. Understanding this, you can begin to write your own basic plugins and feel more confident looking through other people's plugins when assessing what kind of features they provide to your WordPress site and if you need to tweak anything for your jQuery enhancements. Even as simply and basically as we're going to work, you'll see how truly powerful WordPress plugins can be. Want to become a WordPress plugin rockstar? You can start off with, yet again, WordPress 2.7 Complete by April Hodge Silver and Hasin Hayder. There's a chapter on plugins that walks you through creating very useful simple plugins, as well as a more complex plugin that writes to the WordPress database. Beyond that, you'll want to check out WordPress Plugin Development: Beginner's Guide by Vladimir Prelovac. Don't let the title fool you, Vladimir will have you generating feature rich and dynamic WordPress plugins using WordPress' coding standards all explained with clear, step-by-step code. Working with plugins does require some experience with PHP. I'll keep this explanation fairly straightforward for non-PHP developers, and those of you with PHP experience should be able to see how to expand on this example to your advantage in WordPress. Just as with themes, WordPress plugins require a little structure to get started with them. There's no defined hierarchy for plugin files, but you do need, at the very least, a PHP file with a special comment up top so that WordPress can display it within the Plugin Management page. While there are some single-file plugins out there, such as the Hello Dolly plugin, which comes with your WordPress installation, you never know when you first start developing, the ways in which a plugin may grow. To be safe, I like to organize my plugins into a uniquely named folder. Again, like with themes, WordPress relies on the plugin directory's namespace, so uniqueness is of key importance! In the wp-content/plugins directory you can place a unique folder and inside that, create a .php file, and at the beginning of the file, inside the <?php ?> tags, include the following header information. Only the bold information is absolutely required. The rest of the information is optional and populates the Manage Plugins page in the Administration panel. <?php /* Plugin Name: your WordPress Plugin Name goes here Plugin URI: http://yoururl.com/plugin-info Description: Explanation of what it does Author: Your Name Version: 1.0 Author URI: http://yoururl.com */ //plugin code will go here ?> Make sure that you don't have any spaces before your <?php tag or after your ?> tag. If you do, WordPress will display some errors because the system will get some errors about page headers already being sent. Once you have your .php file set up in its own directory, inside your plugin directory, you can add a basic PHP function. You can then decide how you want to evoke that function, using an action hook or a filter hook. For example: <?php /* Plugin Name: your WordPress Plugin Name goes here Plugin URI: http://yoururl.com/plugin-info Description: Explanation of what it does Author: Your Name Version: 1.0 Author URI: http://yoururl.com */ function myPluginFunction(){ //function code will go here } add_filter('the_title', 'myPluginFunction'); //or you could: /*add_action('wp_head', 'myPluginFunction');*/ ?> If you didn't have wp_head or wp_footer in your theme, many plugins can't function, and you limit yourself to the plugins you can write. In my plugins, I mostly use wp_header and the init action hooks. Luckily, most filter hooks will work in your plugins as WordPress will run through them in The Loop. For the most part, you'll get the most work done in your plugin using the_title and the_content filter hooks. Each of these filter's hooks will execute your function when WordPress loops through those template tags in the loop. Want to know what filter and action hooks are available? The list is exhaustive. In fact, it's so immense that the WordPress codex doesn't seem to have them all documented! For the most complete listing available of all action and filter hooks, including newer hooks available in version 2.9.x, you'll want to check out Adam Brown's WordPress Hooks Database: http://adambrown.info/p/wp_hooks. Overwhelmed by the database? Of course, checking out Vladimir's WordPress Plugin Development: Beginner's Guide will get you started with an arsenal of action and filter hooks as well. You now understand the basics of a WordPress plugin! Let's do something with it. Project: Writing a WordPress plugin to display author bios As we've discussed, plugins can help expand WordPress and give it new functionality. However, we've seen that adding jQuery scripts directly to the theme and editing its template pages here and there will do the trick in most cases. But let's imagine a more complicated scenario using our modified default theme and the hypothetical client. While we tweaked the default theme, I figured that this client might want to have her site's focus be more journalism oriented, and thus, she'd want some attention drawn to the author of each post upfront. I was right, she does. However, there's a catch. She doesn't just want their WordPress nickname displayed; she'd prefer their full first and last name be displayed as well, as it's more professional. She'd also like their quick biography displayed with a link to their own URL and yet, not have that information "get in the way" of the article itself, or lost down at the bottom of the post. And here's the really fun part; she wants this change affected not just on this site, but across her network of genre-specific news sites, over 20 of them at last count (dang, I forgot she had so many sites! Good thing she's hypothetical). For this specific WordPress site, it's easy enough to go in and comment out the custom function we dealt with earlier: add in the_author tag and display it twice, passing each tag some parameters to display the first and last name. I can also add a tag to display the author's biography snippet from the user panel and URL (if they've filled out that information). Also, it's certainly easy enough to add a little jQuery script to make that bio div show up on a rollover of the author's name. However, having to take all that work and then re-copy it into 20 different sites, many of which are not using the default theme, and most of which have not had jQuery included into their theme, does sound like an unnecessary amount of work (to boot, the client has mentioned that she's deciding on some new themes for some of the sites, but she doesn't know which sites will get what new themes yet). It is an unnecessary amount of work. Instead of amending this theme and then poking through, pasting, testing, and tweaking in 20 other themes, we'll spend that time creating a WordPress plugin. It will then be easy to deploy it across all the client's sites, and it shouldn't matter what theme each site is using. Let's get started!
Read more
  • 0
  • 0
  • 4295

article-image-understanding-jquery-and-wordpress-together
Packt
27 Sep 2010
11 min read
Save for later

Understanding jQuery and WordPress Together

Packt
27 Sep 2010
11 min read
  WordPress 3.0 jQuery Enhance your WordPress website with the captivating effects of jQuery. Enhance the usability and increase visual interest in your WordPress 3.0 site with easy-to-implement jQuery techniques Create advanced animations, use the UI plugin to your advantage within WordPress, and create custom jQuery plugins for your site Turn your jQuery plugins into WordPress plugins and share with the world Implement all of the above jQuery enhancements without ever having to make a WordPress content editor switch over into HTML view   Read more about this book (For more resources on WordPress and jQuery, see here.) Two ways to "plugin" jQuery into a WordPress site You're aware that WordPress is an impressive publishing platform. Its core strength lies in its near perfect separation of content, display, and functionality. Likewise, jQuery is an impressive JavaScript library with a lot of effort spent on making it work across platforms, be very flexible and extensible, and yet, elegantly degradable (if a user doesn't have JavaScript enabled for some reason). You're aware that WordPress themes control the look and feel of your site and that WordPress plugins can help your site do more, but we're going to take a look at exactly how those two components work within the WordPress system and how to use jQuery from either a theme or a WordPress plugin. In doing so, you'll be better able to take advantage of them when developing your jQuery enhancements. Speaking of jQuery enhancements, jQuery scripts can be turned into their own type of plugins, not to be confused with WordPress plugins. This makes the work you do in jQuery easily portable to different projects and uses. Between these three components, themes, WordPress plugins, and jQuery plugins, you'll find that just about anything you can dream of creating is at your fingertips. Even better, you'll realize that most of the work is already done. All three of these component types have extensive libraries of already developed third-party creations. Most are free! If they aren't free, you'll be prepared to determine if they're worth their price. By understanding the basics of editing themes and creating your own WordPress and jQuery plugins, you'll be ready to traverse the world of third-party creations and find the best solutions for your projects. You'll also be able to determine if it's better or faster to work with another developer's themes, plugins, or jQuery plugins, versus creating your own from scratch. WordPress themes overview A WordPress theme is, according to the WordPress codex, a collection of files that work together to produce a graphical interface with an underlying unifying design for a weblog. Themes comprise a collection of template files and web collateral such as images, CSS stylesheets, and JavaScript. Themes are what allow you to modify the way your WordPress site looks, without having to know much about how WordPress works, much less change how it works. There are plenty of sites that host free themes and or sell premium WordPress themes. A quick Google search for "wordpress themes" will give you an idea of the enormity of options available. However, when first looking for or researching themes, a good place to start is always WordPress' free theme gallery where you can easily review and demo different themes and styles: http://wordpress.org/extend/themes/. The next screenshot shows the main page of the WordPress theme's directory: (Move the mouse over the image to enlarge.) Once you've selected a theme to use or work with, you'll activate the theme by navigating to Administration | Appearance | Themes in the left-hand side panel of your WordPress installation's administration panel. The next screenshot displays the Manage Themes panel: That's the minimum you need to know about themes as a WordPress user. The basics of a WordPress theme The WordPress theme essentially contains the HTML and CSS that wrap and style your WordPress content. Thus, it's usually the first place you'll start when incorporating jQuery into a site. Most of the time, this is a good approach. Understanding a bit more about how themes work can only make your jQuery development go a little smoother. Let's take a look at how themes are structured and best practices for editing them. Want to know more about WordPress theme design? This title focuses on what you most need to know to work with jQuery in WordPress. If you're interested in WordPress theme development I highly recommend April Hodge Silver and Hasin Hayer's WordPress 2.7 Complete. Along with covering the complete core competencies for managing a WordPress site, it has an overview on editing and creating standard themes for WordPress. If you want to really dig deep into theme design, my title WordPress 2.8 Theme Design will walk you through creating a working HTML and CSS design mockup and coding it up from scratch. Understanding the template's hierarchy We've discussed that a WordPress theme comprises many file types including template pages. Template pages have a structure or hierarchy to them. That means, if one template type is not present, then the WordPress system will call up the next level template type. This allows developers to create themes that are fantastically detailed, which take full advantage of all of the hierarchy's available template page types, to make the setup unbelievably simple. It's possible to have a fully functioning WordPress theme that consists of no more than an index.php file! To really leverage a theme for jQuery enhancement (not to mention help you with general WordPress troubleshooting), it's good to start with an understanding of the theme's hierarchy. In addition to these template files, themes of course also include image files, stylesheets, and even custom template pages, and PHP code files. Essentially, you can have 14 different default page templates in your WordPress theme, not including your style.css sheet or includes such as header.php, sidebar.php, and searchform.php. You can have more template pages than that if you take advantage of WordPress' capability for individual custom page, category, and tag templates. If you open up the default theme's directory that we've been working with, you'll see most of these template files as well as an image directory, style.css and the js directory with the custom-jquery.js file. The following screenshot shows you the main files in WordPress 3.0's new default theme, Twenty Ten: The next list contains the general template hierarchy rules. The absolute simplest theme you can have must contain an index.php page. If no other specific template pages exist, then index.php is the default. You can then begin expanding your theme by adding the following pages: archive.php trumps index.php when a category, tag, date, or author page is viewed. home.php trumps index.php when the home page is viewed. single.php trumps index.php when an individual post is viewed. search.php trumps index.php when the results from a search are viewed. 404.php trumps index.php when the URI address finds no existing content. page.php trumps index.php when looking at a static page. A custom template page, such as: page_about.php, when selected through the page's Administration panel, trumps page.php, which trumps index.php when that particular page is viewed. category.php trumps archive.php, which then trumps index.php when a category is viewed. A custom category-ID page, such as: category-12.php trumps category.php. This then trumps archive.php, which trumps index.php. tag.php trumps archive.php. This in turn trumps index.php when a tag page is viewed. A custom tag-tagname page, such as: tag-reviews.php trumps tag.php. This trumps archive.php, which trumps index.php. author.php trumps archive.php. This in turn trumps index.php, when an author page is viewed. date.php trumps archive.php. This trumps index.php when a date page is viewed. You can learn more about the WordPress theme template hierarchy here:http://codex.wordpress.org/Template_Hierarchy. A whole new theme If you wanted to create a new theme or if you'll be modifying a theme considerably, you'll want to create a directory with a file structure similar to the hierarchy explained previously. Again, because it's hierarchal, you don't have to create every single page suggested, higher up pages will assume the role unless you decide otherwise. As I've mentioned, it is possible to have a working theme with nothing but an index.php file. I'll be modifying the default theme, yet would like the original default theme available for reference. I'll make a copy of the default theme's directory and rename it to: twentyten-wp-jq. WordPress depends on the theme directories namespace. Meaning, each theme requires a uniquely named folder! Otherwise, you'll copy over another theme. The next screenshot shows this directory's creation: I'll then open up the style.css file and modify the information at the beginning of the CSS file: /* Theme Name: Twenty Ten - <b>edited for Chapter 3 of WordPress & jQuery</b> Theme URI: http://wordpress.org/ Description: The 2010 default theme for WordPress. Author: the WordPress team <b>& Tessa Silver</b> Version: 1.0 Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style */ ... My "new" theme will then show up in the administration panel's Manage Themes page. You can take a new screenshot to update your new or modified theme. If there is no screenshot, the frame will display a grey box. As the look of the theme is going to change a little, I've removed the screenshot.png file from the directory for now, as you can see in the next screenshot: The Loop We know how useful it is when jQuery "loops" through selected elements in a wrapper for you. WordPress does a little looping of its own; in fact, it's important enough to be named "The Loop". The Loop is an essential part of your WordPress theme. It displays your posts in chronological order and lets you define custom display properties with various WordPress template tags wrapped in HTML markup. The Loop in WordPress is a while loop and therefore starts with the PHP code: while (have_posts()): followed by the template tag the_post(). All the markup and additional template tags are then applied to each post that gets looped through for display. The Loop is then ended with the PHP endwhile statement. Every template page view can have its own loop so that you can modify and change the look and layout of each type of post sort. Every template page is essentially, just sorting your posts in different ways. For example, different category or tag template pages sort and refine your posts down to meet specific criteria. Those sorted posts can appear different from posts on your main page, or in your archive lists, and so on. The next example is a very simple loop taken from WordPress 2.9.2's default Kubrick theme: ... <?php while (have_posts()) : the_post(); ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <h2> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php the_title(); ?> </a> </h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --> </small> <div class="entry"> <?php the_content('Read the rest of this entry &raquo;'); ?> </div> <p class="postmetadata"> <?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?> </p> </div> <?php endwhile; ?> ... The loop is tucked into a large if/else statement that most importantly checks if there are posts to sort. If there are no matching posts to display, a "Sorry" message is displayed, and the searchform.php file is included with the get_search_form() include tag. The new WordPress 3.0 Twenty Ten theme has its loop separated out into its own template page called loop.php, and it has quite a few more if/else statements within it so that the same loop code can handle many different situations, instead of writing individual loops for different template pages. On the whole, the same basic template tags as well as conditional and include tags are used in the new theme as they were before in the previous default theme. There are now just a few new template and include tags that help you streamline your theme. Let's take a closer look at some of these template tags, include and conditional tags, and the API hooks available to us in a WordPress theme.
Read more
  • 0
  • 0
  • 2352
article-image-creating-custom-wcm-workflow-group-using-alfresco-3
Packt
27 Sep 2010
13 min read
Save for later

Creating a Custom WCM Workflow for a Group using Alfresco 3

Packt
27 Sep 2010
13 min read
(For more resources on Alfresco 3, see here.) You can define and deploy your own task-oriented workflows in the Alfresco repository. However, you need to follow a particular format to define your workflow and a particular process to deploy it in Alfresco. Workflows can be deployed manually (which requires a restart of the server) and dynamically (without starting the server). For now we will deploy the workflow manually. These customizations are typically deployed via the alfresco/extension folder and require the Alfresco server to be restarted to take effect. In the later examples, we will deploy using the dynamic approach. As an example, we will configure one workflow. The use case scenario is as follows. There is a section of Blogs and News on the Cignex website, which needs to be updated monthly. The blog has to be published regularly. In order to publish, one needs to follow some process that can be defined in a workflow. The blog has to be reviewed by three different groups. Each group has different roles. Groups approve the blog one at a time and in order. When the blog is submitted, it will go to the first group. All the users belonging to that group will receive a notification via a task in the My Pooled Tasks dashlet. Any one of the users can take ownership and approve or reject the task. If rejected, it will go to the initiator. On approval it will go to next group and the process will continue for all three groups. Once the process is complete, a notification will be sent to the initiator. Also the blog would be submitted to the Staging box. For this, create Jennifer Bruce, Kristie Dawid, LeRoy Fuess, Michael Alison, and Jessica Tucker as users. Create three groups: Technical Reviewer, Editorial, and Publisher. Add Jennifer Bruce and Kristie Dawid to Technical Reviewer, add LeRoy Fuess to Editorial, and add Michael Alison and Jessica Tucker to Publisher. Invite Technical Reviewer, Editorial, and Publisher as Reviewer on the Cignex web project. The custom workflow process is shown in the following diagram: Defining the workflow process For any workflow to be deployed you should have the following files: Task Model: The Task Model provides a description for each of the tasks in the workflow. Each task description consists of Name, Title, Properties, Mandatory Aspects, and Association. Process Definition: The Process Definition describes the states (steps) and transitions (choices) of a workflow. Resource Bundle (optional): A workflow Resource Bundle provides all the human-readable messages displayed in the user interface for managing the workflow. Messages include task titles, task property names, task choices, and so on. web-client-config-custom.xml: Web Client configuration specifies the presentation of Tasks and properties to the user in the Alfresco Explorer. custom-model-context.xml: The custom model Spring Context file instructs Spring on how to bootstrap or load the Task Model definition file, Process Definition file, and Resource Bundle. web-client-config-wcm.xml: Web Client configuration specifies the availability of workflow to the web project in the Alfresco Explorer. Follow these steps to create a custom workflow. Step 1: Create a Task Model For each task in the Process Definition (as defined by <task> elements), it is possible to associate a task description. The description specifies information that may be attached to a task, that is properties (name and data type) associations (name and type of associated object), and mandatory aspects. A user may view and edit this information in the Task dialog within the Alfresco Explorer. The Task Model is expressed as a Content Model, as supported by the Data Dictionary. To create a Task Model, create a new Content Model file for Process Definition with the .xml extension. Define a Content Model name Create a Type for each task Define Properties Define and add Aspects to a Type Define a Content Model name Create a new Content Model for the Process Definition. Define the namespace of the model. XML namespaces provide a method for avoiding element name conflicts. If you want to use any other model's task, aspect, or association, then you can use it by importing their namespace. Reusability of Task Model is possible. <?xml version="1.0" encoding="UTF-8"?> <model name="bookwcmwf:workflowmodel" > <imports> <import uri="http://www.alfresco.org/model/wcmworkflow/1.0" prefix="wcmwf" /> <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"> </imports> <namespaces> <namespace uri="http://book.com" prefix="bookwcmwf" /> </namespaces></model> Create a Type for each task For each task we have to define a Content Type. The Type can also be extended as follows: <types> <type name="bookwcmwf:submitReviewTask"> <parent>wcmwf:startTask</parent> </type></types> Define Properties Within each Type, describe the Properties and Associations (information) required for that task. Properties can also be inherited from other task definitions. Using the previous example all the properties of wcmwf:startTask will be added to this Type. <type name="bookwcmwf:submitReviewTask"> <parent>wcmwf:startTask</parent> <properties> <property name="wcmwf:submitReviewType"> <title>Serial or Parallel Review</title> <type>d:text</type> </property> </properties> <associations> <association name="wcmwf:webproject"> <source> <mandatory>false</mandatory> <many>false</many> </source> <target> <class>wca:webfolder</class> <mandatory>true</mandatory> <many>false</many> </target> </association> </associations></type> Define Aspect You can also introduce custom properties by defining an Aspect. An Aspect can be applied to any Content Type. Once applied, the properties are added to that Content Type. You cannot define a dependency on other Aspects. They cannot be extended. <type name="bookwcmwf:verifyBrokenLinksTask"> <parent>wcmwf:workflowTask</parent> <mandatory-aspects> <aspect>bookwcmwf:reviewInfo</aspect> <aspect>bpm:assignee</aspect> </mandatory-aspects></type> <aspects> <aspect name="bookwcmwf:reviewInfo"> <properties> <property name=" bookwcmwf:reviewerCnt"> <title>Reviewer Count</title> <type>d:int</type> <mandatory>true</mandatory> </property> </properties> </aspect></aspects> The following are the advantages of having custom Aspect over custom content: Flexibility: You will have more flexibility. Having a custom Aspect will give you the flexibility to add an additional set of properties to the documents in specific spaces. Efficiency: Since these properties are applied selectively to certain documents only in certain spaces, you will use limited storage in a relational database for these properties. The following are the disadvantages of having custom Aspect over custom content: High Maintenance: If the custom Aspect (additional properties) is added to documents based on business rules, you need to define it at every space, wherever required. Dependency: You cannot define the dependency with other Aspects. For example, if you need the effectivity aspect to always be associated with the custom aspect, you need to make sure you attach both the Aspects to the documents. Now that we are familiar with the code, let's develop a complete model file to deploy our case study in action. For any customization of files you have to develop the files in the extension folder of <install-alfresco>. Create a file book-serial-group-workflow-wcmModel.xml in the specified location <install-alfresco>/tomcat/shared/classes/alfresco/extension. Copy the downloaded content into the file. For reference, go to http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Content_Types. Step 2: Create the Process Definition A Process Definition represents a formal specification of a business process and is based on a directed graph. The graph is composed of nodes and transitions. Every node in the graph is of a specific Type. The Type of the node defines the runtime behavior. A Process Definition has exactly one Start-state and End-state. The following table describes some of the key terms used in a Process Definition: Key term Description Swimlane Swimlane is used to define a role for a user. Transition Transitions have a source node and a destination node. The source node is represented by the property from and the destination node is represented by the property to. It is used to connect nodes. A Transition can optionally have a name. The name is represented in the UI with a button. Task Tasks are associated with a Swimlane. These tasks are defined in the Workflow model files. On the basis of these tasks, the Properties are displayed. Actions Actions are pieces of Java code that are executed upon events in the process execution. These actions are performed on the basis of these tasks, as defined in the Process Definition. Events The jBPM engine will fire Events during the graph execution. Events specify moments in the execution of the process. An Event can be task-create, nodeenter, task-end, process-end, and so on. When the jBPM engine fires an event, the list of Actions is executed. Scripts Script is executed within Action. Some of the variables that can be available in Script are node, task, execution context, and so on. Nodes Each Node has a specific type. The Node Type determines what will happen when an execution arrives in the Node at runtime. The following table summarizes the Node Types available in jBPM out of the box. Node types Description Task Node A Task Node represents one or more tasks that have to be performed by users. Start-state There can be only one Start-state in the Process Definition, which logs the start of the workflow. decision The distinction between multiple paths. When the decision between multiples path has to be taken, a decision node is used. fork A fork splits one path of execution into multiple concurrent paths of execution. join Joins multiple paths into single path. A join will end every token that enters the join. node The node serves the situation where you want to write your own code in a node. End-state There can be only one End-state in the Process Definition, which logs the end of the workflow. There are two ways of building the Process Definition. One is by hand, that is create a jPDL XML document. The second option is by designer, that is use a tool to generate the jPDL XML document. To create a Process Definition, create a new Process Definition file with the extension .xml. Define a Process Definition name The Process Definition name is important. <?xml version="1.0" encoding="UTF-8"?> <process-definition name="bookwcmwf:bookworkflow"> In the previous code we have used bookwcmwf:bookworkflow where bookwcmwf is the namespace of the workflow model file defined earlier, which we are going to use in this Process Definition, and bookworkflow can be any name. Define a Swimlane Swimlanes are used to declare workflow "roles". Tasks are associated with a Swimlane. Here initiator is the user who is starting the workflow. Likewise, we have some other roles also defined. For example, bpm_assignee (one user to whom the workflow is assigned), bpm_assignees (one or more user), bpm_groupAssignee (single group), and bpm_groupAssignees (one or more groups). <swimlane name="initiator"/><swimlane name="approver"> <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment"> <pooledactors>#{bpm_groupAssignee}</pooledactors> </assignment></swimlane><swimlane name="assignee"> <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment"> <actor>#{bpm_assignee}</actor> </assignment></swimlane> Associate a task We have already defined task in the Content Model files. On the basis of these tasks the properties are displayed. Next step is to add these tasks to the workflow process. To start with, add a task to the start node. The Start Task is assigned to the initiator of the workflow. It's used to collect the information (that is the workflow parameters) required for the workflow to proceed. <start-state name="start"> <task name="bookwcmwf:submitReviewTask" swimlane="initiator"/> <transition name="" to="initialise"/></start-state><swimlane name="assignee"> <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment"> <actor>#{bpm_assignee}</actor> </assignment></swimlane> <task-node name="initialise "> <task name="bookwcmwf:verifyBrokenLinksTask" swimlane="assignee" /> <transition name="abort" to="end"> <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <script> var mail = actions.create("mail"); mail.parameters.to = initiator.properties["cm:email"]; mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription; mail.parameters.from = bpm_assignee.properties["cm:email"]; mail.parameters.text = "It's done"; mail.execute(bpm_package); </script> </action> </task-node> <end-state name="end"/> During runtime, all the properties of the task bookwcmwf:submitReviewTask are visible to the user who is initiating a workflow. Once the properties are filled, the initiator assigns a task to another user or group. In this case, it is assigned to user. Now the task appears in dashlets of assigned user. The Assignee fills the properties of the task bookwcmwf:verifyBrokenLinksTask and clicks on the abort button. The abort transition would call Alfresco JavaScript that sends an e-mail. And an end-state event will log the end of the workflow. We are now ready to create a Process Definition file and use the workflow model we developed earlier for our case study. Create a file book-serial-group-processdefinition.xml in the specified location <install-alfresco>/tomcat/shared/classes/alfresco/extension. Copy the downloaded content into the file. For reference go to http://wiki.alfresco.com/wiki/WorkflowAdministration. Step 3: Create the workflow Resource Bundles For localized workflow interaction it is necessary to provide Resource Bundles containing UI labels for each piece of text that is exposed to the user. With the appropriate Resource Bundles, a single workflow instance may spawn tasks where the user interface for each task is rendered in a different language, based on the locale of the user. Specific structure has to be followed in order to define labels for UI in Resource Bundle. <model_prefix>_<model_name>.[title|description]<model_prefix>_<model_name>.<model_element>.<element_prefix>_ <element_name>.[title|description] Add all the properties that relate to this Process Definition and model. bookwcmwf_bookworkflow.workflow.title=Book Workflow bookwcmwf_bookworkflow.node.verifybrokenlinks.transition.abort.title=Abort Submission bookwcmwf_workflowmodel.type.bookwcmwf_reviewTask.description=Review Documents to approve or reject them Create a file book-serial-group-messages.properties in the specified location, <install-alfresco>/tomcat/shared/classes/alfresco/extension. Copy the downloaded content into the file.
Read more
  • 0
  • 0
  • 2784

article-image-oracle-bpm-suite-11gr1-creating-bpm-application
Packt
25 Sep 2010
7 min read
Save for later

Oracle BPM Suite 11gR1: Creating a BPM Application

Packt
25 Sep 2010
7 min read
Getting Started with Oracle BPM Suite 11gR1 – A Hands-On Tutorial Learn from the experts – teach yourself Oracle BPM Suite 11g with an accelerated and hands-on learning path brought to you by Oracle BPM Suite Product Management team members Offers an accelerated learning path for the much-anticipated Oracle BPM Suite 11g release Set the stage for your BPM learning experience with a discussion into the evolution of BPM, and a comprehensive overview of the Oracle BPM Suite 11g Product Architecture Discover BPMN 2.0 modeling, simulation, and implementation Understand how Oracle uses standards like Services Component Architecture (SCA) to simplify the process of application development Describes how Oracle has unified services and events into one platform Built around an iterative tutorial, using a real-life scenario to illustrate all the key features Full of illustrations, diagrams, and tips for developing SOA applications faster, with clear step-by-step instructions and practical examples Written by Oracle BPM Suite Product Management team members   Read more about this book (For more resources on Oracle, see here.) The BPM Application consists of a set of related business processes and associated shared artifacts such as Process Participants and Organization models, User Interfaces, Services, and Data. The process-related artifacts such as Services and Data are stored in the Business Catalog. The Business Catalog facilitates collaboration between the various stakeholders involved in the development of the business process. It provides a mechanism for Process Developer (IT) to provide building blocks that can in turn be used by the process analyst in implementing the business process. Start BPM Studio using Start | Programs | Oracle Fusion Middleware 11.1.1.3 | Oracle JDeveloper 11.1.1.3. BPM Studio supports two roles or modes of process development. The BPM Role is recommended for Process Analysts and provides a business perspective with focus on business process modeling. The Default Role is recommended for Process Developers for refinement of business process models and generation of implementation artifacts to complete the BPM Application for deployment and execution. Tutorial: Creating SalesQuote project and modeling RequestQuote process This is the beginning of the BPM 11gR1 hands-on tutorial. Start by creating the BPM Application and then design the Sales Quote business process. Open BPM Studio by selecting the BPM Process Analyst role when you start JDeveloper or if JDeveloper is already open, select Preferences from the Tools menu and in the Roles section, select BPM Process Analyst. Go to File | New to launch the Application wizard. In the New Gallery window, select Applications in the Categories panel. Select BPM Application in the Items panel. Specify the Application Name —SalesQuoteLab; the folder name should also be set to SalesQuoteLab. Click on the Next button. Enter QuoteProcessLab for the Project Name. Click on the Finish button. Go to the View | BPM Project Navigator. The BPM Project Navigator opens up the QuoteProcessLab – BPM Project that you just created. A single BPM Project can contain multiple related business processes. Notice that the BPM Project contains several folders. Each folder is used to store a specific type of BPM artifact. The Processes folder stores BPMN business process models; the Activity Guide folder is used to store the process milestones; the Organization folder stores Organization model artifacts such as Roles and Organization Units; the Business Catalog folder stores Services and Data; the Simulation folder stores simulation models to capture what-if scenarios for the business process and the Resources folder holds XSLT data transformation artifacts. To create a new business process model, you need to right-click on Processes and select New | Process. This launches the Create BPMN Process wizard. Select From Pattern option and select the Manual Process pattern. Recall that the Sales Quote Process is instantiated when Enter Quote task gets assigned to the Sales Representative role. The Asynchronous Service and the Synchronous Service patterns are used to expose the BPMN process as a Service Provider. Click on the Next button. Specify the name for the Process—RequestQuoteLab. Click on the Finish button. This creates a RequestQuoteLab process with a Start Event (thin circle) and End Event (thicker circle) of type None with a User Task in between. The User Task represents a human step that is managed by the BPM run-time engine—workflow component. The Start Event of type None signifies that there is no external event triggering the process. The first activity after the Start Event creates the process instance. In addition, a default swim lane—Role, gets created. In BPM Studio, the swim lanes in the BPMN process point to logical roles. A logical role represents a process participant (user or group) and needs to be mapped to physical roles (LDAP users/groups) before the process is deployed. Right-click on the User Task step, select Properties, and specify the name Enter Quote Details for the step. Click on the OK button. The next step is to rename the default created role to SalesRep. Navigate to QuoteProcessLab—BPM Project node and select the Organization node underneath it. Right-click on the Organization node and select Open. This opens up the Organization pane. Highlight the default role named Role and use the pencil icon to edit it to be SalesRep. Click on the + sign to add the following roles—Approvers, BusinessPractices, and Contracts. The following screenshot shows the list of roles that you just created: Close the Organization window. Go back to the RequestQuoteLab—process model. The participant for the Enter Quote Details—User Task is now set to the SalesRep role. Ignore the yellow triangular symbol with the exclamation for now. It indicates that certain configuration information is missing for the activity. Right-click on the process diagram just below the SalesRep-Lane. Choose the Add Role option. Choose Business Practices from the list of options available. Click on the OK button. Open the View | Component Palette. Drag and drop a User Task from the Interactive Tasks section of the BPMN Component Palette. Note: The Interactive Tasks refers to a step that is managed by the workflow engine. The Assignees (Participants) represent the business users who need to carry out the Interactive Task. The associated Task (work to be performed) is shown in the inbox of the assignees (similar to Email Inbox) when the Interactive Task is triggered. The User Task is the simplest type of Interactive Task where the assignee of the task is set to a single role. The actual work is performed only when the Assignee executes on his Task. The Task is presented to the Assignee through a browser based worklist application. In BPM Studio, the Assignee is automatically set to the role associated with the swim lane into which the Interactive Task is dropped. Place this new User Task after the existing Enter Quote Details—User Task by hovering on the center of the connector until it turns blue and name it Business Practices Review. The connection lines are automatically created. Drag the new Business Practices Review—User Task to the Business Practices lane. The performer or assignee for the Business Practices Review—User Task is automatically set to Business Practices—role. Create two more lanes for Approvers and Contracts. Drag and drop three User Tasks on to the process diagram, one following the other, and name them Approve Deal, Approve Terms, and Finalize Contracts respectively. Pin the Approve Deal step to the Approvers Lane. Pin the other two User Tasks—Approve Terms and Finalize Contracts steps to the Contracts Lane. Finally add a Service Task right after the Finalize Contracts step from the BPM Component Palette and name it Save Quote. The modified diagram should look like the following:
Read more
  • 0
  • 0
  • 8746

article-image-installing-and-configuring-jobs-and-managing-sections-categories-and-articles-using-jo
Packt
25 Sep 2010
4 min read
Save for later

Installing and Configuring Jobs! and Managing Sections, Categories, and Articles using Joomla!

Packt
25 Sep 2010
4 min read
  Building job sites with Joomla! A practical stepwise tutorial to build your professional website using Joomla!  Build your own monster.com using Joomla!  Take your job site to the next level using commercial Jobs! Extension  Administrate and publish your Joomla! job site easily using the Joomla! 1.5 administrator panel and Jobs! Pro control panel interface  Boost your job site ranking in search engines using Joomla! SEO Read more about this book (For more resources on Joomla!, see here.) Joomla! is a popular content management system, so it is mainly used for managing content. You can manage content from the Joomla! backend administrator panel. To go to this area, type in your web browser, the address of the server directory where the administrator folder is located. For example, if you have installed Joomla! in the joomla directory of local server, then the address is:http://localhost/ joomla/administrator. You will see the Joomla! Administration Login screen in your browser window. Log into the administrator panel as Super Administrator. By default, the username is admin. Then provide the password that you have created while you were configuring. Before adding an article as content, you must create a section and category for it. You can organize your content by using sections and categories because Joomla! uses a three-tier organization level for articles—Section | Category | Article. Any section contains one or more categories, and each category may have articles assigned to it. One article can only be in one category and section. You can easily add new sections, edit existing sections, publish or unpublish any section, and copy or delete sections from the Section Manager window. To manage sections, click on Contents | Section Manager (as shown in the following screenshot): The process of managing categories is quite similar to managing sections. You just need to click on Contents | Category Manager to go to Category Manager window and then manage your categories. After creating section and category, to add a new article from admin panel, click on Contents | Article Manager (as shown in the following screenshot): To add a new article, click on the New button in the Article Manager window and write your article with a title in Article: [New] window WYSISWYG editor area. You must also define the section and category for this article—which you have created earlier—and save this content. If you want to edit an article, select the article, click on Edit, and then make any changes in the article in Article: [Edit] window. Article Manager enables you to publish or unpublish an article. You can send an article to trash, copy an article, move an article, and so on. Just select an article and then click on the corresponding buttons. Managing extensions Components, modules, plugins, templates, and languages are collectively known as extensions. Each of these extensions is used for specific functions: Components: It is the largest and the most complex of the extension types. When a Joomla! web page is being loaded, a component is called to render the main page body. For example, the component com_banners displays a banner in a web page. Components are divided into two parts—for the administrator and for the frontend website. Modules: It is used for page rendering and doesn't need to be linked to anything. It can contain only static HTML, image, or text. For example, mod_mainmenu and mod_banners. Plugins: These were previously known as mambots. Using a plugin allows a developer to change the way their code behaves depending upon which plugins are installed to react to an event. Templates: It is basically the design of your Joomla! website. With a template, you can change the look and the feel of your website. Templates have certain fields in which components and modules are shown. You can easily create and customize any template file. Languages: Languages can be packaged in two ways—either as a core package or as an extension package—and allow both the Joomla! core as well as third-party components and modules to be localized or internationalized. To know more about extensions, go to the Joomla! documentation page: http://docs.joomla.org/Joomla!_Extensions_Defined. You can easily manage extensions by using the Extensions menu. For example, to install or uninstall any extension, click on the menu Extension | Install/Uninstall; to manage modules, click on the Module Manager; to manage plugins, click on the Plugin Manager; to manage templates, click on the Template Manager; and to manage language, click on the Language Manager.
Read more
  • 0
  • 0
  • 1314
article-image-installing-and-configuring-joomla-15
Packt
25 Sep 2010
7 min read
Save for later

Installing and Configuring Joomla! 1.5

Packt
25 Sep 2010
7 min read
  Building job sites with Joomla! A practical stepwise tutorial to build your professional website using Joomla!  Build your own monster.com using Joomla!  Take your job site to the next level using commercial Jobs! Extension  Administrate and publish your Joomla! job site easily using the Joomla! 1.5 administrator panel and Jobs! Pro control panel interface  Boost your job site ranking in search engines using Joomla! SEO Introduction You may have various approaches for building a jobsite, with job search and registration facilities for users and providing several services to your clients such as job posting, online application process, resume search, and so on. Joomla! is one of the best approaches and an affordable solution for building your jobsite, even if you are a novice to Joomla!. This is because Joomla! is a free, open source Content Management System (CMS) , which provides one of the most powerful web application development frameworks available today. These are all reasons for building a jobsite with Joomla!: It has a friendly interface for all types of users—designers, developers, authors, and administrators. This CMS is growing rapidly and improving since its release. Joomla! is designed to be easy to install and set up even if you're not an advanced user. Another advantage is that you need less time and effort to build a jobsite with Joomla!. You need to use a Joomla! jobsite extension to build your jobsite and you can use the commercial extension Jobs! because it's fully equipped to operate a jobsite, featuring tools to manage jobs, resumes, applications, and subscriptions. If you are looking for a jobsite such as Monster, Career Builder, a niche jobs listing such as Tech Crunch, or just posting job ads on your company site, Jobs! is an ideal solution. To know more about this extension, visit its official website http://www.instantphp.com/ Jobs! has two variations—Jobs! Pro and Jobs! Basic . The Jobs! Pro provides some additional features and facilities, which are not available in Jobs! Basic. You can use any one of them, depending upon your needs and budget. But if you need full control over your jobsite and more customization facilities, then Jobs! Pro is recommended. You can install Jobs! component and its modules easily, like any other Joomla! extension. You need to spend only a few minutes to install and configure Joomla! 1.5 and Jobs! Pro 1.3 or Jobs! Basic 1.0. It is a stepwise setup process. But first you must ensure that your system meets all the requirements that are recommended by developers. Prerequisites for installation of Joomla! 1.5 and Jobs! Joomla! is written in PHP and mainly uses MySQL database to store and manipulate information. Before installing Joomla! 1.5 and Jobs! extension, we need a server environment, that includes the following:     Software/Application Minimum Requirement Recommended Version Website PHP 5 5.2 http//php.net MySQL 4.1 or above 5 http://dev.mysql.com/downloads/mysql/5.0.html Apache 1.3 or above   http://httpd.apache.org IIS 6 7 http://www.iis.net/ mod_mysql mod_xml mod_zlib       You must ensure that you have the MySQL, XML, and zlib functionality enabled within your PHP installation. This is controlled within the php.ini file. Setting up a local server environment In order to run Joomla! properly, we need a server environment with pre-installed PHP and MySQL. In this case, you can use a virtual server or can choose other hosting options. But if you want to try out Joomla! on your own computer before using a remote server, we can set up a local server environment. To set up a server environment, we can use XAMPP solution. It comes equipped with Apache HTTP server, PHP, and MySQL. Installing these components individually is quite difficult and needs more time and effort. To install XAMPP, download the latest version of XAMPP 1.7.x from the Apache friends website: http://www.apachefriends.org/en/xampp.html. Windows operating system users can install XAMPP for Windows in two different variations—self-extracting RAR archive and ZIP archive. If you want to use self-extracting RAR archive, first download the .exe file and then follow these steps: Run the installer file, choose a directory, and click on the Install button. After extracting XAMPP, the setup script setup_xampp.bat will start automatically. After the installation is done, click on Start All Programs | Apache Friends | XAMPP | XAMPP Control Pane|. Start Apache and MySQL by clicking on the Start buttons beside each item. If prompted by Windows Firewall, click on the Unblock button.For more information on installing XAMPP on Windows or troubleshooting, go to the Windows FAQs page: http://www.apachefriends.org/en/faqxampp- windows.html. If you are using Linux platform, download the compressed .tar.gz file and follow these steps for installation: Go to a Linux shell and log in as the system administrator root: su Extract the downloaded archive file to /opt: tar xvfz xampp-linux-1.7.3a.tar.gz -C /opt XAMPP is now installed in the /opt/lampp directory. To start XAMPP, call the command: /opt/lampp/lampp start You should now see something similar to the following on your screen: Starting XAMPP 1.7.3a... LAMPP: Starting Apache... LAMPP: Starting MySQL... LAMPP started.   For more information on installing XAMPP on Linux or troubleshooting, go to the Linux FAQs page: http://www.apachefriends.org/en/faq-xampp-linux.html. If you want to use XAMPP in MAC operating system , download the .dmg file and follow these steps: Open the DMG-Image. Drag and drop the XAMPP folder into your Applications folder. XAMPP is now installed in the /Applications/XAMPP directory. To start XAMPP open XAMPP Control and start Apache and MySQL. After installation of XAMPP in a system, to test your installation, type the following URL in the browser: http://localhost/. You will see the XAMPP start page. Uploading installation packages and files to server Now, we need to copy or transfer Joomla! installation package files to server. Before copying the installation package, we must download Joomla_1.5.15-Stable-Full_ Package.zip from the webpage http://www.joomla.org/download.html, and then extract and unzip it. You can use WinZip or WinRAR to unzip these files. After unzipping the files, you have to copy files on your server root folder (for Apache, it is htdocs folder). If you are not using the XAMPP or local server environment, you need the File Transfer Protocol (FTP) software to transfer files to your server root folder, such as htdocs or wwwroot. The popular FTP software is FileZilla, which is absolutely free and available for different platforms, including Windows, Linux, and Mac OS. You can get it from the website http://filezilla-project.org/. Creating database and user Before installing and configuring Joomla! and Jobs! extension, we also need to create a database and a database user. You can easily add a new database and any user by using phpMyAdmin in XAMPP server environment. To add a database, by using phpMyAdmin, you must follow the following steps: Type the address http://localhost/phpmyadmin in the web browser. The front page of phpMyAdmin will be displayed. Type a name for the database you want to create. For example, my_db in the Create new Database field and then click on the Create button to create the database. To be connected with the database, we need a user account. You can add a user account by clicking on the Privileges tab of phpMyAdmin. You will see all users' information. Click on Add a new User link of Privileges window. After clicking on the link, a new window will appear. Provide the required information in the Login Information section of this window and then click on the Go button. We have now completed the preparation stage of installing Joomla!.
Read more
  • 0
  • 0
  • 3597

Packt
24 Sep 2010
6 min read
Save for later

Generating Content in WordPress Top Plugins—A Sequel

Packt
24 Sep 2010
6 min read
  WordPress Top Plugins Find and install the best plugins for generating and sharing content, building communities and generating revenue Learn WordPress plugin basics for both Macs and PCs Focuses exclusively on 100% free and open plugins Screenshots for each plugin Organized by complexity to install and manage Search Terms for automatic installation of plugins Instructions on configuring and setting up the more complex plugins Read more about this book (For more resources on WordPress see here.) CForms II By Oliver Seidel (http://deliciousdays.com) Why it's awesome: Super easy to create engaging and secure forms Why it was picked: Popularity and ease of use Manual Install URL: http://deliciousdays.com Automatic Install search term: CFORMS Geek level: Webmaster Configuration location: Top Navigation | cforms II Used in: Posts, widgets, pages WordPress lacks any methods for creating a form (beyond the comment form) to collect visitor questions, contact info, or any other type of communication data. CForms makes creating custom forms as easy as pointing and clicking. Forms can be embedded throughout your blog, including widgets, posts, and pages. CForms administration CForms is a very powerful and somewhat complex plugin, so let's take a moment to get familiar with the Administration section. Form Action is the somewhat hard-to-find Admin Actions. You will use this expandable menu to save your changes, delete, create, and back up your forms. Form Selection is how you switch between your different forms. Form Name is where you will define your form's name. This name will be used when you want to insert this form into a blog post, page, or widget. Fields are the individual inputs your form will contain. Kind of Field allows you to define a field as either a single line of text, multi-lined text, multiple-choice, captchas, file uploader, and a lot more. Add New Field will insert a new field into your form. Modifying the default form Once inside the CForms Administration, located at Settings | CForms II, you will see your "default form". This default form is the basic information needed to create a "Contact Us" form on your blog, including the field's name, e-mail, website, and message. Click the Field Sort Order icon, and drag it to reorder the field to any other position. Use the Default Value icon to specify what the field's default value should be, as well as mouse over values and error messages. Use the Delete this Field icon to remove a field from your form. Adding your form to a page, post, or widget CForms can be inserted into pages, posts, and widgets. However, the widget version is awfully wide and will most likely not look right in your sidebar. At the time of writing, there is no apparent way to modify this. Once inside the page or post editor, you will find a new icon added to your "Descriptions" toolbar. Once you click the CForms icon, you will need to select which form you would like to include. The drop-down box will contain all of the forms you currently have active. If you would rather use the coding method to insert your form, use the WP tag <!--cforms name="My Form Name"--> or the PHP tag <?php insert_cform("my form name"); ?>. Advanced CForms customizations While CForms might not be the easier form/mailer plugin available, it is hands down the most flexible. Make sure to delve into the additional options towards the bottom of the Form Manager. File upload settings If you will be using the File Upload field, you will need to provide some additional server information for it to work properly. Specifically, you will need to define where your file should be uploaded to, the maximum file sizes, and what type of files are allowed to be uploaded. Messages, text, and button label Customize your buttons, error messages, and text non-fictions for a given form. Core Form Admin / e-mail options Inside the Core Form Admin, you will be able to turn on and off the ability to track submissions in the RSS feed, set redirection rules, set start and end dates when a form will be shown. Admin e-mail message options Configure the e-mail message that will be sent to the administrator, once a user submits a form—including setting which e-mail address to send to, the header and footer html, and the from e-mail address. Auto confirmation Automatically send your visitor a confirmation e-mail, once they submit a form by clicking the Activate Auto confirmation link. Through this option, you will be able to configure the subject and message to send, the moment a form is submitted. Multi-part / multi-page forms Create multiple page forms by activating the Multi-part form option. Once activated, the Multi-part forms panel will allow you to define what step the current form in your process is, along with the ability to add back and next buttons. Tell-A-Friend form support The Tell-A-Friend field must be activated before you can leverage it. Once activated, you will have a new field type called "tell-a-friend". This "field" is actually multiple fields that are required to tell a friend about a given web page. WP comment feature You can actually replace WordPress' comment system with CForms. This might be helpful if you would like to customize the fields that a user can submit on a comment, or if you want the user to be able to send the author an e-mail opposed to a public comment. Third-party read-notification support CForm offers integration with notification services readnotify.com and didtheyreadit.com to notify you if a user reads your e-mail. These services might cause your e-mails to be triggered as spam. MapPress—Google maps By Chris Richardson (http://wphostreviews.com) Why it's awesome: Easily hack together some neat mashups on Google's dime Why it was picked: Popularity, ease of setup Manual Install URL: http://wordpress.org/extend/plugins/mappress-google-maps-for-wordpress/ Automatic Install search term: Mappress Geek level: Newbie Configuration location: Settings | MapPress Used in: Posts, pages MapPress makes it easy to insert custom Google Maps into your blog. Once installed, you will have the option to add multiple locations by address or lat/long. You will need a Google Maps API-key, which can be obtained from http://bit.ly/gmap-api. Google requires users who customize maps to have an API key. This allows them to track usage and ensure that people are not using Google Maps outside the 'Terms and Conditions'. If you do not have a need for customizing the content on the map, then you could always bypass installing this plugin and use the embed code directly from Google Maps. Adding a map to a post or page You will now have a new panel titled MapPress during the editing or creation of a post/page. The MapPress panel is where you define the size of your map, and the specific points of interest.
Read more
  • 0
  • 0
  • 1220
Modal Close icon
Modal Close icon