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
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

How-To Tutorials

7018 Articles
article-image-whats-new-moodle-20
Packt
24 Sep 2010
9 min read
Save for later

What's New in Moodle 2.0

Packt
24 Sep 2010
9 min read
Nine years ago, in Australia, a Computer Science graduate named Martin Dougiamas was trialing a web tool he'd developed to help teachers create lessons online. Inspired by his own experiences with the outback "School of the Air". Martin's Modular Object Oriented Dynamic Learning Environment offered tutors a way to connect remotely with their students in a collaborative and supportive workspace. Did any of us foresee back then just how global a phenomenon Moodle would become? Now used by over 31 million students in over 44 thousand sites in over 200 countries, Moodle has truly changed the face of learning. With improved access to the internet, and with commercial companies being quick to spot a potential money-earner, many such Learning Management Systems have arisen since then. What makes Moodle special, however, is the fact that it has remained as Open Source technology. Anyone can use Moodle; everyone can make Moodle better. While offcial Moodle Partners will give you peace of mind if you want Moodle installed at your establishment, you are also entirely free to go for it alone. If you need advice, whether of a pedagogical or technical nature, ask in the forums at https://moodle.org/ where the doors are never closed. If you spot an error or a bug, then someone (perhaps even you) will fix it. If you have an idea for a "plug-in" that might be useful for other Moodlers worldwide, you can put forth your suggestion to the community. The world changes constantly and Moodle changes with it. Since its official "birth" in 2002, Moodle has gone through several full versions and a number of stable releases in between. You can even catch up on all the bug fixes and minor tweaks by downloading the weekly stable "+" build. This year, however, sees the advent of the latest, biggest, and most enhanced version: Moodle 2.0. It's a new "take" on an established package. It is rich with new features, and it retains all that was good from Moodle 1.9, blended with new ideas and improvements, suggested and developed by the huge Open Source community. Moodle 2.0 has been a long time in the making. Its arrival became somewhat of an in-joke on the forums of www.moodle.org. Over the last couple of years, the answer to many a query would has been "You can't do that yet, but you will be able to in Moodle 2.0" prompting one Moodle Partner to comment that alongside better navigation, cleaner appearance, more controlled activities, enhanced modules, and improved interaction, Moodle 2.0 was expected to "sort out wars and world famine". Well, they haven't quite managed that, (Although there's still time for Moodle 3.0!), but there are suffcient new features in Moodle 2 to warrant a close look. Looks cleaner, moves faster Previous versions of Moodle came with pre-installed themes, such as Cornfower or Wood, making an average Moodle site easily recognizable when meandering along the Internet. The Downloads tab on http://moodle.org/ links to a Themes section offering an array of other contributed "skins" for Moodle to enhance its appearance. Despite this, users still complained Moodle looked "clunky" in contrast with other, commercial Learning Management Systems. In recent years, the adoption of Moodle has broadened from universities and schools to major charities, businesses, and non-governmental organizations. They want integration with their websites and a clean, professional look. Moodle 2.0 has done away with the previous themes and will ultimately include 20 brand new themes, of which Boxxie , as seen in the following screenshot, is one: In the following screenshot you'll note that the Navigation block on the left has been docked to the side— this is a totally new way of moving around in Moodle 2.0. We have the option of saving space and docking — or of expanding the block as with the calendar to the right: Within a course the Navigation block will show links to individual sections and expand to the activities in those sections. It is now possible to rename the topic sections so that these names appear in the links rather than numbered topics. If you look at the following screenshot, we are in a course French for Beginners and Introduction is actually topic 0 and First Steps in French is topic 1. Note also that the link at the top My Home takes the user straight to their MyMoodle page. A new way of managing your content In Moodle 1.x, the Resource module offered the teacher in a course the ability to upload their documents, create web pages in Moodle, or even display a directory of materials. Users, who had particularly large files, say SCORM packages or multimedia for example, were able to upload via FTP once they knew the directory number for their course and were granted the rights to do so. Moodle 2.0 does away with most of this, using a different philosophy for file management. It has more functionality and is more secure; however, for some it might initially appear more complex to manoeuvre. Compare and contrast the Add a resource… drop-down in Moodle 2.0 (on the left) and Moodle 1.9 on the right: Note the simpler, clearer terms: File (instead of link to a file or web site) Folder (instead of Display a directory) Page (instead of Compose a web page/Compose a text page) URL (instead of link to a file or web site) While you are still able to upload all your word-processed documents and Powerpoint presentations, you can also easily embed media from other sites such as http://www.youtube.com/ or http://www.flickr.com/ from the new text editor (based on the popular tinyMCE editor as used in WordPress for example). Here's a screenshot of the so-called File Picker where you can see that, alongside files already in Moodle and files you might want to upload, there is a link and the facility to search YouTube: More places to have your say With the addition of a Comments facility in Moodle 2.0 it is now easier than ever for users to give feedback, voice their opinions and generally make their presence felt in your online community. A Comments block may be included on your course page to give the students the opportunity to rate the course or suggest improvements, as shown in the following screenshot: We get far more control over the location and positioning of blocks in Moodle 2.0. Due to this we're not just restricted to having the Comments block (or others) on our course page. Most screens will allow us to add a block now, so we could for example have comments on the diffculty of Quiz questions, or comments on the suitability of a particular uploaded resource. The same commenting feature has also been applied to the standard Moodle blog, such that users may now, at last, comment on each others' entries. Existing activities updated and improved A lot of time and effort has gone into making existing Moodle modules such as the Wiki, Quiz, and, Workshop easier to manage and more user-friendly. The latter are two of my favorites, both very powerful yet not immediately intuitive, particularly to new users. While I found the results they gave worth the initial hours spent figuring out how to set them up, I also found that many teachers felt daunted by their complexity. As a trainer I always felt the need to apologize before I showed people how to use the Quiz, and I only went through the Workshop settings on request from advanced users. Open Source, by its nature, depends on collaboration, and several Moodle developers and enthusiasts have made significant changes to the Quiz and Workshop modules – in fact, the Workshop module has been virtually rewritten for Moodle 2.0, so if you shied away from it before, now is definitely the time to give it another chance. This has improved the display and the search facility of the Quiz question bank, making it not only easier to locate and reuse previously made questions but also simplifying the process needed to create a new quiz from scratch — making the Moodle Quiz a realistic option for a new user to tackle without fear of confusion. The changes to the Workshop now give us a clear view of the different stages of the assessment process: Moodle has always had a Wiki module but with limited functionality. Some users preferred alternative wikis such as the OUwiki or NWiki instead. Indeed, http://moodle.org/ itself chose Mediawiki for its comprehensive and collaborative documentation. Moodler. The new, improved wiki for Moodle 2.0, incorporates features from OUwiki and NWiki and we'll investigate how they can enhance our students' learning experience. Moodle's built-in blog feature has always been very limited, for example, offering no comment facility. Attached as it is to a user's profile meant that a student could only have one blog, rather than a number of blogs according to which course they were in. Again, for this reason, blogging Moodlers around the world looked elsewhere — such as to WordPress or to the Open University's OUBlog. Moodle's blog is now much enhanced. If you have an external blog you can now import its posts (based on a feed URL and on tags) and use it within Moodle. You can now also associate an entry to a particular course, attach more than one file to your entry, have a proper RSS feed, and (with the Comments API mentioned earlier) make it possible for permitted users finally to give you their thoughts on your thoughts! Another successful vehicle for the exchanging of ideas is the Messaging block. This block is controversial in some circles, such as in schools with younger learners, where some consider it a distraction of the MSN type while others see it as an essential means of instant communication. The messaging block has been revamped and is now event-driven, allowing users to control which messages they receive and how.
Read more
  • 0
  • 0
  • 4838

article-image-generating-content-wordpress-top-plugins
Packt
24 Sep 2010
4 min read
Save for later

Generating Content in WordPress Top Plugins

Packt
24 Sep 2010
4 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.) GD Star Rating By Milan Petrovic (http://dev4press.com/) Why it's awesome: Quickly adds ratings and ranking to your blog posts Why it was picked: Super easy to get running, offers lots of customizations Manual Install URL: http://wordpress.org/extend/plugins/gd-star-rating/ Automatic Install search term: GD Star Rating Geek level: Newbie Configuration location: Top Navigation | GD Star Rating Used in: Posts, comments, pages If you want to know what your readers like, then you need to allow them to quickly rate your individual posts and rank other readers' comments; GD Star Rating does exactly this. Don't be fooled by its deceptively simple outer shell. Those rating stars are backed by a massive administrative area that allows you to customize virtually every aspect of how a user rates your blog's content. For example, you can change how the stars look, how many times to allow users to vote, where to display ratings, and much, much more. In addition to being crazily customizable, GD Star Rating also offers awesome analytics on who's rating what, which items are popular, and virtually any other data point you could imagine. Fixing the default ratings Out of the box, GD Star Rating will include both a 10 Star Rating bar and a Thumbs Up/Thumbs Down ranking scale. Obviously, a post doesn't need both, and 10 Star Rating will work just fine for all of our blog posts. The Thumbs Up/Thumbs Down will be great for our comments. To access GD Star Rating's main settings, visit GD Star Rating | Settings. Turning off Thumbs Up/Thumbs Down on posts Uncheck the checkbox next to For Individual Posts and For Individual Pages. Turning off Star Ratings on comments Uncheck the checkbox next to For Comments for Posts and For Comments for Pages. Better Tag Cloud By Nicolas Kuttler (http://www.nkuttler.de/) Why it's awesome: It's not really awesome, just wonderfully practical and create a nicely customizable TagCloud Why it was picked: Updated often, flexibility of placement, color customizations Manual Install URL: http://wordpress.org/extend/plugins/nktagcloud/ Automatic Install search term: Better Tag Cloud Geek level: Newbie Configuration location: Settings | Better Tag Cloud Used in: Posts, pages, widgets The Tag Cloud widget that comes with WordPress is very simple. Luckily, Nicolas Kuttler took the initiative to create a wonderful replacement. Not only does Better Tag Cloud give you a new widget, it also lets you include your tag cloud in posts and pages. Use the shortcode [nktagcloud] to include Better Tag Cloud in a post or page. Yet Another Related Posts Plugin (YARPP) By Michael Yoshitaka Erlewine (http://mitcho.com/) Why it's awesome: Search engine optimization and increasing average time on site for you visitors Why it was picked: Accuracy of the relation algorithm Manual Install URL: http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/ Automatic Install search term: YARPP Geek level: Newbie Configuration location: Settings | Related Posts (YARPP) Used in: Posts Yet Another Related Posts Plugin (YARPP) helps your readers and the search engine bots to find other posts on your website that are similar to the one they are currently reading. Once installed and activated, the YARPP plugin is virtually done. Check out one of your blog posts, and see if you like the results. Below the article will be a list of similar posts to the one you're reading. While out of the box YARPP will satisfy 80 percent of the people, you should check out the YARPP settings, as it offers a ton of configuration options.
Read more
  • 0
  • 0
  • 1943

article-image-all-new-open-source-books-packt
Packt
24 Sep 2010
2 min read
Save for later

All New Open Source Books from Packt

Packt
24 Sep 2010
2 min read
  BackTrack 4: Assuring Security by Penetration Testing Master the art of penetration testing with BackTrack Click for more information Linux Shell Scripting Cookbook Solve real-world shell scripting problems with over 110 simple but incredibly effective recipes Click for more information PostgreSQL 9.0 High Performance Accelerate your PostgreSQL system Click for more information PostgreSQL 9 Admin Cookbook Over 80 recipes to help you run an efficient PostgreSQL 9.0 database Click for more information GIMP 2.6 cookbook Over 50 recipes to produce amazing graphics with the GIMP Click for more information jQuery 1.4 Reference Guide If you are looking for a comprehensive reference guide to this popular JavaScript library, this book is for you. Revised and updated for version 1.4 of jQuery, this book offers an organized menu of every jQuery method, function, and selector. Click for more information jQuery 1.4 Animation Techniques: Beginners Guide Quickly master all of jQuery’s animation methods and build a toolkit of ready-to-use animations using jQuery 1.4 Click for more information WordPress 3 Ultimate Security Protect your WordPress site and its network Click for more information Squid Proxy Server 3.1: Beginner's Guide Improve the performance of your network using the caching and access control capabilities of Squid Click for more information Drupal 7 Themes Create new themes for your Drupal 7 site with a clean layout and powerful CSS styling Click for more information Joomla! VirtueMart 1.1 Theme and Template Design Give a unique look and feel to your VirtueMart e-Commerce store Click for more information OpenCV 2 Computer Vision Application Programming Cookbook Over 50 recipes to master this library of programming functions for real-time computer vision Click for more information  
Read more
  • 0
  • 0
  • 1270

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

article-image-data-transactions-made-easy-mysql-and-python
Packt
24 Sep 2010
9 min read
Save for later

Data Transactions Made Easy with MySQL and Python

Packt
24 Sep 2010
9 min read
  MySQL for Python Integrate the flexibility of Python and the power of MySQL to boost the productivity of your Python applications Implement the outstanding features of Python's MySQL library to their full potential See how to make MySQL take the processing burden from your programs Learn how to employ Python with MySQL to power your websites and desktop applications Apply your knowledge of MySQL and Python to real-world problems instead of hypothetical scenarios A manual packed with step-by-step exercises to integrate your Python applications with the MySQL database server Read more about this book (For more resources on Phython see here.) When we deal with large amounts of data that are all going into the same database, running single instances of individual INSERT commands can take a ridiculous amount of time and waste a considerable amount of I/O. What we need is a way to insert multiple items in one go. In this article, Albert Lukaszewski, PhD, author of MySQL for Python, we will look at the following: How iteration can help us execute several individual INSERT statements rapidly Using executemany() to submit several INSERT statements in one go When not to use executemany() Throttling how much data is inserted at a time The problem You need to collate and rearrange the contents of several databases into one table whenever a given indicator is achieved (the indicator may be, among other things, a stock price, a value in one of the databases, or the flight pattern of African swallows). The format and length of the tables are predictable. There are 5,000 records in each table so manually running a separate INSERT statement for each record is not a viable option even with the programs used. The problem calls for a means of iterating through a series and changing the INSERT statement automatically. We could pursue one of the following two ways to do this: Write a MySQL script to insert the data in batch mode Iterate over the data to form and execute a MySQL INSERT statement accordingly None of these are a very good solution to the present problem. Why not a MySQL script? As we have seen when we created the world and Sakila databases, a MySQL script can contain the schema of a database, the values of the database tables, or both. To create data quickly, there is nothing better. However, following are the several drawbacks to using a script in this scenario: Lack of automation Debugging the process Inefficient I/O Lack of automation Barring the use of an automation daemon (for example, cron) to run a cron job or a similar scheduled task, a DBA or their designate would have to run the script. This unnecessarily consumes time. It is comparable to swapping tape backups when automated backup services are available and proven. Most modern computing systems support automatic task scheduling. On Unix-based systems like Linux and Mac OS X, one can schedule processes to be run at set times and on a regular rotation. One of the most widely used programs for such scheduling is cron. A single scheduled task in cron has thus come to be known as a cron job. Debugging the process Creating a MySQL script can be a very tedious task, and the slightest error or oversight can ruin the entire process. Using the --force flag causes MySQL to ignore errors in the source file. It is therefore not something that should be used regularly if one values the integrity of data. If the script is malformed for any reason, a two minute data insertion job can quickly become a two hour (at least!), unscheduled debugging process. Inefficient I/O Dumping large amounts of data on MySQL can create latency across the network. If the script were run by a DBA or similar, that person should rightly evaluate the state of the network before running it. Regardless of experience and training, judgment calls naturally require estimation and can result in ambiguous decision-making. While this is unavoidable, it should be minimized where possible. If the server is experiencing high traffic, the DBA would need to find something else to do and reschedule the running of the script. This randomly postpones the time of execution and the availability of the results. Also, it runs the risk of the DBA forgetting to execute the script. If the script is automated with a cron job or similar, we risk dumping a lot of data onto MySQL at a time when others are doing more time sensitive tasks. On most servers, we can background the process, so it does not adversely impact the client processes. This, however, only ensures that the process will be run. It does not guarantee that the process will be finished by a particular time. Why not iterate? Every time a program iterates to read or insert data, it creates a certain amount of I/O processing. Depending on how a program is written will determine how much I/O is included in each loop. A test sample: generating primes To illustrate this, consider a program that accepts a series of numbers, generates the prime numbers that are equal to or less than each of those numbers and inserts those numbers into a database called primes with a table of the same name. The table has the following description: mysql> describe primes; and can be created with the following statement: CREATE TABLE `primes` (`ID` int(11) NOT NULL auto_increment, `NUMBER` int(11) NOT NULL default '0', `PRIMES` varchar(300) NOT NULL default '0', PRIMARY KEY (`ID`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; Using the sys module to handle user input, the string module to split the series of entries, and MySQLdb to handle the database connection, we get the following preamble: #!/usr/bin/env pythonimport MySQLdb, string, sys Next, we need a function that will generate the prime numbers to a certain limit called n. def primes(n): """Returns a list of prime numbers up to n using an algorithm based onthe Sieve of Eratosthenes.""" if n < 2: return ['A number less than two is not prime by definition.']else: s = range(3,n+1,2) maxfactor = n ** 0.5 half = (n+1)/2-1 i = 0 m = 3 while m <= maxfactor: if s[i]: j = (m*m-3)/2 s[j] = 0 while j < half: s[j] = 0 j += m i = i + 1 m = 2 * i + 3return str([2] + [x for x in s if x]) This algorithm is based on the Sieve of Eratosthenes, one of the simplest ways of generating prime numbers. It uses the following steps: Generate a list of integers from 2 to n. Discount the multiples of each number that remains and that has a square less than or equal to n; this leaves all the prime factors of n. Stop when the square of the number in the series is greater than n. Prime numbers by definition have no other factor, but themselves and one. The lowest prime number is therefore 2. For this reason, we check whether n is less than 2 and return a message accordingly. For this program, we want a string returned so we convert the results before we return them. For more on the Sieve of Eratosthenes and how it works, see the entry on Wikipedia: http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes The previous algorithm can be found in many forms and in many languages on the Internet. Two of the best that informed this discussion are as follows: http://www.maths.abdn.ac.uk/~igc/tch/mx3015/notes/node79.html http://code.activestate.com/recipes/366178/ Next, we create a function to form and execute the INSERT statement. def insert(n, p, cur): statement = """INSERT INTO primes(number, primes) VALUES("%s", "%s")""" %(n, p) cur.execute(statement) return statement This function takes the number, the primes, and the cursor object handle as arguments. Finally, our main() function looks like this: def main(): numbers = sys.argv[1] iterations = numbers.split(',') for n in iterations: mydb = MySQLdb.connect(host = 'localhost', user = 'skipper', passwd = 'secret', db = 'primes')cur = mydb.cursor() n = int(n)try: p = primes(n) if p.isalpha(): raise ValueErrorelse: statement = insert(n, p, cur) print "Data entered with the following statement:n", statement except: raise We split the values passed by the user and iterate through them with a for loop. Note that we include the database connection and cursor object creation as part of the iteration. We then include the usual if clause to call main(): if __name__ == '__main__': main() Comparing execution speeds We can test the speed of this program by giving it a series of simple primes to generate—even of the same number. Here we call it with a series of sevens to process and with the Unix command time to measure its speed. time ./primes.py "7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7" Given this series of sevens, we get a real execution time of 0.175 seconds. If we rearrange the program by moving the mydb and cur assignment lines to follow immediately after the preamble (remembering to adjust the indentation), we get an execution speed of 0.138 seconds. This difference in speed (0.037 seconds) is not particularly significant on a local system with a single user, but it would be magnified synergistically on a server with hundreds or thousands of users. So, we see that, if the connection and cursor is created each time, the program will be less efficient than if the loop contained only the execution of the statement and the connection and cursor were persistent in the cycle of the program. However, even just passing a series of single statements to MySQL through Cursor.execute() will consume more in protocol than necessary. Excessive iteration consumes resources needlessly.
Read more
  • 0
  • 0
  • 6447

article-image-configuring-wcm-workflows
Packt
23 Sep 2010
4 min read
Save for later

Configuring WCM Workflows

Packt
23 Sep 2010
4 min read
(For more resources on Afresco 3, see here.) Workflows can be configured for both web forms and non-generated web content. In order to submit content to the Staging Sandbox, workflows need to be configured. We will discuss shortly how form-based and file-based workflow can be configured, and also how content can be submitted to the Staging box. Associating workflows to web forms Workflow for web forms can be configured using the Create Web Form Wizard or the Edit Web Form wizard. Using these approaches, workflows can be configured for all web projects and for a specific web project. Assuming that we have already created a web form, we will use the same web form to drive a workflow. In this example, we have to use the Edit Web Form Wizard. Follow these steps to assign a workflow for the web form: Ensure that the Alfresco server is up and running. Go to Company Home Data Dictionary | Web Forms|. Click on the Edit Web Form action under the training (web form name) space. Clicking on this will open Edit Web Form Wizard. Click on Next twice to reach the Configure Workflow window. Select the Yes radio button and click on Next. Click on Finish. Associating workflows to web projects To assign a workflow for a specific project, you can use two approaches. The first approach is by using the Create Web Project Wizard that will be used if you are creating a new web project. The second approach is by using the Edit Web Project Wizard. We will be using the second approach since we have already created the Cignex web project. Follow these steps to associate workflow for a web form: Ensure that the Alfresco server is up and running. Go to Company Home Web Projects | Cignex|. Select Edit Web Project Settings from the action menu. Click on Next. On the next screen, click on Next. In the Step Three window, you will notice the added web forms in the panel as shown in the following screenshot. You can see the Configure Workflow button available for each web form. This button is enabled only for those web forms for which we have configured workflows. Notice the attention icon next to the workflow. This indicates a workflow has been selected but not configured: On clicking the Configure Workflow button, the Configure Workflow window is opened. This window is used to configure form-based workflows (web form generated content). This is specific for web forms only. Fill out the details as shown in the following screenshot: Click on OK. Now, if you notice, the attention icon disappears. Click on Next. You will again see the Configure Workflow window. Click on the Add to List button to add the workflow for the web project. Once the workflow is added in the panel, you can configure file-based workflows (non-web form generated content). They are configured based on filename pattern matching. In Workflow Settings, note the default regex pattern matches .*. This default means that any asset web form generated, and non-web form generated, will go through this review process. Also, you can add the Web Site Submission workflow multiple times in this wizard. For each instance you can configure a different chain of reviewers for different sections of the websites or types of assets by modifying the regex pattern match in Workflow Settings, for example, .css, .html. Please note that the Configure Workflow window can be used for both file and non-web form generated assets. But this window is mainly used for non-web form generated assets. Click on Finish. Submitting content to the Staging box Content can be submitted in two ways. The first option is by using the Edit Web Content Wizard or the Create Web Content Wizard. With this option you can submit only form-based content. The second option is by using the Submit Selected or Submit All option provided under Modified Items. With this option you can submit both form-based assets and non-form based assets. Using the Edit Web Content wizard We assume that the web content is already created. So we are going to use the Edit Web Content wizard. Log in as Mark Steven, who is the Content Manger of the Cignex project. Follow these steps to directly submit content to the workflow: Go to Company Home Web Projects | Cignex|. Select the Browse Website option to browse all files and folders. Go to the common/inc folder. Click on the Edit action placed next to the training.html file. Click on Next. The Summary window is opened. It has the functionality to directly submit content to the workflow (this functionality is also available in the Create Web Content Wizard). Select those checkboxes to submit directly. This saves you from initiating a separate submission process. Click on Finish.
Read more
  • 0
  • 0
  • 2247
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 €18.99/month. Cancel anytime
article-image-openstreetmap-gathering-data-using-gps
Packt
23 Sep 2010
19 min read
Save for later

OpenStreetMap: Gathering Data using GPS

Packt
23 Sep 2010
19 min read
  OpenStreetMap Be your own cartographer Collect data for the area you want to map with this OpenStreetMap book and eBook Create your own custom maps to print or use online following our proven tutorials Collaborate with other OpenStreetMap contributors to improve the map data Learn how OpenStreetMap works and why it's different to other sources of geographical information with this professional guide Read more about this book (For more resources on OpenStreetMap, see here.) OpenStreetMap is made possible by two technological advances: Relatively affordable, accurate GPS receivers, and broadband Internet access. Without either of these, the job of building an accurate map from scratch using crowdsourcing would be so difficult that it almost certainly wouldn't work. Much of OpenStreetMap's data is based on traces gathered by volunteer mappers, either while they're going about their daily lives, or on special mapping journeys. This is the best way to collect the source data for a freely redistributable map, as each contributor is able to give their permission for their data to be used in this way. The traces gathered by mappers are used to show where features are, but they're not usually turned directly into a map. Instead, they're used as a backdrop in an editing program, and the map data is drawn by hand on top of the traces. This means you don't have to worry about getting a perfect trace every time you go mapping, or about sticking exactly to paths or roads. Errors are canceled out over time by multiple traces of the same features. OpenStreetMap uses other sources of data than mappers' GPS traces, but they each have their own problems: Out-of-copyright maps are out-of-date, and may be less accurate than modern surveying methods. Aerial imagery needs processing before you can trace it, and it doesn't tell you details such as street names. Eventually, someone has to visit locations in person to verify what exists in a particular place, what it's called, and other details that you can't discern from an aerial photograph If you already own a GPS and are comfortable using it to record traces, you can skip the first section of this article and go straight to Techniques. If you want very detailed information about surveying using GPS, you can read the American Society of Civil Engineers book on the subject, part of which is available on Google Books at http://bit.ly/gpssurveying. Some of the details are out-of-date, but the general principles still hold. If you are already familiar with the general surveying techniques, and are comfortable producing information in GPX format, you can skip most of this article and head straight for the section Adding your traces to OpenStreetMap. What is GPS? GPS stands for Global Positioning System, and in most cases this refers to a system run by the US Department of Defense, properly called NAVSTAR. The generic term for such a system is a Global Navigation Satellite System (GNSS), of which NAVSTAR is currently the only fully operational system. Other equivalent systems are in development by the European Union (Galileo), Russian Federation (GLONASS), and the People's Republic of China (Compass). OpenStreetMap isn't tied to any one GNSS system, and will be able to make use of the others as they become available. The principles of operation of all these systems are essentially the same, so we'll describe how NAVSTAR works at present. NAVSTAR consists of three elements: the space segment, the control segment, and the user segment. The space segment is the constellation of satellites orbiting the Earth. The design of NAVSTAR is for 24 satellites, of which 21 are active and three are on standby. However, there are currently 31 satellites in use, as replacements have been launched without taking old satellites out of commission. Each satellite has a highly accurate atomic clock on board, and all clocks in all satellites are kept synchronized. Each satellite transmits a signal containing the time and its own position in the sky. The control segment is a number of ground stations, including a master control station in Colorado Springs. These stations monitor the signal from the satellites and transmit any necessary corrections back to them. The corrections are necessary because the satellites themselves can stray from their predicted paths. The user segment is your GPS receiver. This receives signals from multiple satellites, and uses the information they contain to calculate your position. Your receiver doesn't transmit any information, and the satellites don't know where you are. The receiver has its own clock, which needs to be synchronized with those in the space segment to perform its calculations. This isn't the case when you first turn it on, and is one of the reasons why it can take time to get a fix. Your GPS receiver calculates your position by receiving messages from a number of satellites, and comparing the time included in each message to its own clock. This allows it to calculate your approximate distance from each satellite, and from that, your position on the Earth. If it uses three satellites, it can calculate your position in two dimensions, giving you your latitude (lat) and longitude (long). With signals from four satellites, it can give you a 3D fix, adding altitude to lat and long. The more satellites your receiver can "see", the more accurate the calculated position will be. Some receivers are able to use signals from up to 12 satellites at once, assuming the view of the satellites isn't blocked by buildings, trees, or people. You're obviously very unlikely to get a GPS fix indoors. Many GPS receivers can calculate the amount of error in your position due to the configuration of satellites you're using. Called the Dilution of Precision (DOP), the number produced gives you an idea of how good a fix you have given the satellites you can get a signal from, and where they are in the sky. The higher the DOP, the less accurate your calculated position is. The precision of a GPS fix improves with the distance between the satellites you're using. If they're close together, such as mostly directly overhead, the DOP will be high. Use signals from satellites spread evenly across the sky, and your position will be more accurate. Which satellites your receiver uses isn't something you can control, but more modern GPS chipsets will automatically try to use the best configuration of satellites available, rather than just those with the strongest signals. DOP only takes into account errors caused by satellite geometry, not other sources of error, so a low DOP isn't a guarantee of absolute accuracy. The system includes the capability to introduce intentional errors into the signal, so that only limited accuracy positioning is available to non-military users. This capability, called Selective Availability (SA) was in use until 1990, when President Clinton ordered it to be disabled. Future NAVSTAR satellites will not have SA capabilities, so the disablement is effectively permanent. The error introduced by SA reduced the horizontal accuracy of a civilian receiver, typically to 10m, but the error could be as high as 100m. Had SA still been in place, it's unlikely that OpenStreetMap would have been as successful. NAVSTAR uses a coordinate system known as WGS84, which defines a spheroid representing the Earth, and a fixed line of longitude or datum from which other longitudes are measured. This datum is very close to, but not exactly the same as the Prime Meridian at Greenwich in South East London. The equator of the spheroid is used as the datum for latitude. Other coordinate systems exist, and you should note that no printed maps use WGS84, but instead use a slightly different system that makes maps of a given area easier to use. Examples of other coordinate systems include the OSGB36 system used by British national grid references. When you create a map from raw geographic data, the latitudes and longitudes are converted to the x and y coordinates of a flat plane using an algorithm called a projection. You've probably heard of the Mercator projection, but there are many others, each of which is suitable for different areas and purposes. What's a GPS trace? A GPS trace or tracklog is simply a record of position over time. It shows where you traveled while you were recording the trace. This information is gathered using a GPS receiver that calculates your position and stores it every so many seconds, depending on how you have configured your receiver. If you record a trace while you're walking along a path, what you get is a trace that shows you where that path is in the world. Plot these points on a graph, and you have the start of a map. Walk along any adjoining paths and plot these on the same graph, and you have something you can use to navigate. If many people generate overlapping traces, eventually you have a fully mapped area. This is the general principle of crowdsourcing geographic data. You can see the result of many combined traces in the following image. This is the junction of the M4 and M25 motorways, to the west of London. The motorways themselves and the slip roads joining them are clearly visible. Traces are used in OpenStreetMap to show where geographical features are, but usually only as a source for drawing over, not directly. They're also regarded as evidence that a mapper has actually visited the area in question, and not just copied the details from another copyrighted map. Most raw GPS traces aren't suitable to be made directly into maps, because they contain too many points for a given feature, will drift relative to a feature's true position, and you'll also take an occasional detour. Although consumer-grade GPS receivers are less accurate than those used by professional surveyors, if enough traces of the same road or path are gathered, the average of these traces will be very close to the feature's true position. OpenStreetMap allows mappers to make corrections to the data over time as more accurate information becomes available. In addition to your movements, most GPS receivers allow you to record specific named points, often called waypoints. These are useful for recording the location of point features, such as post boxes, bus stops, and other amenities. We'll cover ways of using waypoints later in the article. What equipment do I need? To collect traces suitable for use in OpenStreetMap, you'll need some kind of GPS receiver that's capable of recording a log of locations over time, known as a track log, trace, or breadcrumb trail. This could be a hand-held GPS receiver, a bicycle-mounted unit, a combination of a GPS receiver and a smartphone, or in some cases a vehicle satellite navigation system. There are also some dedicated GPS logger units, which don't provide any navigation function, but merely record a track log for later processing. You'll also need some way of getting the recorded traces off your receiver and onto your PC. This could be a USB or serial cable, a removable memory card, or possibly a Bluetooth connection. There are reviews of GPS units by mappers in the OpenStreetMap wiki. There are also GPS receivers designed specifically for surveying, which have very sensitive antennas and link directly into geographic information systems (GIS). These tend to be very expensive and less portable than consumer-grade receivers. However, they're capable of producing positioning information accurate to a few centimeters rather than meters. You also need a computer connected to the Internet. A broadband connection is best, as once you start submitting data to OpenStreetMap, you will probably end up downloading lots of map tiles. It is possible to gather traces and create mapping data while disconnected from the Internet, but you will need to upload your data and see the results at some point. OpenStreetMap data itself is usually represented in Extensible Markup Language (XML) format, and can be compressed into small files. The computer itself can be almost any kind, as long as it has a web browser, and can run one of the editors, which Windows, Mac OS X, and Linux all can. You'll probably need some other kit while mapping to record additional information about the features you're mapping. Along with recording the position of each feature you map, you'll need to note things such as street names, route numbers, types of shops, and any other information you think is relevant. While this information won't be included in the traces you upload on openstreetmap.org, you'll need it later on when you're editing the map. Remember that you can't look up any details you miss on another map without breaking copyright, so it's important to gather all the information you need to describe a feature yourself. A paper notebook and pencil is the most obvious way of recording the extra information. They are inexpensive and simple to use, and have no batteries to run out. However, it's difficult to use on a bike, and impossible if you're driving, so using this approach can slow down mapping. A voice recorder is more expensive, but easier to use while still moving. Record a waypoint on your GPS receiver, and then describe what that waypoint represents in a voice recording. If you have a digital voice recorder, you can download the notes onto your PC to make them easier to use, and JOSM—the Java desktop editing application—has a support for audio mapping built-in. A digital camera is useful for capturing street names and other details, such as the layout of junctions. Some recent cameras have their own built-in GPS, and others can support an external receiver, and will add the latitude, longitude, and possibly altitude, often known as geotags, to your pictures automatically. For those that don't, you can still use the timestamp on the photo to match it to a location in your GPS traces. We'll cover this later in the article. Some mappers have experimented with video recordings while mapping, but the results haven't been encouraging so far. Some of the problems with video mapping are: It's difficult to read street signs on zoomed-out video images, and zooming in on signs is impractical. If you're recording while driving or riding a bike, the camera can only point in one direction at once, while the details you want to record may be in a different direction. It's difficult to index recordings when using consumer video cameras, so you need to play the recording back in real time to extract the information, a slow process. Automatic processing of video recordings taken with multiple cameras would make the process easier, but this is currently beyond what volunteer mappers are able to afford. Smartphones can combine several of these functions, and some include their own GPS receiver. For those that don't, or where the internal GPS isn't very good, you can use an external Bluetooth GPS module. Several applications have been developed that make the process of gathering traces and other information on a smartphone easier. Look on the Smartphones page on the OpenStreetMap wiki at http://wiki.openstreetmap.org/wiki/Smartphones. Making your first trace Before you set off on a long surveying trip, you should familiarize yourself with the methods involved in gathering data for OpenStreetMap. This includes the basic operation of your GPS receiver, and the accompanying note-taking. Configuring your GPS receiver The first thing to make sure is that your GPS is using the W GS84 coordinate system. Many receivers also include a local coordinate system in their settings to make them easier to use with printed maps. So check in your settings which system you're getting your location in. OpenStreetMap only uses WGS84, so if you record your traces in the wrong system, you could end up placing features tens or even hundreds of meters away from their true location. Next, you should set the recording frequency as high as it will go. You need your GPS to record as much detail as possible, so setting it to record your location as often as possible will make your traces better. Some receivers can record a point once per second; if yours doesn't, it's not a problem, but use the highest setting (shortest interval) possible. Some receivers also have a "smart" mode that only records points where you've changed direction significantly, which is fine for navigation, but not for turning into a map. If your GPS has this, you'll need to disable it. One further setting on some GPSs is to only record a point every so many metres, irrespective of how much time has elapsed. Turning this on can be useful if you're on foot and taking it easy, but otherwise keep it turned off. Another setting to check, particularly if you're using a vehicle satellite navigation system, is "snap to streets" or a similar name. When your receiver has this setting on, your position will always be shown as being on a street or a path in its database, even if your true position is some way off. This causes two problems for OpenStreetMap: if you travel down a road that isn't in your receiver's database, its position won't be recorded, and the data you do collect is effectively derived from the database, which not only breaks copyright, but also reproduces any errors in that database. Next, you need to know how to start and stop recording. Some receivers can record constantly while they're turned on, but many will need you to start and stop the process. Smartphone-based recorder software will definitely require starting and stopping. If you're using a smartphone with an external Bluetooth GPS module, you may also need to pair the devices and configure the receiver in your software. Once you're happy with your settings, you can have a trial run. Make a journey you have to make anyway, or take a short trip to the shops and back (or some other reasonably close landmark if you don't live near shops). It's important that you're familiar with your test area, as you'll use your local knowledge to see how accurate your results are. Checking the quality of your traces When you return, get the trace you've recorded off your receiver, and take a look at it on your PC using an OpenStreetMap editor or by uploading the trace. Now, look at the quality of the trace. Some things to look out for are, as follows: Are lines you'd expect to be straight actually straight, or do they have curves or deviations in them? A good trace reflects the shape of the area you surveyed, even if the positioning isn't 100% accurate. I f you went a particular way twice during your trip, how well do the two parts of the trace correspond? Ideally, they should be parallel and within a few meters from each other. When you change direction, does the trace reflect that change straight away, or does your recorded path continue in the same direction and gradually turn to your new heading? If you've recorded any waypoints, how close are they to the trace? They should ideally be directly on top of the trace, but certainly no more than a few meters away. The previous image shows a low-quality GPS trace. If you look at the raw trace on the left, you can see a few straight lines and differences in traces of the same area. The right-hand side shows the trace with the actual map data for the area, showing how they differ. In this image, we see a high-quality GPS trace. This trace was taken by walking along each side of the road where possible. Note that the traces are straight and parallel, reflecting the road layout. The quality of the traces makes correctly turning them into data much easier. If you notice these problems in your test trace, you may need to alter where you keep your GPS while you're mapping. Sometimes, inaccuracy is a result of the make-up of the area you're trying to map, and nothing will change that, short of using a more sensitive GPS. For the situations where that's not the case, the following are some tips on improving accuracy. Making your traces more accurate You can dramatically improve the accuracy of your traces by putting your GPS where it can get a good signal. Remember that it needs to have a good signal all the time, so even if you seem to get a good signal while you're looking at your receiver, it could drop in strength when you put it away. If you're walking, the best position is in the top pocket of a rucksack, or attached to the shoulder strap. Having your GPS in a pocket on your lower body will seriously reduce the accuracy of your traces, as your body will block at least half of the sky. If you're cycling, a handlebar mount for your GPS will give it a good view of the sky, while still making it easy to add waypoints. A rucksack is another option. In a vehicle, it's more difficult to place your GPS where it will be able to see most of the sky. External roof-mounted GPS antennas are available, but they're not cheap and involve drilling a hole in the roof of your car. The best location is as far forward on your dashboard as possible, but be aware some modern car windscreens contain metal, and may block GPS signals. In this case, you may be able to use the rear parcel shelf, or a side window providing you can secure your GPS. Don't start moving until you have a good fix. Although most GPS receivers can get a fix while you're moving, it will take longer and may be less accurate. More recent receivers have a "warm start" feature where they can get a fix much faster by caching positioning data from satellites. You also need to avoid bias in your traces. This can occur when you tend to use one side of a road more than the other, either because of the route you normally take, or because there is only a pavement on one side of the road. The result of this is that the traces you collect will be off-center of the road's true position by a few meters. This won't matter at first, and will be less of a problem in less densely-featured areas, but in high-density residential areas, this could end up distorting the map slightly.
Read more
  • 0
  • 0
  • 23594

article-image-integrating-discussions-wiki-and-blog-oracle-webcenter
Packt
23 Sep 2010
9 min read
Save for later

Integrating Discussions, Wiki, and Blog with Oracle WebCenter

Packt
23 Sep 2010
9 min read
  Web 2.0 Solutions with Oracle WebCenter 11g Learn WebCenter 11g fundamentals and develop real-world enterprise applications in an online work environment Create task-oriented, rich, interactive online work environments with the help of the comprehensive Oracle WebCenter Suite 11g Accelerate the development of Enterprise 2.0 solutions by leveraging the Oracle tools Apply the basic concepts of Enterprise 2.0 for your business solutions by understanding them completely Prepare development environments that suit your enterprise needs using WebCenter applications Define collaborative work environments for the members of your organization Read more about this book (For more resources on Oracle, see here.) The Oracle WebCenter Discussions Service provides a forum tool that can be used within the organization to share information and foster collaboration. Forums are one of the most popular information exchange mechanisms used on the Internet. We are all familiar with the power of forums to create user communities and disseminate information. If you have used the Oracle Technology Network Forums, the WebCenter Discussions Service will look very familiar to you—both use the same powerful forum software. (Move the mouse over the image to enlarge.) Some of the common challenges we have found with implementing forums for the enterprise have been related to the following: Integration into the existing technology stack User and group administration using existing LDAP Support Cultural adoption With Discussions, Oracle has successfully minimized the technical level of effort required during implementation by addressing the main technical challenges (numbers 1 and 2 above). And with formal support offered, as well as the general idea that forums integration using Discussions will not be unique for each implementation, organizations can feel more comfortable about viable long-term support. Given how well Discussions addresses the first three challenges, we now view the cultural adoption as the largest challenge, which can be overcome with effective training and strategic management decisions. Forums in general have become increasingly popular within organizations and Oracle has implemented an intuitive end-user approach. The Discussions Server is installed as part of Oracle WebCenter installation. It can be accessed directly at the default location http://hostname:8890/owc_discussions. While Discussions in itself is a useful forum tool, the real power comes from the Discussions Service that enables us to embed, view, and interact with the forums as part of custom WebCenter applications where forums can be used as a means to obtain and share information by the enterprise from within the current application being used. A Wiki is a website that allows a group of editors to easily create web pages in a collaborative manner using simple markup language. The markup language helps to organize and format the web pages. Many corporations use Wikis to create documentation internally. Each employee of the company has easy access to edit the information within the wiki, and can therefore incorporate new information for the entire community. A Blog is a website that allows an individual author to post a stream of content for a community to view. The word "Blog" is derived from the contraction of "Web Log". Each item in the Blog stream can be viewed as an article. An article can be something as simple as a video or image posting, or something as formal as a newspaper article. It is up to the author to decide what content to post. Typically, authors allow members of a community to engage in dialog related to the blog article by allowing them to post comments on the article. Both the Wiki Service and the Blog Service depend on the WebCenter Wiki and Blog Server. Both services use a single connection to the single backend server. Discussions configuration Our application is built with JDeveloper 11g and connects to the Oracle WebCenter Discussions Server. Ensure that the Discussions Server is running by connecting to the Discussions Server URL (http://hostname:8890/owc_discussions). It is a good idea to populate the Discussions Server with some example users, categories, and forums. The Forums Admin Console is used to create new users and forums. The admin console can be accessed at http://hostname:8890/owc_discussions/admin. The default admin username is weblogic and the password is weblogic. This is irrespective of any username/password specified at installation time. You can configure a wide variety of settings in the Admin Console, including but not limited to the following: Content Structure: Categories, Subcategories, Forums Users and Groups Permissions Filters and Interceptors Moderation User Interface (Colors and themes) Reports and Metrics System Settings (Cache, e-mail, locale, and so on) Plugins The following is a screenshot of the admin console home page: We will not focus on configuring all aspects of the forum, but instead the main pieces required to get started and integrated into WebCenter. Specifically, we will focus on users/groups, and the overall forum content structure. Content structure The general structure for Discussions is as follows: Categories: logical grouping of discussions content Subcategories: optional subgrouping(s) Forums: Lowest-level grouping where end users can create discussion threads Threads: Entries made by end users, which contain the original entry as well as replies Within the Forums Admin Console, you can define a structure that makes sense for your organization. The same principles that apply to other forum software will apply to Discussions content structure. For the purpose of this demo, we have created a Marketing category and a Marketing Ideas forum. The following is an image of that Category Summary that reflects the new Marketing Ideas forum that was just created: User and group structure We have worked on this Discussions Service as an independent service, and hence created our users and groups manually. In an enterprise solution, you will likely hook this into your LDAP (like Oracle Internet Directory) using Enterprise Manager. Following is a screenshots of the users we have configured within the Discussions administration: As shown previously, we have added two users— amit and jimmy—with the appropriate privileges to post to the Marketing Ideas forum. Integrating Discussions with WebCenter During the remainder of this article, we will create a custom WebCenter application, which will integrate with the Discussions Server and in which we will expose a view of the forum that allows you to interact with the forum using task flows. Oracle exposes multiple task flows for the Discussions service. We have listed all the out-of-box task flows in the following table and bolded the ones we will drop into our WebCenter application: Task Flow Description Discussions Forums This task flow shows all the topics associated with a specified forum. Users can create, read, update, and delete topics based on their privileges. Discussions - Popular Topics Shows the popular topics under a given category ID or forum ID. Discussions - Recent Topics Shows all the recent topics under a given category ID or forum ID. Discussions - Watched Forums Allows users to see all their watched forums under a given category ID. Discussions - Watched Topics Allows users to see all their watched topics under a given category ID or forum ID. Discussions - Sidebar View This shows a combined view of the Popular Topics, Recent Topics, Watched Topics, and Watched Forums task flows. The main steps we will complete are as follows: Ensure the Discussions Server is running Create a WebCenter application Create a connection to the Discussions Server Create a JSF page Select appropriate Discussions Service Task Flow and embed it in the page Deploy, run, and test the application Ensuring the Discussions Server is running Before we start developing the application, ensure that the WebCenter Discussions Server is running. If the Discussions Server is not running then start the WLS_Services managed server. Using a browser, open the URL for Discussions (for example, http://hostname:8890/owc_discussions). Log in with the newly created users and post some sample articles. Creating a new WebCenter application Using JDeveloper, create a new application, selecting the WebCenter application template. Creating a JSF page Next, we will create a JSF page to host the view for the Discussions Forum. In the Application Navigator, highlight the ViewController project, right-click on it, and from the context menu select New. In the New Gallery, select JSF Page to create a new JSF page. In the Create JSF Page dialog, select a name for the page and create the page. Creating a connection to the Discussion Forum In order to use the Discussions Service in our application, we need to create a Discussions Forum connection to the Discussions Server. This connection will be used by the application to connect to the backend Discussions Server. Note that it is possible to modify the connection after the application is deployed to the WebLogic server by using the Enterprise Manager Fusion Middleware Control. To set up the discussions connection, right-click on the Connections node in Application Resources pane and select New Connection | Discussions Forum. Select a unique name for the connection such as MyDiscussions. Ensure that the Make this the connection default checkbox is ticked. Next, we have to set the property values for the forum.url and admin.user. The value of forum.url should be the URL of the Discussions server. The default admin user is weblogic. Click on Test Connection to ensure that the connection is set up properly. Click Finish to complete this step. Click on the Resource Palette and open My Catalogs. You should now see the WebCenter Services Catalog. Expand the catalog to view the various task flows available. In the task flows shown, you see the various discussions-related task flows such as the Discussion Forums, Discussions – Popular Topics, Discussions - Recent Topics, and so on. We will use these task flows in our application to create a view of the Discussion Forum.
Read more
  • 0
  • 0
  • 10354

Packt
23 Sep 2010
4 min read
Save for later

iNotes and Sametime—Chatting from the Web

Packt
23 Sep 2010
4 min read
  IBM Lotus Sametime 8 Essentials: A User's Guide Mastering Online Enterprise Communication with this collaborative software Collaborate securely with your colleagues and teammates both inside and outside your organization by using Sametime features such as instant messaging and online meetings Make your instant messaging communication more interesting with the inclusion of graphics, images, and emoticons to convey more information in fewer words Communicate with other instant messaging services and users, such as AOL Instant Messaging, Yahoo Instant Messaging, and Google Talk and know how someone's online status can help you communicate faster and more efficiently Discover how the Sametime Meeting Center can maximize the productivity of teams in your organization with the use of online meetings, training session playback, seamless voice/video integration, and screen sharing See how Sametime works in common, every-day, real-world situations with tips, resources, and detailed screenshots Read more about this book (For more resources on Microsoft see here.) Using Sametime in iNotes Let’s talk a little bit about iNotes. iNotes is the Lotus Notes web client. It works with browsers like Microsoft Internet Explorer, Mozilla Firefox, and Apple Safari. To get started using iNotes, you will need to login using a user ID and password that your e-mail administrator has given you. Your company or organization may have a central website for you to use to login, like webmail.companyname.com, so that the login URL is easy to remember. Some possible uses for iNotes and Sametime include: Beza uses a netbook and doesn’t want to install either the Notes client or Sametime Connect client. Sametime in iNotes allows him to contact his friends and colleagues. Maja primarily works from a kiosk. She can use iNotes and Sametime to access her e-mail and her company’s directory. Tatiana is traveling without her laptop. She’d like to connect with her team members. She’s stopped at an internet café where she’s able to login to iNotes and Sametime. When you first login to iNotes you might see your inbox displayed. iNotes has several modes: Full Mode, Lite Mode, and Ultralite Mode. Each of these modes has specific features. We’re going to focus on Full Mode as that is the version that allows you to login to Sametime.   If you’re used to using Notes as your e-mail client, you’ll notice a very strong similarity to the Notes 8.x mail client, so you should already be pretty comfortable with the display on the screen. Enable instant messaging Because you are using Sametime in a web browser, there are far fewer preferences that are available to you. This is because in a web browser, you don’t have the ability to control a rich Sametime client as you do when you’re running within the Sametime Connect client. The web browser version of Sametime is meant to deliver a basic set of functionality that works regardless of what type of computer you’re using. The first thing you need to make sure of is that Sametime is enabled to run within iNotes. You do this by launching the iNotes preferences in the upper-right corner of your browser window: When you click on the Preferences option, you’ll see a list of iNotes preferences, one of which allows you to enable Instant Messaging. After you select the Enable Instant messaging option, click on Save and Close. This saves the preference in your iNotes profile. At this point your screen will refresh and you’ll notice a new twisty icon just below the toolbar above your name in the Inbox. In order to get Sametime started, click on the twisty icon and highlight the option to Log On To Instant Messaging. Once you’re logged in you’ll notice your awareness changes to Available. If you have never launched Sametime in iNotes before, the browser has to load a Java application called STLinksApp to allow Sametime to work properly. You’ll see the following warning box, and you click on Run to let the browser load the application and launch Sametime. Be sure to select Always trust content from this publisher and Run. The wording for these options may vary slightly with the browser you are using. It is very important that you select this application to run. Some of the functionality we describe later may not work if it has not been installed. Check with your systems staff regarding your default browser settings and whether or not you have the system authority to run these types of Java applets.
Read more
  • 0
  • 0
  • 8576

article-image-using-templates-display-channel-content-expressionengine
Packt
23 Sep 2010
7 min read
Save for later

Using Templates to Display Channel Content in ExpressionEngine

Packt
23 Sep 2010
7 min read
  Building Websites with ExpressionEngine 2 A step-by-step guide to ExpressionEngine: the web-publishing system used by top designers and web professionals everywhere Learn all the key concepts and terminology of ExpressionEngine: channels, templates, snippets, and more Use RSS to make your content available in news readers including Google Reader, Outlook, and Thunderbird Manage your ExpressionEngine website, including backups, restores, and version updates Written in an easy-to-follow step-by-step style, with plenty of examples and exercises Read more about this book (For more resources on ExpressionEngine, see here.) Creating templates To start with, build two templates: one for the CSS stylesheet and one that contains the HTML that defines the page structure and brings in your channel content. Since the CSS template will be used all over your website, it makes sense to put this in a separate template group called includes (which you will create). For the page itself, use the index template in the site template group. In the control panel, click on Design | Templates | Template Manager from the top menu. Then select the New Group button, located above the list of existing template groups. Call the new template group includes. Do not duplicate a group and do not make the index template your site's home page. Click Submit. Back on the Template Management screen, make sure the includes template group is selected, and then click on New Template. Call the new template site_css and select a Template Type of CSS. Leave the radio button checked to create an empty template and click Create and Edit. From the Ed & Eg site that you downloaded and extracted earlier, open style.css in a text editor such as Notepad. Copy and paste the entire file into the includes/site_css template and click on Update. Within the stylesheet, there are several references to images in the image directory. For the style to render properly, you will also need to upload all the images in the /images sub-directory (including money.jpg) to the /images sub-directory on your website. After uploading all the images, you will also need to update the paths in the stylesheet to point to this sub-directory. Within the site_css template, wherever you see url(images/imgxx.jpg), change it so that it reads url(http://localhost/images/imgxx.jpg) (replacing http://localhost/ with your website domain if you are not using a localhost environment). There should be 10 replacements in total (one for each image). When you are done, click on Update and Finished. Next, on the Template Management screen, highlight the site template group and then select the index template. If you do not have such a template group and template then go ahead and create it now. Delete everything currently in the template. Open index.html of the static Ed & Eg website in a text editor such as Notepad. Copy and paste the entire source code into the template. Since the stylesheet is no longer located in style.css, this path needs to be updated. To do this, use the ExpressionEngine stylesheet variable to indicate the includes template group followed by the site_css template that the CSS stylesheet is in. Change the line: <link href="style.css" rel="stylesheet" type="text/css"media="screen" /> to read: <link href="{stylesheet=includes/site_css}" rel="stylesheet"type="text/css" media="screen" /> Finally, click Update to save the template and browse to http://localhost/site to view the output of the template as it stands right now. It should look identical to the static index.html page (except that in ExpressionEngine, none of the links will work because you have only created one page so far). If you did not hide your index.php file as part of installing ExpressionEngine, remember that your ExpressionEngine URLs will include the additional index.php (for example, http://localhost/site will become http://localhost/index.php/site for you). Did you spot the deliberate mistake? Although, at this point, everything looks good, the content being displayed in this URL is not from your channel at all, but is what you copied and pasted from the index.html file into your site/index template. The next step is to replace this static content with the content from the website channel. Pointing your template to your channel Pointing your template to use your channel content is the step that links together everything you have done so far (creating custom fields, creating the channel, publishing content to the channel, and creating templates). In the control panel, click on Design | Templates | Template Manager from the top menu. Then select the site template group and click to edit the index template. Delete all the code from after the <div id="content"> tag to the closing </div> tag (leave these two tags in place though). Underneath the <div id="content"> line, add the following. This code says that you would like to display content from the website channel (but only one entry and only the entry with a URL title of welcome_to_our_website). {exp:channel:entries channel="website" limit="1" url_title="welcome_to_our_website"} Next, add the following line. This says that you no longer want content from the website channel. {/exp:channel:entries} In between the opening {exp:channel:entries} and closing {/exp:channel:entries} tags, add the following code. This displays the title from your entry as an <h1> header. <h1>{title}</h1> Underneath the title, add the following code to place the image from your channel entry onto the page. The {if website_image} statement means that if there is no image defined in the channel entry, do not display the img code at all. {if website_image}<img src="{website_image}"class="left" />{/if} Finally, add the following tag to display the content of your content field: {website_content} The content section should now look like: <div id="content"> {exp:channel:entries channel="website" limit="1" url_title="welcome_to_our_website"} <h1>{title}</h1> {if website_image}<img src="{website_image}"class="left" />{/if} {website_content} {/exp:channel:entries} </div> <!-- end #content --> Finally, update the page title to reflect the entry title. To do this, replace the line <title> Ed & Eg Financial Advisors </title> with the following code. Although it looks complicated, it's actually the same as the }exp:channel:entries} code in the steps above, except that all you are displaying is the {title} field and not any of the other custom fields you created. By default, the {exp:channel:entries} tag requests a lot of information from your database, which can increase the amount of time it takes to display your page. Since you are only displaying one field, the disable parameter tells ExpressionEngine not to request other information you know you do not need (including the data in your custom fields). For more information on this parameter, you can visit http://expressionengine.com/user_guide/modules/channel/parameters.html#par_disable <title>{exp:channel:entries channel="website" limit="1"url_title="welcome_to_our_website" disable="categories|category_fields|custom_fields|member_data|pagination"}{title}{/exp:channel:entries} - Ed &amp; Eg Financial Advisors</title> Click Update to save your changes and then browse to http://localhost/site to view your updated website. If everything is well, then you should not notice much difference at all, but behind the scenes, your content is now coming from your channel entry, rather than being part of your template.
Read more
  • 0
  • 0
  • 3572
article-image-creating-channel-moving-website-expressionengine
Packt
23 Sep 2010
7 min read
Save for later

Creating Channel for Moving a Website to ExpressionEngine

Packt
23 Sep 2010
7 min read
  Building Websites with ExpressionEngine 2 A step-by-step guide to ExpressionEngine: the web-publishing system used by top designers and web professionals everywhere Learn all the key concepts and terminology of ExpressionEngine: channels, templates, snippets, and more Use RSS to make your content available in news readers including Google Reader, Outlook, and Thunderbird Manage your ExpressionEngine website, including backups, restores, and version updates Written in an easy-to-follow step-by-step style, with plenty of examples and exercises Read more about this book (For more resources on ExpressionEngine, see here.) Introducing Ed & Eg Ed & Eg are fictional financial advisors in Anytown, USA. They have a small website written in static HTML/CSS that describes their services and how to get in touch with them. Their website currently consists of six HTML pages, one CSS styling file, and a handful of images. Although relatively simple, neither Ed nor Eg are familiar with HTML code, so they tend not to update their website. Although this has been fine for them up to now, they want to start reaching out and interacting with existing and potential customers through their website and they have picked ExpressionEngine for the task. Soon they will see what a good choice they have made! To download their website, you can either visit http://www.packtpub.com/support and select this book from the drop-down list for the code files, or visit http://www.leonardmurphy.com/book2. Extract the EdEg directory into any directory on your computer. Once extracted, you can view the website by opening the index.html file in your browser. If the pages appear unstyled, you may not have extracted the files first. Although you can open the individual files from within the compressed directory, they will not be styled and the links will not work. The website design was adapted from a design called Pluralism from http://www.freecsstemplates.org/. The design itself is released for free under the Creative Commons Attribution License 2.5, and you can download the original design (as well as many other free CSS designs) from their website. Deciding upon an approach There are three basic ways in which you could approach converting this site into ExpressionEngine. You could use a third-party add-on such as Structure (http://buildwithstructure.com/) that is designed specifically to help maintain static pages in ExpressionEngine. This can be especially useful when dealing with multiple tiers of static content. However, since this is not part of the built-in ExpressionEngine functionality, this article does not use this method. You could put the page layout code into templates, but put the main text of each page into a channel and then use the {exp:channel:entries} tag in your templates to display the page content. You could put both the page layout code and the main text of each page into templates and not use channels at all. The last option, leaving the content of each page in a template, is actually a good approach in certain circumstances: If there are only a handful of static pages, it might be less work and less complication to keep the static content in templates, rather than creating a channel to hold the content. If each static page has its own look and feel, then keeping each page in a separate template allows more flexibility between pages. If you are comfortable editing templates whenever you want to change the content of the static pages, then keeping the content in templates will work fine. (However, if you plan to have someone else update the content, having them edit the content in a channel is easier for them and a less risky task for you than letting them edit the template). Since Ed & Eg's static pages have a consistent look and feel, and Ed & Eg are not completely comfortable editing HTML themselves, using a channel for the page content is a good solution. With each website page in the current static website as its own channel entry, Ed & Eg will be able to change the wording of a page easily by editing the corresponding entry, while the more complicated HTML that builds the page will be out of their sight. Note that in this article, we will not be converting the Frequently Asked Questions page. Designing and building your channel Creating a new channel for your website involves the same basic steps each time. These steps can be completed in any order and you will often find this to be an iterative process: You can optionally create custom statuses, custom categories, and/or custom fields for your new channel You have to create the channel that will hold the new content You have to populate the channel with some content You have to create (or modify) templates that will display the content Let's begin! Custom statuses Each entry in ExpressionEngine can, by default, be marked as open or closed. An open entry means that the entry is visible on your website, whereas a closed entry means the entry is not visible. It is possible, however, to create more than these two statuses. You can use custom statuses to separate certain entries from others (such as the Agile Records website uses a custom status of Featured to identify which band to feature on the front-page). You can also use a custom status to build a workflow, for example, a draft custom status to indicate an entry that has been written, but needs someone else to review before being marked as open and appearing on the website. At this point in the design process, there is no reason for Ed & Eg's website channel to have custom statuses so the included Statuses status group (which includes open and closed statuses) will suffice. Categories Each channel in ExpressionEngine can also be associated with a category group. Once a channel has a category group, each entry in that channel can then be assigned to one or more categories in that group. Categories provide a natural but powerful way to organize your content, enabling you to group entries that are in the same category together and thereby encourage visitors to click-through to more of your content that interests them. Categories can also be used, such as status groups, to identify certain entries and do something different with them in your templates. The Agile Records example site uses categories to identify Staff Bios in the about channel and display them in their own section on the About page. For Ed & Eg's website, there are only a few static pages, so there is no reason to use categories. Custom fields As an example, say you have a channel for recipes. You could have a custom field for the description of the dish, a field for the ingredients, a field for the preparation steps, a field for the nutritional information, and an image field for a photo of the finished dish. You can create a field for whatever information you want to store in your channel. That said, not every channel needs its own set of custom fields. Different channels will often have similar content (for example, an introduction, the content itself, and an image). When this is the case, using the same field group for more than one channel works very well and reduces the amount of administrative overhead. By default, the blank installation of ExpressionEngine does not include any custom field groups, so at least one must be created in order to build a channel. For Ed & Eg's website, two custom fields will be ideal—one to contain the text of the page and one for the image that appears at the top left on some pages. Although the picture is a static image of coins right now, creating it as a custom field will give Ed & Eg the flexibility to have a different image on different pages, without having to edit the HTML code. Do not worry about second-guessing ahead of time all the fields that you might need. While it is true that we may one day need a heading 6 and a text 6, they can always be added when the need arises. So now that we know what custom fields we want to create, how do we create them?
Read more
  • 0
  • 0
  • 1957

article-image-tips-and-tricks-working-jquery-and-wordpress
Packt
23 Sep 2010
10 min read
Save for later

Tips and Tricks for Working with jQuery and WordPress

Packt
23 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.) The following are the tips and tricks required for working with jQuery and WordPress. Keep a code arsenal A "snippet collection" or, what I call my "code arsenal" will go a long way to help you out, not just with jQuery and WordPress code, but also with the general HTML markup and even CSS solutions you create, not to mention any other code language you work in. I'm terrible at remembering syntax for code, markup, and CSS. I often know what I need, but can never quite recall exactly how it's supposed to be typed. I used to spend hours going through various stylesheets, markup, and codes from previous projects to copy into my current project as well as googling (and "re-googling") web pages that had samples of the syntax I needed. If you often find yourself in a similar situation, using the Snippets or Clip features that are usually available in good HTML/Code editors will free you from this mundane (and very time consuming) task. You simply type or paste the WordPress template tags, functions, PHP code, key CSS rules, and jQuery functions (and any other code syntax, whatever you find you need to use the most), into the Snippets or Clips panel available in your editor, and the application saves it for you, for future use. As you work on different projects, you'll come up with solutions that you'll probably want to use again in the future, say, a set of CSS rules for unordered lists that make a nice gallery view, or a very clever use of two jQuery functions together. Every time you create something you think may come in handy (and a lot of it will come in handy again), be sure to save it right then and there, for future reference. Good editors such as Dreamweaver, HTML-Kit, and Coda usually have the ability to organize snippets and keep them logically grouped so they're easy to access. Some editors will even let you assign custom "key shortcuts" and/or drag-and-drop to your clips right into your working file. How easy is that? Free your arsenal Once you discover how handy this is, you might want to have your arsenal available to other programs you work with, especially if you switch between multiple editors and authoring environments. I suggest you invest in a multi- paste/clip board application that lets you save and organize your code snippets. When I was on a PC, I used a great little app called Yankee Clipper 3 (which is free and is available at http://www.intelexual.com/products/YC3/), and now on the Mac, I use iPaste (which has a modest price; go to http://www.iggsoftware.com/ipaste/). In addition to having your arsenal handy from any application, being able to go back through the last 10 or so items you copied to the clip board is a real time saver when you're working on a project. Your arsenal on-the-go Last, I find I like to take most of my arsenal with me. If you use a handheld device or have a phone with a note app that lets you categorize and search for notes (especially the one that will let you sync from your desktop or a web service), you'll probably find it useful to keep some or all of your arsenal in it so you can easily look up syntax from your arsenal at any time. I occasionally freelance at places that require me to use one of their computers and not my laptop, so having access to my arsenal on my device is very useful. Palm's native note app suited me great in this capacity for years and years; I now keep a large part of my arsenal in Google docs and use a little desktop app called NoteSync, which lets you write and view Google docs notes quickly (they'll have an Android app out soon, but in the meantime I use Gdocs on my Android device to see my notes). I have many friends who swear by EverNote's system (though, their mobile app only works offline on the iPhone and not on Android—as of yet). Once all your often used and creative one-off solutions are all located in a convenient (hopefully categorized and key-word-searchable) place, you'll be amazed at the amount of speed your development picks up and how much more relaxing it is. jQuery tips and tricks for working in WordPress Let's start-off with some of my favorite jQuery tips and tricks, before focusing on WordPress.There are also a few nuggets that will help you speed up your jQuery development. Try to use the latest version of jQuery This is one of the drawbacks to using the bundled WordPress version: it may get a little behind the current version of jQuery until the next version of WordPress comes out. I'm all for staying on top of the current version as jQuery's top goals for version releases are not just to provide new functionality, but continually streamline and improve the performance and speed of the existing functionality. If the latest version of jQuery available on CDN is greater than the version that's bundled, be sure to deregister jQuery first or restrict your newer version with the if else statements, so it loads on the front end of the site on required pages only. Otherwise, you may create problems with plugins using the bundled version of WordPress. Stay current with the Google CDN The best way to stay current is to simply use Google's CDN.There are additional advantages to loading up from Google's CDN instead for your project's hosted server. Instead of having to load JavaScript's, libraries and assets one by one from your server, your site can simultaneously load the main library from the Google CDN in addition to other local jQuery scripts and collateral. The bonus is that jQuery will be cached for users who've visited other sites that load it up from Google's CDN. Stay in No Conflict mode The great thing about WordPress is that a site can have so many people contributing to it in lots of different ways: writing content, working on the theme, and adding WordPress plugins. One of the worst things about WordPress is that so many people can easily contribute who knows what to a site, depending on their admin status, some other collaborator could add to them, or what plugins they could install. Staying in No Conflict mode is a must for WordPress. This in conjunction with using the wp_enque_script to load in WordPress will ensure that jQuery doesn't get "pushed out" if anyone loads up any other plugin that uses say MooTools or Scriptaculous, or even just an older version of jQuery. It's easy to stay in noConflict mode. Just use jQuery instead of the shortcut dollar sign ($) in front of your scripts. jQuery('.selector').function(); Make sure other scripts in the theme or plugin use the Script API If you're using a theme or a plugin from a third party, take a look through the theme's header.php file or the plugin's PHP pages and double-check that all scripts have been loaded in using the register and wp_enqueu_script methods. I've had a few instances that were rather frustrating and caused some hair-pulling, as we tried to figure out why my jQuery scripts were not working or wondering how I "broke" them porting them over to the live site. Turns out, the live site had a plugin installed that my sandbox site didn't, and you guessed it, that plugin was including an older version of jQuery and a custom script file using hard-coded script tags instead of the wp_enqueue_script method. Once this was figured out and straightened up, setting everything into noConflict mode, everything worked fine again! Check your jQuery syntax This one always gets me. You write up a nifty little jQuery chain, add a few tweaks to it, and the darn thing just stops working. And you know it's right! Well, at least, you think it's right. Right? This is where a great code editor comes in handy. You'll want some nice find features that let you step through and look at each returned find, as well as let you run a find not just on the whole document, but on individual selections. I like to select the just the "offending chain" and run the following find features on it to see what comes up. Colons and semicolons Do a find for : (colons); you'll probably find a few that are accidentally set up as ; (semicolons) in your function's various object parameters, or you may have typed a colon where a semicolon should have been there. Closing parenthesis I'll also run a find on closing parenthesis, ), and make sure each one that comes up is part of a continuing chain or the end of the chain marked with a;. Mismatched double and single quotes Last, a quick check for matched-up single and double quotes sometimes shows me where I've messed up. Panic's Coda lets you place in "wild cards" into the find so a search for "*' or '*" usually turns up a pesky problem. Most good code editors have color-coded syntax, which really helps in recognizing when something isn't right with your syntax, such as not having a closing quote mark at all or parenthesis. But, the issues above are tricky as they'll still often display as proper color coded syntax, so you don't know until you run your script that something's wrong. Use Firefox and Firebug to help with debugging Firebug has a feature called "console logging". This is one of many great features of Firebug in my opinion. For years I often resorted to using JavaScript's "alert" statement to try and show me what was going on "inside" my work but the Firebug console handles so much more than that. This is really useful because sometimes you have to debug a "live" site and setting up JavaScript alerts is a little risky as you may confuse visitors to the site. Using Firebug's console logging eliminates that. First up, there's the console.log and console.info statements which you can add to your jQuery scripts to pass info to and have a plethora of useful (and sometimes not-so-useful, but interesting) information about your script returned. console.profile and console.time are great for measuring how fast you scripts are being processed by the browser. For a complete overview of everything Firebug's console can do, check out: http://www.getfirebug.com/logging.
Read more
  • 0
  • 0
  • 7455

article-image-seo-kentico-cms-5
Packt
21 Sep 2010
5 min read
Save for later

SEO with Kentico CMS 5

Packt
21 Sep 2010
5 min read
(For more resources on CMS, see here.) Have a go hero – determine your keywords Search engines read, crawl, and index text and only text. They don't recognize images, Flash, or Silverlight content. That's why it's important to use the most relevant text for your website and sprinkle the content with the right keywords, while placing the selected keywords in strategic locations where there is a maximum chance for the spiders of a search engine to read, crawl, and index. Embedding keywords in the heading, initial part of the first paragraph, page titles, filenames, and directory names are some of the most commonly used strategies for improving page ranking. You can also consider including keyword phrases in the URLs or domain names of your website. This is one of the most important ways to improve the page ranking in various search engines' results pages. You need to be very careful when selecting the keywords for your website and choose words that describe your website. Sometimes, you may be confident that keywords that you choose are the best descriptions. But how do you know whether you have chosen the best keywords? What if there is no one out there who will submit a search query for the keywords you chose? This is where web analytis plays an important part. While it's tempting—resist the urge to go with uniquely different keywords or made up words. This may sound appealing to reduce the overlap with your competitor's websites. Unfortunately, you may find yourself not featured in any specific results at all. This is the main reason you should consider using keyword phrases that are popularly searched. There is a wide variety of keyword suggestion tools available, which can give you statistics, competition level, and search popularity that can help a company make an informed decision. While it is typical to determine a list of six keywords, depending on your marketing budget, you may only want to finalize a list of three. Spend some time with your marketing department to determine these keywords. Once this is done, validate these against several of the online keyword suggestion tools available. Finalize this list and make it available to all content editors with specific recommendations about their usage. Time for action – forbidden URL characters In order to guarantee URL consistency, HTTP defines a set of forbidden characters (' / : * ? " < > | & ; % . ; % . ' # [ ] + =.). In addition to these pre-defined characters, we want to remove the $ character from any URL string in our site to provide better navigation. This can be done using the following steps: Log in to Site Manager, select the Settings tab, select URLs and SEO, as shown in the following screenshot: (move cursor over image to enlarge) In the Forbidden URL characters field, enter $ and select Save, as shown in the following screenshot: Don't forgetThis setting defines characters in addition to the HTTP forbidden characters mentioned earlier. Log in to CMS Desk, select the News folder, and click the New document icon. In the New document screen, select the News item, enter the following information, and select Save. Sign out of CMS Desk. In the live site, select the News menu item, click the Get An IPhone for $50 link to view the URL containing the replaced characters, and the News item, as shown in the following screenshot: What just happened? When you selected the URLs and SEO menu option, this brought us to the system management screen. This screen contains a variety of options for managing various advanced aspects of the URL and SEO functions. When we entered the $ into the Forbidden URL characters field, this appended our character to the default HTTP forbidden list. Once this was saved, we then created a new news item that contained a $ in the title. By default, all new News URLs are created using the News title as the default URL. The resulting URL contained a - instead of a $. Time for action – changing the site name The name of any page displayed in the browser window is based on a system-wide default that starts with a page prefix. Now that we have our basic site configured, we want to change the name of the page prefix from Corporate Site to the name of our company, namely, Big Company, using the following steps: Log in to the live site to view the default site name, Corporate Site, as shown in the following screenshot: Log in to Site Manager, select the Settings tab, and then select Web site, as shown in the following screenshot: In the Site drop-down menu, select Corporate Site, as shown in the following screenshot: In the Web site properties for the Corporate Site, change the Page title prefix field to Big Company, as shown in the following screenshot and select Save. Log in to the live site to view the changed page prefix to our company name, as shown in the following screenshot: What just happened? When we selected the Web site and then Corporate Site, this brought up the default site settings. We then changed the Page title prefix field to our company name, and when we logged into the live site, this was reflected across all pages. This change is also captured by any search engines currently indexing our site. Global settingsYou can configure the format of all page titles, descriptions, and keywords for all sites by logging into Site Manager selecting Settings, then the Web site dialog, and then by selecting the (global) site. This allows you to configure the Page title format for all pages. The default title format is:{%prefix%} - {%pagetitle_orelse_name%} This means that the format consists of the site prefix followed by the page title value. If the page title value is not set, the document name is used.
Read more
  • 0
  • 0
  • 1792
article-image-oracle-webcenter-11g-portlets
Packt
21 Sep 2010
6 min read
Save for later

Oracle WebCenter 11g: Portlets

Packt
21 Sep 2010
6 min read
(For more resources on Oracle, see here.) Portlets, JSR-168 specification Specification JSR-168, which defines the Java technologies, gives us a precise definition of Java portlets: Portlets are web components—like Servlets—specifically designed to be aggregated in the context of a composite page. Usually, many Portlets are invoked to in the single request of a Portal page. Each Portlet produces a fragment of markup that is combined with the markup of other Portlets, all within the Portal page markup. You can see more detail of this specification on the following page: http://jcp.org/en/jsr/detail?id=168 While the definition makes a comparison with servlets, it is important to note that the portlets cannot be accessed directly through a URL; instead, it is necessary to use a page-like container of portlets. Consequently, we might consider portlets as tiny web applications that return dynamic content (HTML, WML) into a region of a Portal page. Graphically, we could view a page with portlets as follows: Additionally, we must emphasize that the portlets are not isolated from the rest of the components in the pages, but can also share information and respond to events that occur in other components or portlets. WSRP specification The WSRP specification allows exposing portlets as Web services. For this purpose, clients access portlets through an interface (*. wsdl) and get graphic content associated. Optionally, the portlet might be able to interact directly with the user through events ocurring on them. This way of invoking offers the following advantages: The portals that share a portlet centralize their support in a single point. The portlet integration with the portal is simple and requires no programming. The use of portlets, hosted on different sites, helps to reduce the load on servers. WebCenter portlets Portlets can be built in different ways, and the applications developed with Oracle WebCenter can consume any of these types of portlets. JSF Portlets: This type of portlet is based on a JSF application, which is used to create a portlet using a JSF Portlet Bridge. Web Clipping: Using this tool, we can build portlets declaratively using only a browser. These portlets show content from other sites. OmniPortlet: These portlets can retrieve information from different types of data sources (XML, CSV, database, and so on) to expose different ways of presenting things, such as tables, forms, charts, and so on. Content Presenter: This allows you to drop content from UCM on the page and display this content in any way you like or using a template. Ensemble: This is a way to "mashup" or produce portlets or "pagelets" of information that can be displayed on the page. Programmatic Portlets: Obviously, in addition to the previous technologies that facilitate the construction of portlets, it is also possible to build in a programmatic way. When we build in this way, we reach a high degree of personalization and control. However, we need specialized Java knowledge in order to program in this way. As we can see, there are several ways in which we can build a portlet; however, in order to use the rich components that the ADF Faces framework offers, we will focus on JSF Portlets. Developing a portlet using ADF The portlet that we will build will have a chart, which shows the status of the company's requests. To do this, we must create a model layer that represents our business logic and exposes this information in a page. Therefore, we are going to do the following steps: Create an ADF application. Develop business components. Create a chart page. Generate a portlet using the page. Deploy the portlet. In this example, we use a page for the construction of a portlet; however, ADF also offers the ability to create portlets based on a flow of pages through the use of ADF TaskFlows. You can find more information on the following link: http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/taskflows.htm#BABDJEDD Creating an ADF application To create the application, do the following steps: Go to JDeveloper. In the menu, choose the option File | New to start the wizard for creating applications. In the window displayed, choose the Application category and choose the Fusion Web Application ADF option and press the OK button. Next, enter the following properties for creating the application: Name: ParacasPortlet Directory: c:ParacasPortlet Application Package Prefix : com.paracasportlet Click Finish to create the application. Developing business components Before starting this activity, make sure you have created a connection to the database. In the project Palette, right-click on Project Model, and choose New. On the next page, select the category Business Tier | ADF Business Components and choose Business Components from Tables. Next, press the OK button. In the following page, you configure the connection to the database. At this point, select the connection db_paracas and press the OK button. In order to build a page with a chart, we need to create a read-only view. For this reason, don't change anything, just press the Next button. (Move the mouse over the image to enlarge.) In this next step, we can create updateable views. But, we don't need this type of component. So, don't change anything. Click the Next button. Now, we need to allow the creation of read-only views. We will use this kind of component in our page; therefore select the table REQUEST, as shown next and press Next. Our next step will allow the creation of an application module. This component is necessary to display the read-only view in the whole application. Keep this screen with the suggested values and click the Finish button. Check the Application Navigator. You must have your components arranged in the same way as shown in the following screenshot: Our query must determine the number of requests for status. Therefore, it will be necessary to make some changes in the created component. To start, double-click on the view RequestView, select the Query category, and click on the Edit SQL Query option as shown in the following screenshot: In the window shown, modify the SQL as shown next and click the OK button. SELECT Request.STATUS, COUNT(*) COUNT_STATUSFROM REQUEST RequestGROUP BY Request.STATUS We only use the attributes Status and CountStatus. For this reason, choose the Attributes category, select the attributes that are not used, and press Delete selected attribute(s) as shown in the following screenshot: Save all changes and verify that the view is similar to that shown next:
Read more
  • 0
  • 0
  • 4617

article-image-linking-your-customers-your-sugarcrm
Packt
21 Sep 2010
12 min read
Save for later

Linking Your Customers to Your SugarCRM

Packt
21 Sep 2010
12 min read
(For more resources on SugarCRM, see here.) Surely, the most important goal of any CRM system is to make your customers feel positive about your company and to make them feel that exciting things are happening at your company, such as the following: That the employees they are in contact with are caring and well-informed That new and better information systems are coming into place That your company is responsive to product and service issues, and cares about its customers Limiting CRM system access to only the employees of a business will certainly affect the first of the aforementioned items positively, but not necessarily the other items. To really improve a customer's perception of your organization, one of the biggest improvements you can make is to allow customers to interact almost directly with your CRM system. Some of the activities that make this possible are as follows: Capturing customer leads and requests for information from the public website directly within the CRM system. Efficiently tracking customer service requests and related product/service flaws to help improve your offerings and customer satisfaction. Developing a customer self-service portal in conjunction with the CRM system to allow clients to file their own service cases, check on the latest status of a case, and to update their own customer profile. Most of us in our own lives can forgive or understand if a family member, friend, or supplier lets us down a bit, or makes a mistake—as long as they communicate with us honestly and effectively. In addition, with early detection of any errors, corrective action can always be put in place more quickly. Integrating your CRM system more directly with your customer is no more complicated than this—promoting more effective, more accurate, and timely communications with your customers. The net effect of such actions is that your customers feel informed, valued, and empowered. Capturing leads from your website Capturing leads from your company's website directly into your CRM is one of the greatest early initiatives you can implement in terms of streamlining business processes to save time and effort. This section will guide you through the manner in which this can be accomplished with SugarCRM. In the past, setting up a process similar to the one just described would have required the expertise and assistance of a programmer and your webmaster. Coordinating everyone's efforts to accomplish the goal would sometimes become a task in and of itself. Days may have elapsed before your lead capture form finally made it up to your website. Fortunately, those days are behind us. SugarCRM includes a tool that allows you to quickly and easily create a form that you can use to capture leads from your website. Through this tool, you will be able to select the fields corresponding to the data you wish to capture and also create a ready-to-use web form. Let us set up a web lead capture form through SugarCRM's tool. p style="margin-left:40px;margin-right:40px">The lead capture tool is specifically designed to import data into the Leads module only. Should you choose not to use the Leads module, or you wish to use a similar technique to capture data within a different module, you should use SugarCRM's SOAP API to accomplish the task.   To begin the setup process, hover over the Marketing tab and select Campaigns. On the shortcuts menu on the left-hand side, click on Create Lead Form, as highlighted in the following image: After clicking on it, you will see a screen that permits you to select the fields you wish to capture through your form, as illustrated in the following screenshot: The field selection process is quite simple. On the leftmost column of the three that are presented, you will see a list of all the fields corresponding to the Leads module (including custom fields). To select a field for your form, simply drag-and-drop it from the field listing on the left onto one of the two rightmost columns. It is best to visualize the layout of the form that will be produced as one similar to the edit or detail view layouts. Fields can appear next to each other, horizontally or vertically, but only within one of two columns. Most organizations prefer the vertical approach, which is the technique we will apply. However, feel free to experiment. Proceed to select the fields to match the preceding image, plus any other fields you may wish to include. Note that required fields are marked with an asterisk, as they are within the Edit view screen. You must make sure to include all your required fields to ensure that the process will work as expected. In addition, you will notice that we have selected the Lead Source field. Doing so will allow website visitors to make the appropriate selection corresponding to what drove them to your site. Click on Next once you are satisfied with your field selection. Now you need to set some final parameters, as illustrated in the following image: You will undoubtedly want to modify the Form Header. This value corresponds to the title of the page that website visitors will see in their browser, so you will want to tailor it to reflect something a bit friendlier than the generic text. The form we are building is no different than any other web form you may have encountered in your day-to-day web browsing. As such, it too will include a button for visitors to click and send the data they typed in. If you prefer the label of the button to read as something other than the default label of Submit, change the Submit Button Label accordingly. The Redirect URL and Related Campaign fields are also quite important. The former is used to specify a URL that a visitor will be sent to after clicking on the Submit button on your lead capture form, while the latter is used to associate a particular marketing campaign to the form. Establishing this relationship is critical as it will help you properly measure the effectiveness of your marketing efforts. Lastly, the Assigned To option allows you to define a user to whom the Leads will be assigned upon being entered into SugarCRM. You may want to consider creating a specific user, such as WebCapture, and assigning the Leads to that user. Doing so will permit you to quickly identify records that entered your system through the web lead capture tool versus other means. Click on Generate Form after you have applied your edits and you should see something similar to the following: The default form should now be presented within SugarCRM's HTML editor. This is a handy capability as it allows you to manipulate the look and feel of the form to make it conform to the already existing look and feel of your website. However, you may wish to ignore that, as additional options allow you to more easily integrate it into your website. To access those features and save the form, click on the Save Web To Lead Form button. SugarCRM provides the convenience of a fully formatted, ready-to-use web form which can be downloaded by clicking on the Web To Lead Form link. However, if you prefer, you may copy the code displayed in the box and then embed it into one of your already existing pages. The second approach would save you the hassle of having to modify the cosmetic aspects of the default page to match your site. To start receiving data into your SugarCRM system, simply place the form on your web server, fill out the fields and submit the form. Make sure that the server on which it is placed is able to access your SugarCRM system or it will not function. You can test it by opening the form in your web browser and submitting data, as shown in the following image: Assuming everything is working as expected, the records will automatically appear within the leads module of your SugarCRM system without any intervention on your part or that of other users. In addition, e-mail notifications of new records will automatically be sent to the defined assigned user to inform them of the new entry so they may act upon it. Through the use of add-on modules, like SierraCRM's Process Manager, further actions, like the scheduling of follow up calls, can also be automated. Remember, all of this can happen automatically and herein we begin to see the real benefits of a CRM system. There are few things quite as satisfying as driving along in the car, and receiving an e-mail on your BlackBerry telling you that a new lead has been received. Especially, when you know that it all happened automatically! From a process perspective, the concept of having every new lead automatically entered into the CRM system makes it quick and easy to convert that lead into a contact, enter details of new sales opportunities, or include them in e-mail marketing campaigns—all without any data transcription errors, or lost leads, due to human errors. One note of caution: most lead capture sites capture as much as 50% bad data. Some visitors to your site will enter anything they fancy in the form; potentially polluting your database. This highlights another reason why it is beneficial to enter them by utilizing a username such as WebCapture. Doing so would allow you to easily filter leads to only show those created by WebCapture and in turn allow you to cleanse them, either by deleting them or performing other data integrity checks. Customer self-service portals After automating the lead capture process, the most common step that follows in linking your customers into your CRM system is the self-service portal. Just as it sounds, this i s a software system that enables your customers to exchange information with your organization in a completely autonomous manner. In this initial implementation, we will show you how to implement a system that allows customers to submit and manage service cases directly within your CRM system. Most of us have had the experience of needing to contact a call center to address a customer service issue or other matters. Usually, that process involves staying on hold for some time time. If you are lucky, the time that you stay on hold is not long, but at the same time, spending 30 to 45 minutes on hold or being transferred around is not unheard of. To make matters worse, you usually need to make these calls during normal business hours, meaning you are not able to tend to your normal work while you are burning time on hold. The fundamental capability that the self-service portal provides is empowering customers by allowing them to contact you at a time that is most convenient to them. Customers are no longer bound to specific business hours, nor must they wait in a call queue or navigate a maze of phone options. If they need your company's help to resolve an issue, they simply go to your website and submit their issue. Likewise, customers do not need to contact you directly to check in on their previously submitted cases. They simply visit your website again and they will be able to review their cases. This functionality works hand-in-hand with the Cases module that is built into SugarCRM. Typically, users would leverage this module to track service calls that they receive from customers. Through this functionality, all members of the organization are kept up-to-date on any issues that a customer may be experiencing at any given time. The Bug Tracker module complements the Cases module quite well by providing a central repository where all known product flaws can be tracked. In turn, all cases resulting from any of these flaws can be related to a given bug, allowing you to measure the impact it is having on your customers. Together, they can be used as very effective tools for not only providing customer service, but also prioritizing product development needs and improving customer satisfaction. However, that process can be inefficient, as it relies on a user to enter the data to produce a case in the first place. Empowering the customer in such a way that allows them to directly interact with the Cases module not only makes it easier for you to get feedback and become aware of problems, but it also gives customers the feeling that you care to hear what they have to say about their problems. That is the goal that the self-service portal hopes to accomplish. Self-service portal configuration Before we get too deep into the specifics of configuring and using the self-service portal, you must first understand some important boundaries. First, although this is a built-in feature of the Enterprise Edition of SugarCRM, it is not a feature of Community Edition. To obtain this functionality, we must use the combination of a SugarCRM add-on available on SugarExchange.com, plus an open source CMS (Content Management System) named Joomla! If you are already using another CMS package or cannot use Joomla! for other reasons, you will not be able to utilize the functionality described in this exercise. The second and last important note is that, at the time of this writing, the add-on did not support versions of SugarCRM Community Edition higher than 5.2. Now that we have a clear understanding of some important limitations, let us begin the process of deploying this feature. Installing Joomla! Assuming you have already installed SugarCRM Community Edition on the target server, you have already established the perfect environment for installing the Joomla! CMS package. Like SugarCRM, it too leverages the LAMP or WAMP system software platforms. Just like SugarCRM, it is also an open source application. You can download Joomla! from the project's site, located at http://www.joomla.org. Our exercise will use version 1.5 of Joomla! (Full Package). It is assumed that you have already successfully downloaded and installed it onto your server. If you require help with the process, visit the Joomla! website to review its documentation and obtain further assistance. Assuming Joomla! is operational, proceed to access the administrator page. It should resemble the following: Let us leave it at the admin page for now.
Read more
  • 0
  • 0
  • 3725
Modal Close icon
Modal Close icon