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-planning-microsoft-dynamics-gp-system
Packt
22 Nov 2010
10 min read
Save for later

Planning: Microsoft Dynamics GP System

Packt
22 Nov 2010
10 min read
Companies in Dynamics GP A critical decision that is very difficult to change after implementation is whether or not to have multiple companies in Dynamics GP. Sometimes there is no question, as there is only one company or there are clearly separate entities. However, often there are multiple legal entities, branches, or subsidiaries that may require separate accounting records and procedures, but also share customers or inventory items. There is no limit on the number of companies you can setup in Dynamics GP. Each company created becomes a separate SQL Server database and behaves autonomously, save for a few shared characteristics global to the entire Dynamics GP installation, such as system users, currency setup, and exchange rate tables. There are situations when separate companies are clearly recommended in Dynamics GP: If accounting records must be kept in different functional currencies to conform to local requirements When using Dynamics GP Payroll and there are different Federal ID Numbers If there are entities that have different fiscal periods Some types of businesses require separate accounting books to be kept to comply with various federal and state regulations If the requirement is simply to keep separate General Ledger accounts for each separate entity, this is fairly easy to accomplish within one Dynamics GP company. In some situations, there is no right or wrong answer as to whether to have one or multiple companies, the following sections will discuss the benefits of the two approaches in more detail. Benefits of having one company in Dynamics GP The benefits of having one company in Dynamics GP are as follows: Initial company setup is faster: Even if there are different General Ledger accounts for multiple entities within one company, there are significant time savings in only having one Dynamics GP company to set up. Ongoing maintenance and support are simpler: Multiple companies add ongoing incremental time, and thus cost, to maintenance and support. Even though many maintenance tasks can be automated, monitoring and support is simpler for a single company database. Any changes, service packs, or additional products installed may need to be performed separately for each company. Upgrades will typically take less time for one large company database than multiple smaller ones. Less storage space is needed: Having multiple databases in SQL Server increases the storage space needed because each separate database will have some duplicated overhead. Also keep in mind that each additional company will require added capacity for backups. This benefit may not be so important anymore, with storage being much more affordable than it has been in the past, but it is still something to consider. Yearly processing is faster: Yearly closing for various modules only has to be done once if there is one Dynamics GP company. Other yearly company-specific tasks, such as creating new fiscal years and yearly budgets, will take less time with one company. Reporting is simpler: Typically creating reports for one company takes significantly less time. There are no built-in multiple-company reports in Dynamics GP. Ability to share vendors, customers, and inventory items: Dynamics GP does offer an Intercompany module, but it is fairly limited. For example, there is no way in Dynamics GP to sell an inventory item from one company to a customer in another company. (There are third-party add-on products that can help with this.) Imports and integrations with other systems may be simpler: Typically, imports and integrations with other systems are more straightforward to set up and maintain with only one Dynamics GP company. Availability of additional products or modules is not limited: There may be some modules or products that will not support multiple Dynamics GP companies easily. Having one company will obviate any concerns about this. Benefits of having multiple companies in Dynamics GP The following is a list of the benefits of multiple companies in Dynamics GP: Very clear delineation between companies: All the records for each entity are clearly separated. Having multiple companies makes it more difficult to enter something in the wrong company. Ability to separate vendors, customers, and inventory items: This is the flip side to not being able to share vendors, customers, and inventory items and may be a benefit rather than a hindrance, depending on your requirements. For example, if your customers consider your divisions or subsidiaries to be separate companies, they would expect to receive separate statements from each company and pay each separately. Having all the transactions in one Dynamics GP company could make it very difficult to accomplish that separation without a lot of customization. Security: Additional security options are a direct result of the ability to separate vendors, customers, and inventory items. Consider a situation where you acquire a subsidiary and do not want all of your newly acquired employees to see any of the General Ledger details, customer information, or inventory details from your main company. With only one Dynamics GP company, it is impossible to achieve this without significant customizations, but a separate Dynamics GP company automatically accomplishes this. Ability to perform yearly closing at different times: This could be a benefit if the accounting and yearly closing procedures vary for the different entities. Different setup options possible for each company: An example of this may be different receivables aging buckets needed or aging performed a different way for different lines of business. The only way to accomplish this within one Dynamics GP company is with custom reports, however, separate companies make this a non-issue. Whether to set up one or multiple companies is a topic that should be carefully considered when planning your Dynamics GP implementation. If you are not sure of the proper approach for your specific situation, carefully go through your business requirements, as well as legal and other governmental regulations, and speak to your Dynamics GP resource in detail to help determine the best course of action. Once the decision is made, you will need to have a company name and a database name for each company you are planning to set up: Company name: Maximum of 65 characters. This is what users will see when they log into Dynamics GP and are presented with a list of companies. It will also be what is defaulted at the top of most reports to identify the company, and what shows on every window when using Dynamics GP. Even though 65 characters are possible, it is recommended to keep this shorter, as only 35 characters will typically fit on the login screen. If you are planning to create multiple Dynamics GP companies, make the names different enough so that there is no confusion for users. (Example: Not Just Widgets, Incorporated) Database name: Maximum of five characters. This will be the SQL Server database name. It should be alphanumeric and cannot start with a number or have special characters. While most end users may never see the database name, more technical users and system administrators may use it quite often, and it may be seen on reports and used for some setup steps. (Example: NJW) Integration with other systems Are there existing systems in place that your Dynamics GP system will need to integrate with? A good example of this in many companies is a sophisticated web application already in place for customer orders and billing. Other examples may be systems for employee time tracking, fixed assets, or shipping software. Excel spreadsheets, no matter how complex, are not usually considered existing systems. Existing systems are most likely to be other database applications or separately purchased software packages to accomplish specific tasks. If there are existing systems in place, part of the implementation planning will be to decide whether to keep these systems and integrate them with Dynamics GP, or replace the functionality with Dynamics GP. Other approaches may be hybrids of these: keep some existing systems but replace others, or keep existing systems for now and replace their functionality with Dynamics GP in a more phased approach, one at a time, after the implementation. To help decide on the best approach, ask the following questions, keeping in mind that the goal, whenever possible, should be a single data entry point: How well does the existing system fulfill the current requirements? If the system is not meeting today's business needs, because it was created ten years ago and met the requirements then but they have changed significantly, then it is a good candidate for replacement. However, if the existing system is accomplishing what is needed, even if a few small tweaks are needed, it may be best to keep it. How easy would it be to integrate the current system with Dynamics GP? There are a few parts to this question: Would it be fairly straightforward to import data from the current system into Dynamics GP? Or would considerable work be needed? Does the data flow need to go one way only (from the existing system to Dynamics GP), or does it need to be bidirectional? If bidirectional, what is the process of importing data into the existing system? How timely does the integration have to be? Should new data be imported into or out of Dynamics GP monthly, weekly, daily, or real-time? If the data import is fairly straightforward and one of the existing Dynamics GP import tools can be used, that would make a decision to keep an existing system in place more viable. If creating the integration would require considerable work and real-time integration is needed, it may be a good candidate for replacement, especially if the existing system is not meeting all the current requirements. What would be the cost of replacing the functionality with Dynamics GP? While the existing system may be sufficient, it may also be fairly easy to duplicate its functionality with Dynamics GP. If that is the case, the decision should be based on the comparison of the cost of duplicating the functionality in Dynamics GP (which may involve an additional module purchase or customization), and creating and maintaining the integration. In this situation, even if the cost of moving the functionality to Dynamics GP is slightly higher upfront, it is better to not keep the existing system, as having only one system to maintain will pay for itself in the long run and will also result in increased end user satisfaction. Will keeping the existing system prevent any planned upgrades? The current system may be performing perfectly and meeting all the business needs. However, it may be a custom application that is no longer supported or one that has a very costly upgrade path to move to new operating systems, versions of SQL Server, or some other planned technology upgrade. This may make it a good candidate for replacement with a phased approach, after the Dynamics GP implementation. Once these questions are answered, compare the cost and time of keeping the current systems, and creating integrations, with the cost and time of replacing them. Keep in mind that there are many third-party (also called Independent Software Vendor or ISV) add-ons available for Dynamics GP, even if the functionality needed is not available in Dynamics GP out-of-the-box.
Read more
  • 0
  • 0
  • 6623

article-image-introduction-moodle-modules
Packt
22 Nov 2010
8 min read
Save for later

Introduction to Moodle Modules

Packt
22 Nov 2010
8 min read
  Moodle 1.9 Top Extensions Cookbook Over 60 simple and incredibly effective recipes for harnessing the power of the best Moodle modules to create effective online learning sites Packed with recipes to help you get the most out of Moodle modules Improve education outcomes by situating learning in a real-world context using Moodle Organize your content and customize your courses Reviews of the best Moodle modules—out of the available 600 modules Installation and configuration guides Written in a conversational and easy-to-follow manner       Introduction Moodle is an open source Learning Management System (LMS). Image source: http://moodle.org/ The word Moodle is actually an acronym. The 'M' in Moodle stands for Modular and the modularity of Moodle has been one of the key aspects of its success. Being modular means you can: Add modules to your Moodle instance Selectively use the modules you need M.O.O.D.L.E. The acronym Moodle stands for Modular Object-Oriented Dynamic Learning Environment. It is modular because you can add and remove modules. The programming paradigm used to create Moodle code is Object-Oriented. It is dynamic because it can be used for information delivery and interactivity, in a changeable and flexible way. It is a learning environment designed for teaching at many levels. Because Moodle is modular and open source, many people have created modules for Moodle, and many of those modules are available freely for you to use. At time of writing, there are over 600 modules that you can download from the Moodle Modules and plugins database. Some of these are popular, well designed, and well maintained modules. Others are ideas that didn't seem to get off the ground. Some are contributed and maintained by large institutions, but most are contributed by individuals, often teachers themselves, who want to share what they have created. If you have an idea for something you would like to do with Moodle, it's possible that someone has had that idea before and has created and shared a module you can use. This article will show you how to download and test contributed Moodle modules, to see if they suit your needs. Origins of Moodle Moodle began in 1999 as postgraduate work of Martin Dougiamas, "out of frustration with the existing commercial software at the time". Considering the widespread use of Moodle around the world (over 40,000 registered sites in over 200 countries), Martin is a very humble man. If you ever make it to a MoodleMoot and Martin is in attendance, be sure to introduce yourself. A test server If you only want to test modules, consider setting up your own basic web server, such as XAMPP (http://www.apachefriends.org/en/xampp.html) and installing Moodle from the Moodle Downloads page (http://download.moodle.org/). If you are a Windows or Mac user, you can even download and install Moodle packages where these two ingredients are already combined and ready to go. Once installed, add a course or two. Create some dummy students to see how modules work within a course. Have a play around with the modules available—Moodle is quite hard to break—don't be afraid to experiment. Getting modules you can trust The Moodle Modules and plugins database is filled with modules great and small. This article will help you to know how you can find modules yourself. Getting ready You may have an idea in mind, or you may just want to see what's out there. You'll need a web browser and an active Internet connection. How to do it... Point your browser to the Moodle Modules and plugins database. Refer http://moodle.org/mod/data/view.php?id=6009: Image source: http://moodle.org/mod/data/view.php?id=6009 As you scroll down you will see list of modules that can be downloaded. At the bottom of the page is a Search facility: Image source: http://moodle.org/mod/data/view.php?id=6009 You can also try an advanced search to get more specific about the following: What type of module you want What version of Moodle you have A number of other features The following is a search result for the term 'progress': Image source: http://moodle.org/mod/data/view.php?id=6009 Each entry has a type, the version of Moodle that it is compatible with, and a brief description. Clicking on the name of the module will take you to a page with details about the module. This is the module's 'entry': Image source: http://moodle.org/mod/data/view.php?d=13&rid=2524&filter=1 On each entry page there is a wealth of information about the module. The following is a list of questions you will want to answer when determining if the module is worth testing. Will it work with your version of Moodle? Is documentation provided? When was the module released and has there been activity (postings on the page below) since then? Is the module author active in the discussion about the module? Is the discussion positive (don't be too discouraged by bug reports if the author is involved and reporting that bugs have been fixed)? From discussion, can you tell if the module is widely used with a community of users behind it? What is the rating of the module? If you are happy with your answers to these questions, then you may have found a useful module. Be wary of modules that do what you want, but are not supported; you may be wasting your time and putting the security of your system and the integrity your teaching at risk. There's more... Here is some additional information that may help you on a module hunt. Types of modules In order to get a sense of how modules will work, you need to have an understanding of the distinction between different module types. The following table describes common module types. Amid the array of modules available, the majority are blocks and activity modules. Activity moduleActivity modules deliver information or facilitate interactivity within a course. Links to activity modules are added on a course main page and the activity module itself appears on a new page when clicked. Examples in the core installation are 'Forums' and 'Quizzes'.Assignment typeAssignment types are a specific type of activity module that focus on assessable work. They are all based on a common assignment framework and appear under 'Assignments' in the activities list. Examples in the core installation are 'Advanced upload of files' and 'Online text' assignments.BlockBlocks usually appear down each side of a course main page. They are usually passive, presenting specific information, and links to more information and activities. A block is a simpler type of module. Because they are easy to create, there are a large number of these in the Modules and Plugins database. Examples in the core installation are the 'Calendar' and 'Online Users' blocks.Course formatA course format allows the structure of a course main page to be changed to reflect the nature of the delivery of the course, for example, by schedule or by topic.FilterFilters allow targeted text appearing around a Moodle site to be replaced with other content, for example, equations, videos, or audio clips.IntegrationAn integration module allows Moodle to make use of systems outside the Moodle instance itself.Question typeWithin a quiz, question types can be added to enable different forms of questions to be asked. Checking your version If you are setting up your own Moodle instance for teaching or just for testing, take note of the version you are installing. If you have access to the Site Administration interface (the Moodle site root page when logged in as an administrator), clicking on Notifi cations will show you the version number near the bottom, for example Moodle 1.9.8 (Build: 20100325). The first part of this is the Moodle version; this is what you need when searching through modules on the Modules and plugins database. The second part, labeled "Build" shows the date when the installed version was released in YYYYMMDD format. This version information reflects what is stored in the /version.php file. If you are not the administrator of your system, consult the person who is. They should usually be able to tell you the version without looking it up. Moodle 2.0 The next version of Moodle to follow version 1.9 has been "on the cards" for some time. The process of installing modules will not change in the new version, so most of the information in this book will still be valid. You will need to look for versions of modules ready for Moodle 2.0 as earlier versions will not work without adjustment. As modules are usually contributed by volunteers, there may be some waiting before this happens; the best way to encourage this re-development is to suggest an improvement for the module on the Moodle bug tracker system at http://tracker.moodle.org/. See also Adding modules to Moodle
Read more
  • 0
  • 0
  • 2931

article-image-getting-modular-moodle
Packt
22 Nov 2010
9 min read
Save for later

Getting Modular with Moodle

Packt
22 Nov 2010
9 min read
  Moodle 1.9 Top Extensions Cookbook Over 60 simple and incredibly effective recipes for harnessing the power of the best Moodle modules to create effective online learning sites Packed with recipes to help you get the most out of Moodle modules Improve education outcomes by situating learning in a real-world context using Moodle Organize your content and customize your courses Reviews of the best Moodle modules—out of the available 600 modules Installation and configuration guides Written in a conversational and easy-to-follow manner         Read more about this book       (For more resources on Moodle, see here.) Changing site-wide settings Activity modules and blocks can have site-wide settings that you can adjust. These settings allow consistent changes in the use of the module across an entire site, but even during testing you might want to change such settings. It may be that you just want to see what settings can be changed globally for a module. Getting ready To achieve this you must have your web server running with Moodle installed. You need to be able to log in as the administrator, or get the help of someone who can. You should have installed the modules that you want to change settings for. The following steps assume you have installed the Progress Bar block, which has global settings that can be changed. How to do it... Log in as the site administrator and visit the root page of the site. To get to the global settings of a module, on the Site Administration menu, select Modules, then Activities or Blocks, whichever is appropriate. The Progress Bar block is a block, so select Blocks to reach its global settings. The next step is to select the name of the module. For our test, the module name is Progress Bar. The settings for the module should appear in a form. Not all activity modules or blocks have global settings. For many modules, this is not necessary. Changes to the global settings affect the configuration of the module, including any instances that may already exist, and any that are added in future, across the site. There's more... Be a little careful when changing global settings on a live site. If the module is currently in use, changing global settings can affect the experience of students and teachers. Accidentally using invalid global settings can detrimentally affect the running of the module on the site. See also Adding modules to Moodle Getting rid of modules Getting modules to speak your language Another feature of Moodle is its capacity for internationalization. This means that the same software can be used by people speaking different languages. While translations for over 80 languages are available for the core functionality of Moodle, most modules only offer translations for a smaller number of languages, and the language you are teaching in may not be one of them. Adding a translation for a module is simple to do. If you give your translation to the author of the module, your efforts could also benefit others who speak your language. Getting ready It is assumed that you have set the default language for your site. If not, there is more information about adding a language pack and setting the language for your site later. In order to create a translation for a module, you don't need any real programming experience; it's actually quite simple. Some understanding of HTML tags can be an advantage. You will need a text editor that can create and edit Unicode files. Word processors are not appropriate for this task, and a simple editor, such as Windows Notepad, is not up to the job. There are many free editors available that will allow you to create and edit Unicode files. One example available for Windows is Notepad++, which is a free editor and is also available as a portable application. The steps that follow provide an example that assumes the Progress Bar block has been installed. How to do it... Where the module was installed, there will usually be a /lang folder. For the Progress Bar block this is located at moodle/blocks/progress/lang. Within this folder, there are folders for different languages, most of them contributed by users around the world. If you are reading this, it is assumed you have an understanding of English, so have a look inside the en_utf8/ folder. You will see a file called block_progress.php and another directory called help/. The block_progress.php file contains strings of text used in the module, each with a code and the string displayed on screen. Open this file in your editor to see the contents. Inside the lang/help/progress/ directory there are a number of HTML files, each relating to a help topic. These appear when a help icon (usually appearing as a question mark) is clicked. Opening these files in your web browser will show you the rendered version of these files and opening them in your editor will show you the HTML source of the documents. To add a new language, you first need to find out the two letter code for your language. To see the list of supported languages visit the following site. You will also see the code letters for each language, and you need to follow the same code. Refer to http://download.moodle.org/lang16/. Return to the lang/ folder. For the Progress Bar block this is at moodle/blocks/progress/lang/. Assuming that you know English as a second language, copy the en_utf8/ folder and all of its content. Rename the folder with the two letter code for your language, for example, the folder for Afrikaans would be af_utf8/. Be sure to preserve the filenames and folder names within (they do not need translation, only the contents). Open the block_progress.php file in your Unicode editor. You need to translate the string on the right of the = symbol, within the quotes. Do not translate the code value for the string on the left. You may need to see the string in use to get a sense of what the string is intended for, in order to make an accurate translation. If you include any apostrophes within the string, escape the quote with a slash, as shown in the following example, otherwise the string will be seen as coming to an end earlier than it should. $string['owners'] = 'Owner's'; If there is code within the strings, or HTML tags, that you are unsure about, leave these and just translate any text around them. You can also translate the HTML files in moodle/blocks/progress/lang/help/progress/ to produce help files in your language. Open these in your editor and translate the text within the files. Again, avoid changing any HTML or code you don't understand. Some help files also include PHP code segments within <?php and ?> tags, avoid changing this content. Be sure to test your translated files. If, after changing a translation file, nothing appears on the course page, it may be that you have inadvertently created an error. Typically this comes from mismatched quotes around strings. Be sure each starting quote is matched with a closing quote, and any enclosed quotes are escaped. Test that your translated text items are appearing correctly and have an appropriate meaning in your language. Once created, you can use this translation throughout your site. The final step is to send your translation to the author of the module. You should be able to find their contact details on the Moodle Modules and plugins database entry page for the module. If you have translated the language strings but not translated the help files, this is still a helpful contribution that can be shared. Zip up the files you have translated and e-mail them to the author who will usually be more than happy to include your contribution within the module for future downloaders. How it works... Each time the module is loaded, its code is interpreted by the web server and HTML is produced to form the part of the page where the module will appear. Within the code, instead of writing text strings in the author's language, there are calls to functions that check the language and draw the appropriate strings from the language files. This way, all that is needed to change from one language to another is a different language file. There's more... If you want to use another language throughout your Moodle site, the following sections are a basic guide for installing and selecting the language. Adding a language pack Visit the following site to find if a language pack is available for your language: http://download.moodle.org/lang16/. If your language is available, download the appropriate zip file and extract its contents to the directory moodle/lang/. If your language is Afrikaans, for example, the language files should be contained in moodle/lang/af_utf8/. Ensure you do not introduce additional unnecessary directory levels. Selecting a language for your site and courses A language can be set as a default for courses on the site. This can be overridden at the course level if desired, or by students individually. To set the default language, log in as administrator and go to the site root page. On the Site Administration menu, select Language, then Language Settings. The default language can be set on the page that appears. Individual users can set a preferred language in their profile settings. For individual courses a language can be set. This will "force" students to use that particular language rather than their preferred language. See also If it's not quite what you want...
Read more
  • 0
  • 0
  • 1973

article-image-faq-installing-and-using-ibm-lotus-sametime-8-mobile-client
Packt
22 Nov 2010
10 min read
Save for later

FAQ on Installing and Using the IBM Lotus Sametime 8 Mobile Client

Packt
22 Nov 2010
10 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         Q: Show some instances where Sametime would be most useful? A: The following cases highlight a few instances where Sametime is most useful: Lisa is waiting on some information from a team member for a project deadline, but she's away from her desk. However, she has Sametime Mobile installed on her Windows Mobile 6 device and she can connect during her board meeting. Juan is on a long distance trip between countries. He doesn't want to pull his laptop down from the overhead bins, but he does have his Blackberry available to chat with his staff in the home office since he has Sametime Mobile installed. He can set his presence awareness to unavailable once he's in the air. Logan needs some contract information during a lengthy meeting. He can ping his project team for any detail clarification from his Blackberry using Sametime Mobile, without disrupting the meeting.   Q: Which are the supported devices for Sametime Mobile? A: Sametime Mobile is available for a number of mobile operating systems and devices. Devices include those that support the Microsoft Windows Mobile operating system, Research in Motion Blackberry devices, Sony Ericsson cell phones, and Nokia Eseries devices. As new devices are made available on a continual basis, check both your mobile device website as well as the IBM Sametime support site (http://www-01.ibm.com/support/docview.wss?rs=477&uid=swg27013765) for updated information about which devices are supported. Research in Motion provides downloads for Sametime for new devices from their website at http://www.blackberry.com. Windows MobileWindows Mobile 2003 Second Edition Pocket PCWindows Mobile 5 Pocket PCWindows Mobile SmartphoneWindows Mobile 6 StandardWindows Mobile 6 ProfessionalResearch in Motion BlackberryBlackberry 7100Blackberry 8100Blackberry 8300Blackberry 8700Blackberry 8800Blackberry 8900Blackberry 9000Sony EricssonM600iP990iP1iNokiaEseries Q: How do we Package the Sametime Mobile client for download? A: As part of the Sametime server installation, files for each of the mobile platforms are included in subdirectories on your organization's Sametime server. Your Sametime administrator makes these files available to you via configuration options. These files will have specific file extensions based on what type of device you have. For example, the files for Sametime Mobile on the Windows Mobile operating system are packaged as a .cab file, while .cod and .alx files are part of the Blackberry download package. Your Sametime administrator will also provide you with a website that will provide access to the files. Q: How to download and install Sametime Mobile? A: To begin using Sametime Mobile, you must first download and install the application to your mobile device. The installation steps will be specific to the type of device you are using. The process first begins with accessing the download website provided to you by your Sametime administrator. Depending on your device you might use Internet Explorer (Windows Mobile), a browser for mobile phones like Opera, or the Blackberry browser specifically designed for the Blackberry. The URL will be similar to the following: http://sametime.topchefs.com/mobile/.When the main download page appears, it will look much like the following screenshot: You'll need to select your language and the device type and then select Download. You may be prompted for a user ID and password at this point. Your Sametime administrator should provide you with this information. Our example here shows a login screen for a Windows Mobile device: If your organization or company uses a Blackberry Enterprise Server, they may have configured the server to deploy the Sametime client "over the air" to your device. This means that the Sametime client application may be pushed to your device without any interaction on your part, because the Blackberry Enterprise Server can push out software updates. You can also download the Sametime client from the Blackberry website at http://na.blackberry.com/eng/services/server/domino/lotus_software.jsp#tab_tab_sametime. This method uses the Blackberry desktop manager to upload the Sametime client to your Blackberry device using the combination of .cod and .alx files provided in the install packages. Your Sametime administrator will provide you with a user ID and password for use to login to your organization's Sametime server. The installation of Sametime Mobile for Windows Mobile includes a couple of extra steps. This installation includes a configuration file that must be downloaded to the device. You should check with your Sametime administrator for additional information if you have questions in this situation. Q: How to use the Sametime Mobile client? A: So you've downloaded the Sametime Mobile client to your mobile device. Let's confirm that you have installed the application and that you can login and start the application successfully! On the following pages we'll use a Blackberry 8900 or a Windows Mobile 6 device as our working models for the Sametime Mobile images. We're going to cover a number of options and features and they may display somewhat differently depending on the device you use. So as we're going through these options, try to focus more on the function that's being shown rather than the specifics of what is being displayed on the screen. Microsoft® Windows® Mobile: Choose Start | Programs | Sametime. BlackBerry: Open the Instant Messaging folder; choose the Enterprise Messaging or Sametime application. Nokia: Open the Installations folder, choose the Sametime application. Sony Ericsson: Open the Tools folder, choose the Sametime application. Your Blackberry device will show an icon that looks similar to the following screenshot: The Windows Mobile Device Sametime icon will be similar to the following screenshot: Q: How to log into Sametime Mobile? A: To login to Sametime, enter the Sametime user ID and password that your Sametime administrator has provided to you. This would be most likely the user ID and password that you use with the Sametime Embedded client or the Sametime Connect client. You have the ability to save the password and will automatically login the next time you open Sametime on your device. Please note, while it is more convenient to have the device remember your password here, make sure to consult the security policies of your organization when saving a password to a mobile device. Always set a device password for your mobile device, so that in the event that the device is stolen or lost, your accounts and data can't be accessed. The following depicts the login screen for the Sametime client on a Blackberry device: As we explained earlier, we're going to show screens from both a Blackberry and a Windows Mobile device. We assume that you are familiar with navigating to menu options as one of those device users. Q: How to begin a chat? A: When you login, you'll see a list of all your active chats, as well as your contact list groups. You can click on any group name in order to expand it to see the names of the people you have in that group. To begin chatting with a contact, move your device cursor and select their name. A blank chat window will appear with a panel for you to begin typing. Your chat conversation will appear in the chat window. Within the Sametime Mobile client itself, there are option menus to view your contact list, groups, etc. In this example the Blackberry has a pop-up menu that lets you accomplish a number of tasks such as adding a new contact or sending a message to someone. Emoticons help to convey emotion and "body language" in text messages that could be misread without any verbal or body language context. In Sametime Mobile you still have that feature available to you. When you're chatting with someone, you will see a small smiley icon to the right of your chat input field (if you're on a Blackberry) or an Insert Emoticon option. Sametime Mobile displays a screen of available emoticons that you can click on to insert into your chat message. (See the Blackberry version in the following screenshot.) As with the Sametime Embedded or Sametime Connect client, you can invite other contacts to join an ongoing chat. "Invite Other to Chat" or "Invite Others" will display as a menu option depending on your mobile device. This will display a list of your contacts and you can select one or more names to invite to your current chat. Q: How to Send an announcement? A: Have you ever wanted to "ping" a number of contacts at one time to let them know of a meeting room change? From the Sametime Mobile client you can send an announcement to all members of a group or choose individual contacts from the group list. This appears on their chat window as an announcement. If you need an easy method to notify a group of users, this is it! Q: How to enable Multiple chat conversations? A: Another feature that extends to the Sametime Mobile client is the ability to have multiple chat conversations at one time. Regardless of whether you're in front of your computer or on your phone, people are not going to wait for you to finish one chat before you answer theirs. With your Blackberry, Windows Mobile, Sony, or Nokia phone, you'll be able to talk with multiple contacts at the same time. When you're participating in one chat and you receive an invitation to participate in another chat, you can choose the Chat List icon. Each new chat displays the Responding icon. Select the new chat you want to participate in and that chat window will display. On the Blackberry client the Chat List displays as a number of chats at the top of your contact list. Using the Chat List icon, you can move between chat windows, toggle between any of the chats included in the list, or choose to close all chat windows. Q: What are "quick responses"? A: You have the option to create prepared responses, also known as "quick responses", which you can store in your mobile device. These are handy when you're on a call or in a meeting, and can't respond to a chat. On a Windows Mobile device, this feature looks like the one shown in the following screenshot: To end a chat, you can select the menu option to "End Chat" or "Close Chat". Again, this depends on your mobile operating system as to how this will be displayed, but the function remains the same.
Read more
  • 0
  • 0
  • 2515

article-image-enterprise-raw-books
Packt
22 Nov 2010
1 min read
Save for later

Enterprise RAW Books

Packt
22 Nov 2010
1 min read
Oracle RAW Books Oracle WebLogic Server 11gR2: Administration Essentials Oracle ADF Enterprise Application Development Made Simple Oracle Siebel CRM 8 Developer's Handbook Oracle PeopleSoft Enterprise Financial Management 9.1 Implementation Oracle Database 11g R2 Performing Tuning Cookbook Oracle Identity and Access Manager 11g for Administrators Oracle Enterprise Manager Grid Control 11g R1: Business Service Management   Microsoft RAW Books Microsoft Dynamics GP 2010 Reporting Microsoft SQL Server 2008 R2 Master Data Services Microsoft SharePoint 2010 Enterprise Applications on Windows Phone 7 Microsoft BizTalk 2010: Line of Business Systems Integration MDX with Microsoft SQL Server 2008 R2 Analysis Services   Other Enterprise RAW Books SAP BusinessObjects Dashboards 4.0 Cookbook SAP NetWeaver MDM 7.1 Administrator's Guide   Jira 4 Essentials Sage ACT! 2011 Cookbook Amazon Web Services: Migrate your .NET Enterprise Application to the Amazon Cloud    
Read more
  • 0
  • 0
  • 4568

article-image-customizing-backend-editing-typo3-templates
Packt
22 Nov 2010
11 min read
Save for later

Customizing the Backend Editing in TYPO3 Templates

Packt
22 Nov 2010
11 min read
TYPO3 Templates Create and modify templates with TypoScript and TemplaVoila Build dynamic and powerful TYPO3 templates using TypoScript, TemplaVoila, and other core technologies. Customize dynamic menus, logos, and headers using tricks you won’t find in the official documentation. Build content elements and template extensions to overhaul and improve TYPO3’s default back-end editing experience. Follow along with the step-by-step instructions to build a site from scratch using all the lessons in the book in a practical example. Updating the rich text editor While we are making life easier for the editors, we can work on one of the areas they have to spend the most time in: the Rich Text Editor (RTE). The rich text editor allows anybody editing text or content in the TYPO3 backend to add formatting and styling such as bold or italics without using special syntax or HTML, and see the results in the text area immediately. This is also known as a WYSIWYG (What You See Is What You Get) editor and we've used it in the previous chapters to edit our own content: Out of the box, TYPO3 comes with the htmlArea RTE (extension key: rtehtmlarea), and it really is a good editor to work with. The problem is that it's configured by default to fit everybody, so it doesn't really fit anybody particularly well without a little bit of modification: it has it's own classes that we probably don't actually use, toolbars that may give too many options, and it blocks some handy tags such as the embed and object tags that we need for embedded video. Luckily, the htmlArea RTE is very configurable like everything in TYPO3 and allows us to override or add to almost all of its rules. There's an entire TSref document (http://typo3.org/documentation/documentlibrary/extension-manuals/rtehtmlarea/current), so we're not going to try to cover everything that is possible. The TSref is being updated with the new releases, so I recommend checking it out if you have any questions or want to get more information on configurations that we have only glossed over or skipped. As a final note, some of the configuration properties in this section will work on other RTE options, but many are special for the htmlArea RTE. We are going to talk about the htmlArea RTE because it is already installed by default and has a lot of powerful options, but you may choose to install a different editor as an extension in the future. TYPO3 allows us to replace the RTE in the backend with TYPO3 extensions, and we might want to replace the default htmlArea RTE if we need to support older browsers or use special features like plugins for editing images. If you are using a different editor, you may need to look at its documentation for any differences in configuration. Editing the TSconfig Configuration of the RTE is done completely in the TSconfig for the user or the page. We've used the TypoScript template for frontend configuration and layout, but the TSconfig is mainly used for configuring backend modules in TYPO3 like the RTE. The rich text editor is a backend module, so we need to use the TSconfig to configure it for our editors. The TSconfig can be modified through the Page properties view on any page in the Options tab (shown in the following screenshot): Above you can see an example of the TSconfig with some of the modifications that we are going to look at for the RTE. Of course, you can edit the TSconfig on any page in the page tree that you would like, but we are going to be working on the Root page. Like templates, the TSconfig is inherited from the parent pages in the page tree, so we can modify all of the instances of the RTE in the entire site by modifying the Root page. CSS properties The first thing that we want to update in our editor is the CSS. Without special configuration, the htmlArea RTE uses its own default CSS to decide how the different options such as headings, bold, italics, and so on, look in the text area preview. We can update the TSconfig, to load our own external stylesheet for the RTE that more closely resembles our working frontend site; the editors will see the same basic styling for paragraphs and headings as the visitors and have a better idea of what their content will look like in the frontend. According to the TSref on htmlArea, the following stylesheets are applied to the contents of the editing area by default in ascending order (we'll talk about each one in a moment): The htmlarea-edited-content.css file from the current backend TYPO3 skin (contains selectors for use in the editor but not intended to be applied in the frontend) A CSS file generated from the mainStyleOverride and inlineStyle assignments Any CSS file specified by contentCSS property in the page TSConfig We don't need to worry about the first file, htmlarea-edited-content.css. The TYPO3 skin that styles everything in the backend controls it. By default, there is an extension named TYPO3 skin, and we can simply override any of the styles by using the contentCSS property that we will see in a minute. The mainStyleOverride and inlineStyle properties are controlled by the htmlArea RTE, and TYPO3 generates a CSS file based on their settings in the extension. The mainStyleOverride contains all of the default text settings including sizes and font choices. If we are using our own CSS, we will want to ignore the original styles, so we are going to use the ignoreMainStyleOverride property in our TSconfig. To ignore set this property for our RTE, we can add the following line to the TSconfig on our main page: RTE.default.ignoreMainStyleOverride = 1 The inlineStyle assignments in TYPO3 create default classes for use in the RTE. You've probably already noticed some of them as options in the style drop-downs in the editor (Frame with yellow background, Justify Center, Justify Right, and so on). If we override the inlineStyle assignments, the default classes are removed from the RTE. Of course, we don't need to eliminate these classes just to use our own, but we can do this if we are trying to clean up the RTE for other editors or want to make our own alignment styles. Finally, we can use the contentCSS property to load our own external stylesheet into the RTE. To use our own stylesheet, we will use the following code in the TSconfig to use a new stylesheet named rte.css in our editor: RTE.default.contentCSS = fileadmin/templates/css/rte.css At this point, we're all pretty used to the syntax of TypoScript, but a review might be in order. In the previous line of TypoScript, we are updating the contentCSS property in the default instances of the RTE object with the new value fileadmin/templates/css/rte.css. If you understand that line, then everything else we're about to cover will be easy to pick up. As we want to use our own CSS file and override the defaults at once, this will be the TypoScript for our TSconfig: RTE.default { contentCSS = fileadmin/templates/css/rte.css ignoreMainStyleOverride = 1 } Of course, the next thing we need to do is create our new stylesheet. We don't want to use the complete stylesheet that we are using for the frontend because it could be thousands of lines and will have a lot of formatting and page layout rules that we don't need for simple text editing. Instead, we can just copy the most important text and paragraph styles from our style.css file in the fileadmin/templates/css/ directory into a new file called rte.css. In addition, we're going to add two new classes to style.css and copy them over; we'll create a class named blue to set the font color to pure blue and a class named red to set the font color to pure red. This should be the content of our new file, rte.css: p, ul, div { color: #666; font-size: 12px; line-height: 18px; } h1 { font-size: 24px; line-height: 36px; margin-bottom: 18px; font-weight: 200; font-variant: small-caps; } h2 { margin-bottom: 18px; line-height: 18px; font-size: 18px; } h3 { font-size: 15px; line-height: 18px; } h4, h5, h6 { font-size: 12px; line-height: 18px; } ul, ol { margin: 0px 0px 18px 18px; } ul { list-style-type: circle; } ol { list-style: decimal; } td { padding: 5px; } :link, :visited { font-weight: bold; text-decoration: none; color: #036; } .blue { color: #0000ff; } .red { color: #ff0000; } With our new CSS we will notice at least a subtle difference in our RTE. In the following screenshot, we can see the original RTE on the left and the updated RTE on the right. As you can see, our text is now spaced out better and lightened to match the frontend: As we have overridden the default classes without creating any new ones, the Block style and Text style drop-downs are both empty now. In the RTE, block styles are used for the "blocks" of our content such as paragraphs and headings while the text styles are applied directly to words or pieces of text within a larger block. Put simply, if we wanted a whole paragraph to be blue, we would use the Block style drop-down, and we would use the Text style drop-down if we only wanted a single word to be blue. Both of these drop-downs use our CSS classes for styling, so we'll go ahead and create our new classes in the TSconfig. Classes properties All of the classes in our external CSS file (rte.css) are made available as soon as we declared the file with the contentCSS property. If we want to use them, we just need to associate them with a style type (paragraph, character, image, and so on) for the default RTE. If we wanted to associate the blue and red classes with text styles, for example, we would add the following to our page's TSconfig: RTE.default.classesCharacter = blue, red Before we assign the classes to a type, we should declare them in the TSconfig so they show up properly in the RTE. By declaring the classes, we can set the titles we want to show in the RTE and how we want the titles to be styled in the drop-downs. Without declarations, the styles will still show up, but the titles will just be CSS class names. We want to declare them in TSconfig with specific title to make our editors' lives easier. We can add the following code to the TSconfig to declare the classes in our RTE and set more descriptive titles that will be shown in blue or red in the drop-down menus: RTE.classes { blue { name = Blue Text value = color: blue; } red { name = Red Text value = color: red; } } We can use CSS classes for more than just the text style, of course. The table below shows all of the main ways that we can associate and use classes in the htmlArea RTE, but you can read more in the htmlArea TSref. Go ahead and try some of them out with the example TypoScript lines that are shown. RTE class properties Toolbar properties Along with what shows up inside the content of the RTE, we can modify the toolbar itself to control what editors are able to see and use. By controlling the toolbar, we can make the RTE easier for editors and make sure that the branding and styling is consistent. The table below shows some of the most useful properties we can use to alter the toolbar available to editors. We can actually go much further in editing the individual buttons of the toolbar, but this is changing enough between major releases that I recommend using the TSref as a reference for your version of the htmlArea RTE. HTML editor properties Finally, we can change the way that the RTE works with HTML. For example, the RTE uses paragraph tags (&ltp></p>) for all blocks in our text area, but we can replace this behavior with break tags (&ltbr />) if we want. The RTE also strips certain tags, and we can change that with RTE properties as well. The following table shows the most common properties that we can use in the Page TSconfig to modify the HTML in the htmlArea RTE. Even if we don't need anything else in this section; using allowTags to allow embedded video can make our editor" lives easier if we want to embed YouTube or Vimeo players in our website. All of this information is also available in the TSref for the htmlArea if you need an updated reference.
Read more
  • 0
  • 0
  • 5462
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-working-flexible-content-elements-typo3-templates
Packt
19 Nov 2010
17 min read
Save for later

Working with Flexible Content Elements in TYPO3 Templates

Packt
19 Nov 2010
17 min read
  TYPO3 Templates Create and modify templates with TypoScript and TemplaVoila Build dynamic and powerful TYPO3 templates using TypoScript, TemplaVoila, and other core technologies. Customize dynamic menus, logos, and headers using tricks you won’t find in the official documentation. Build content elements and template extensions to overhaul and improve TYPO3’s default back-end editing experience. Follow along with the step-by-step instructions to build a site from scratch using all the lessons in the book in a practical example.        Introducing flexible content elements I just said flexible content elements are like mini-templates, but they are actually a little more sophisticated than that. TYPO3 templates, traditionally, are just used to design the pages of your website. Well, flexible content elements are there as a way to create our own specialized types of content elements. Flexible content elements give us most of the power that we've had in the main TemplaVoila templates; the workflow and structure is almost exactly the same. We still have a data structure and a mapped object for each template, and we can still create backend layouts and preview images to help our editors. So, we already have all the raw skills we need to start creating them, but we just need a few examples of where we would want them. Creating a flexible content element really is just like creating a new content type for our sites utilizing the power of TemplaVoila. Once created, they can be embedded into any templates or even other FCEs. We can use references to link them across separate pages. We can copy them around between TYPO3 installations easily. We can even update the main template object or data structure of an FCE and watch our changes reach to every instance of that content element in our page tree. The best examples of this are going to be some of the ones we're about to build: a contact section, a div to wrap around other content elements, a multi-column element, and a custom product layout. Creating our first flexible content element The first FCE we're going to create is going to be simple enough to show us the basic workflow, but it's also a pretty handy trick so that we can add our contact information onto multiple pages using consistent formatting across our site. We're going to create a new flexible content element for our contact information using microformats (http://microformats.org/) so that Google and some browsers can read our address, phone number, and email address easier. Normally, this would require a lot of extra work to place it on multiple pages, but we can create an FCE that our editors can add to any page just like a normal content element. Building the content element Of course, the first thing that we should do is create an HTML file that we can use for our mapping. FCEs are normally mapped to a part of a complete HTML template, while page templates are mapped to the whole file. For our example, we will create one universal HTML file to hold all of our flexible content element HTML snippets called template_fce_snippets.html in the fileadmin/templates/ directory. At this point, we can create our HTML that the FCE will be based on. Like we said before, we are going to use microformats so that our contact information can be read by software more easily. To use microformats, we are just going to add some specific class names to the span and div tags around our information. If you would like to see more information about microformats, I recommend going to http://microformats.org/. For now, we can add this code into our template_fce_snippets.html file: <!DOCTYPE HTML> <html> <head> <meta charset="utf-8" /> </head> <body> <div id="contact_info_section"> <h3 id="contact_info_title">Contact Us</h3> <div class="vcard"> <div class="fn org">Example.com</div> <div class="adr"> <div class="street-address">1214 Rebekah Ave. </div> <span class="locality">Dallas</span>, <span class="region">TX</span> <span class="postal-code">75154</span> <span class="country-name">USA</span> </div> <div class="tel">(212) 555-1212</div> <a class="email" href="mailto:jeremy@example.com">jeremy@example.com</a> </div> </div> </body> </html> We are ready to start creating the TemplaVoila structures now, so we can go to the TemplaVoila Control Center in the backend of our installation now. We can create a new data structure by going to the Template Files tab in the control center. To create a new template object and data structure simultaneously based on our new HTML file, we need to click on the Create... link for our template file, fileadmin/templates/template_fce_snippets.html. Now we need to choose the root data element. Go ahead and choose the main div tag (circled in the following screenshot). We need to make sure we set the mapping mode to OUTER (Include tag). Due to an oddity in TemplaVoila, outer mapping is the only way to make sure that we actually keep the contact_info_section class after mapping. It may be counter-intuitive, but TemplaVoila treats root elements exactly the opposite of all other elements in its implementation of outer and inner mapping modes. Click on Set to start creating our data structure. Now that we have set the root, we can add our own fields to the FCE data structure. All of our contact information can be static, so we will just create a field for the header. Like the page templates, we will create a new field by filling the in name, field_header, at the bottom of the page as shown in following screenshot, and click on Add. Now we can fill in the form for our new field. We will set the Title to Header, and we can set the Sample Data as [Header goes here]. As we are using this as a header, we can choose Header field as our Element Preset. After we have filled out the form as shown in the following screenshot, we can click on Add to save our settings. Map the header field to the h3 tag in our HTML template and click on Set to save the mapping. We've finished creating our small content element, so we can click on the Save as button in our builder screen and save our progress. We are creating a new data structure, so we will need to fill out the CREATE Data Structure/ Template Object portion of the TemplaVoila save screen. We will give our new element an easy title, Contact Information. We also need to make sure we choose Content Element from the Template Type drop down because we are creating an FCE instead of a page template this time. Our screen should look something like shown in the following screenshot before we click on the CREATE DS / TO button: Testing our new content element We can add our element to any page the same way we've been adding text or graphic elements in the past through the Page view. Go to the main page in the backend of TYPO3 and click on the new element button (circled in the following screenshot). Added to the choices of standard or extension-based elements, we can see our own flexible content element, Contact Information [Template], listed. Go ahead and choose it to add it to the page. The next screen we see is the content editing screen where we can fill in the header for our new element: Finally, we can save our new content element and see the output on the frontend (highlighted in the following screenshot): Creating a flexible HTML wrapper As a website grows, we sometimes run into times where we would like to assign a special style to a content element or group of content elements, but there is no easy way to do this in TYPO3 without creating a new page template. All we really want to do is wrap a div tag around the group of elements we are styling with a CSS class to give them any style we need from our own stylesheets. For example, we might want to highlight a group of content elements with a color background or border. We will create a flexible content element to output a div tag with a blank class attribute that can contain normal page content elements. The FCE will have a field for the class, so our editors can fill in whatever class they need to use later. We're also keeping control over the options that editors have. They are still restricted to using CSS classes, as opposed to arbitrary style attributes, so we have not given them too much freedom. Building the content element First, we can create our HTML to which the FCE will be mapped. All we need is a div tag with a blank class attribute, so we can just add our snippet to the bottom of /fileadmin/templates/template_fce_snippets.html. We will also add some HTML comments around our new snippet so that we can always identify it in the HTML file: <!-- BEGIN HTML Wrapper --> <div class=""></div> <!-- END HTML Wrapper --> Now, we go back to the TemplaVoila module in the backend. From the Template Files tab in the TemplaVoila Control Center, click on Create... next to the file fileadmin/templates/template_fce_snippets.html label. Go ahead and choose our new div tag between the HTML comments (circled in the following screenshot) and click on Set to start creating our data structure. Again, choose OUTER (Include tag) as our mapping mode. The first field we need to create is the wrapper field for the content element. We have already set the div tag as the root element, but we still need to create a separate field to handle content elements or we won't be able to add content into our new FCE in the Page view. Like before, we can create a field by filling in the new field text area with a new name, field_wrapper, and clicking on the Add button. Now we can create the field with the following values just like we did when we added fields to our main templates. Like our page templates, we are going to use the Page-Content Elements preset because it allows us to place other content elements inside our new field: Field: field_wrapper Element Title: Wrapper Sample Data: [Content goes here] Element Preset: Page-Content Elements Once we have created and saved our new field, we can map it to the div tag by clicking on the Map button. We can use inner mapping this time because we want to keep the tag and this is not the ROOT field. The next field we need to create is the class field so that we can edit the class from the page module. Instead of an element, we are creating an attribute. To create the new field, fill in the name, field_class, at the bottom of our page and click on Add. Choose Attribute from the drop down on the left side and fill out the field values: Title: Class Sample Data: [Class field] Element Preset: Plain input field After we have created the new class attribute and saved it, we can map it to the class attribute in our div tag. If we click on the Map button for the class field, we see that we can only choose the div tag to map to; this is okay. If the div tag is grayed out or disabled, we probably need to check that the root element was set with OUTER mapping. After we click on the div tag, we are presented with a slightly different mapping screen than we have seen before. Up until now, we have been mapping tags instead of attributes, so our choice has been INNER or OUTER mode. When mapping attributes, this drop down will show any blank attributes that exist within the HTML template for that tag. If we wanted to set a relation attribute, for example, the HTML just needs to have rel="" present in the tag with or without a value. For now, we can choose ATTRIBUTE "class" (= ) from the drop down and click on the Set button to continue. We've created all of the fields we need for this small content element, so we can click on the Save as button to save our progress. We will give our new element an easy title, HTML Wrapper. We also need to make sure we choose Content Element from the Template Type drop down again. Testing our new content element We now have a data structure and template object created as a flexible content element and mapped, so we are ready to test. We can test with almost any class from our stylesheet, but we'll make it easy by adding a new class style to the bottom of our style.css file with a color background, rounded corners, and a slight shadow to highlight content: .alert { background-color: #BBCCDD; padding: 10px; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; box-shadow: 2px 2px 5px #888; -webkit-box-shadow: 2px 2px 5px #888; -moz-box-shadow: 2px 2px 5px #888; } As an example, we can highlight a couple of bullet lists on the Bulletlist page that the TemplaVoila wizard created. Go to the Bulletlist page in the backend of TYPO3 and choose to add a new element like we did for the Contact Information FCE. This time, choose HTML Wrapper [Template] for our new element. The next screen we see is the editing screen, and we can see that the titles we gave our data structure fields are showing up along with the different form elements we just declared. We can add elements to the wrapper here, but it's easier in the page module. Instead, we'll just set the Class field to alert to match our stylesheet, and save our new element. Finally, in the page module, we can drag elements into our new content element, and our new div tag with a class we have set in the settings will wrap around them. We can drag two of our bullet lists into the FCE: If we look at our edited page on the frontend, we can see the new CSS styling applied immediately: Creating a multi-column layout element As helpful as a wrapping div tag can be, we should start getting a little bigger with our goals. One thing that we run into all the time in the real world of site development is the need to have multi-column elements. With the rise of grid-based design and content-heavy sites, it's getting more popular to start adding two columns into the main content area under a single column article or something similar. Unfortunately, there are a lot of variations on this idea of mixing and nesting multi-column layouts, and it's not always possible or smart to create a template for every possible variation in a limited amount of time. You can easily waste all your time creating templates with a two-column element over a three-column element over a two-column element over a single-column element. I know that sounded confusing, and that's the problem. Instead, we can create a handful of useful multi-column flexible content elements that our editors can use anywhere they need to and in any order they need to. They can even nest them inside of each other if we do this right. Right now, we're going to make a quick FCE with two columns that take up roughly half of the current content area. We're just going to start by adding some basic styling to our main stylesheet, fileadmin/templates/style.css: .multi_column_element { display: inline-block; width: 100%; } #nested_column_1 { float: left; clear: left; } #nested_column_2 { float: right; clear: right; } .half { width: 49%; } As you can see above, we are using inline-block as the display setting for the entire element. If we don't set that, then the elements below it can creep up when we start using floats. For more information on CSS values like inline-block, I recommend the tutorials from w3schools.com (http://www.w3schools.com/css/). In addition, our style floats the first column, nested_column_1, to the left and clears anything to its left. The second column, nested_column_2, floats to the right and clears anything to the right of it. If we assign the class half to both columns, then they will both take up a little under 50% of the total width with a little whitespace in the middle. After we've modified the CSS, we need to update our HTML file. Once again, we'll add our new HTML code with identifying comments into our HTML template, /fileadmin/templates/template_fce_snippets.html. Go ahead and add some basic code to the main FCE HTML file to create two divs for columns: <!-- BEGIN 1/2 + 1/2 Element --><div class="multi_column_element"> <div class="nested_column half" id="nested_column_1">Column 1</div> <div class="nested_column half" id="nested_column_2">Column 2</div> </div> <!-- END 1/2 + 1/2 Element --> Now we're going to follow most of the same steps from the previous examples starting with the creation of a new data structure: From the Template Files tab in the TemplaVoila Control Center, click on Create... next to the file fileadmin/templates/template_fce_snippets.html label. Choose the main div tag that wraps around the entire HTML template as the root field. Again, we need to make sure we set the mapping mode to OUTER (Include tag). Create a new field for the first column named field_column_1. As the float is set completely in CSS, we will not refer to the columns as left or right columns here. This means we could swap the columns in CSS or assign different identifiers in the HTML without breaking our data structure. Go ahead and create our new field with these values: Field: field_column_1 Element Title: Column 1 Sample Data: [Column #1 goes here] Element Preset: Page-Content Elements Save the first field and map field_column_1 to the div tag with the ID nested_column_1. Make sure that you select inner mapping so that the classes and identifiers are left in the div tag. Create a new field for the second column with almost the same values as the first column: Field: field_column_2 Element Title: Column 2 Sample Data: [Column #2 goes here] Element Preset: Page-Content Elements Save the second column field and map it to the div tag with the ID nested_column_2 in the HTML. Click on the Save as button to save our new data structure and template object. Set the title as something memorable, Two-Column Element, before choosing Content Element as the Template Type and clicking CREATE DS / TO. As easy as that, we've just created another FCE. We can test this one on the main page of our test site by creating a new content element with our new FCE, Two-Column Element, and dragging our current blocks into either side: With two even columns, our front page should look something like this:
Read more
  • 0
  • 0
  • 4531

article-image-exclusive-offer-blender-books-winner-2010-open-source-graphics-software
Packt
19 Nov 2010
1 min read
Save for later

Exclusive Offer On Blender Books: Winner Of 2010 Open-Source Graphics Software

Packt
19 Nov 2010
1 min read
Packt's latest books on Blender : Blender 2.5 Lighting and Rendering Released November 2010 Click to know more   Blender 3D 2.49 Architecture, Buildings, and Scenery Released September 2010 Click to know more    Blender 2.49 Scripting      Released April 2010 Click to know more    Buy any of these books and get 40% off the ebook. Packt's Blender RAW book : Blender 2.5 Materials and Textures Cookbook: RAW Expected January 2011 Buy a copy of this book and get 40% off the ebook. For more Information, Click Here. Packt's Blender Classics : Blender 3D Architecture, Buildings, and Scenery Released May 2008 For more Information, Click Here.   Blender 3D 2.49 Incredible Machines Released November 2009 For more Information, Click Here. Buy any one of these all time favourite classics and get 50% off the other book. Don't let this amazing oppourtunity slip through your fingers. Place your order NOW!
Read more
  • 0
  • 0
  • 1027

article-image-ibms-bpm-blueworks
Packt
19 Nov 2010
6 min read
Save for later

IBM's BPM BlueWorks

Packt
19 Nov 2010
6 min read
WS-BPEL 2.0 for SOA Composite Applications with IBM WebSphere 7 Define, model, implement, and monitor real-world BPEL 2.0 business processes with SOA-powered BPM Develop BPEL and SOA composite solutions with IBM's WebSphere SOA platform Automate business processes with WS-BPEL 2.0 and develop SOA composite applications efficiently Detailed explanation of advanced topics, such as security, transactions, human workflow, dynamic processes, fault handling, and more—enabling you to work smarter The core intent of BPM BlueWorks is not only to allow you to quickly ramp onto BPM, but also to allow you to: Collaborate with a vast community and leverage pre-built business strategy maps, capability maps, processes, and measures Leverage industry-specific content provided by IBM and created by others to understand the value of BPM Use cloud based, no-installation needed, easy on-ramp to IBM BPM suite to test and deploy process Capture business intent, capabilities, and process in the cloud In BPM BlueWorks, the Business Design spaces provide the web-based, collaborative environment for designing and building business documents as a part of the solutions or applications you intend to build. These business documents allow you to visually represent and communicate your business strategies, capabilities, processes, and your future business direction. Using the business design widgets, you can: Define a business strategy using strategy maps (associated goals, measures, strengths, and threats) Design a business structure using capability maps Design a process using process maps that are based on the Business Process Modeling Notation (BPMN) standard Visually represent how your processes collaborate with other internal and external processes Create and reuse a standard business vocabulary to store standard terms, roles, business items, and messages Build service documents to specify service operations that can be reused in process maps Build organization charts to represent the structure of your business and assign the appropriate process and capability-level responsibilities for different units within your organization Anyone can sign up with BPM BlueWorks (the first registered user for a company or group becomes the BPM BlueWorks administrator for that company/group. Subsequent registrations for the company/group are approved by the administrator) by going to www.bpmblueworks.com. For the purposes of the Employee on-boarding application, we will use BPM BlueWorks to visually document our business strategy, capabilities, and processes that will come together to realize this application. These will be before we actually implement the BPEL-based process in WID. BPM BlueWorks has no runtime affinity to WPS. It allows you to create process models using the BPMN notation. Using WebSphere Business Modeler, these BPMN models can be exported into an executable BPEL. Organization chart In BPM BlueWorks, you can create an organization chart to depict the various departments or organizational units and associate a set of roles included in that organization unit. For the purposes of our scenario, Employee on-boarding, the following screenshot shows a slice of the AlphaBetaTheta Inc's organization chart with the units and roles that participate in the automation of this scenario: Strategy maps The strategy map is a visual tool for defining, planning, and communicating the overall strategy of an organization. It provides a clear picture of the overall objectives or goals of the organization (Where are we going?), the actions that are planned to achieve those goals (How are we getting there?), and the means by which the achievement of those goals will be measured (How will we know we are there?). A strategy map can be created at different levels of the organization, and each level's map can be defined with the overall strategy map in mind. Using the strategy map as a reference, all members of the organization can make decisions that align with the overall strategy. In AlphaBetaTheta Inc's case, let us draw a strategy map that clearly defines the vision, strength, weakness, opportunities, goals, and associated actions to perform. Shown in the following screenshot is the strategy map for Employee On-Boarding automation. It describes the set of weaknesses that are forcing AlphaBetaTheta Inc. to go for this BPM-based automation, and their strategy to tackle them. The goals that must be achieved for the strategy to be successful are outlined along with the actions that will be taken to achieve these goals. Management will know that the specified goals have been achieved when the targets for the associated measures have been reached. Capability maps Business capabilities basically tell that as an organization what functions you provide or the capabilities you need to run your business. It provides a layout of what kind of business an organization does, services it offers to its customers, or the operational functions it performs for employees. These capability maps are useful for analyzing and modeling a particular business in terms of its capabilities, competencies, their relationships, and dependencies. They are the precursors to the business processes. You can create capability maps in BlueWorks that an organization offers and can nicely categorize them under several levels. Business capabilities can be linked to measures, which represent the target performance levels that are defined in a related strategy map. Business Processes depicts the set of activities that are needed to realize these capabilities. While processes (how) can change, business capabilities (what) for the most part do not change. Now for our scenario, let us start brainstorming and list the capabilities that are needed from a HRMS point of view. In the following screenshot, we have laid out some of the HRMS capabilities (the three different levels) that are needed for AlphaBetaTheta Inc. and you can see where Employee On Boarding (L2) fits in the overall context under Staffing & Recruitment (L1). We have also expanded the Employee On Boarding capability to its next level (L3). You can also associate a capability map with business processes that implement the capability so that you can plan for the set of processes that will be affected by a change to the capability. Shown in the following screenshot is how we mapped the Employee On-Boarding capability to an end-to-end business process map that we are going to create in the next section named Employee On-Boarding End-2-End Process. While doing such a brainstorming activity, we can perform a gap analysis, mapping their business capabilities to identify the capabilities they currently have in their customer service area, and determining what kind of capabilities they need to implement the proposed change. Capability maps can also make use of entries that you have defined in your business vocabulary documents, such as technical terms or standard role definitions. By referencing entries defined in your vocabulary, you can ensure that document reviewers and readers share a common interpretation for the terms used in your capability map. You can also link to a role defined in your vocabulary to indicate who should be the owner of a particular capability.
Read more
  • 0
  • 0
  • 2330

article-image-ibm-cognos-books-packt-enterprise
Packt
19 Nov 2010
1 min read
Save for later

IBM Cognos Books from Packt Enterprise

Packt
19 Nov 2010
1 min read
IBM Cognos 8 Report Studio Cookbook Keep up-to-date with new IBM Cognos books published by signing up to the Packt Enterprise newsletter IBM Cognos 8 Planning
Read more
  • 0
  • 0
  • 1633
article-image-drupal-6-theming-adding-and-optimizing-css-files
Packt
19 Nov 2010
8 min read
Save for later

Drupal 6 Theming: Adding and Optimizing CSS Files

Packt
19 Nov 2010
8 min read
Drupal 6 Theming Cookbook Over 100 clear step-by-step recipes to create powerful, great-looking Drupal themes Take control of the look and feel of your Drupal website Tips and tricks to get the most out of Drupal's theming system Learn how to customize existing themes and create unique themes from scratch Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible Including a CSS file in a theme This recipe details the steps involved in adding a CSS file to the theme via its .info file. In this case, we will be adding a CSS file to the mytheme sub-theme which we created in the previous article. Getting ready Create a CSS file inside the theme's folder named mytheme.css and add the following example rule to it: * { color: #996633 !important; } This rule should override and change the color of all text on the page to a brownish hue. How to do it... Adding a CSS file to a theme is best accomplished via its .info file. Navigate to the theme's folder at sites/all/themes/mytheme and open the mytheme.info file in an editor. Add the following line to this file to include our CSS: stylesheets[all][] = mytheme.css If the CSS file is stored along with other stylesheets in a sub-folder named css, the syntax would include the relative path to the file as follows: stylesheets[all][] = css/mytheme.css. Once done, save the file and exit the editor. Since we have modified the .info file and introduced a new file, our changes will not take effect until the theme registry is rebuilt. Therefore, clear the Drupal cache and view the site to confirm that our new stylesheet has been included correctly. The theme should now display all text in brown. How it works... Drupal checks the .info file and notes that we have declared stylesheets using the stylesheets variable. The syntax of this variable is similar to that of an array in PHP. The all index in the syntax represents the media type as used in CSS declarations. The next screenshot displays a section of the source code of a page which confirms the inclusion of the new stylesheet, mytheme.css. We can also see that our sub-theme is including the stylesheets declared by its base theme—Garland—as well as its own stylesheets. In the preceding screenshot, we can see that Drupal references each stylesheet along with a query string. For example, mytheme.css is included as mytheme.css?e. This rather quirky suffix is a trick used by Drupal to ensure that browsers do not use stale copies of a cached CSS file while rendering our site. We can test this by clearing the Drupal cache and viewing the source code once again. Now, our stylesheets should have a different suffix— perhaps, something like mytheme.css?A—thereby tricking browsers into believing that these are different files and using them instead of their cached copies. There's more... One of the advantages of using a sub-theme is that we can easily override elements of the base theme. This includes stylesheets as well. Overriding the base theme's stylesheet If the base theme includes a stylesheet named layout.css, adding a stylesheet of the same name in the sub-theme will override the base theme's stylesheet. In other words, Drupal will include the sub-theme's stylesheet instead of that of the base theme. Enabling CSS optimization CSS optimization in Drupal is accomplished through two steps—aggregation and compression. This optimization provides a significant boost to performance both on the server as well as for the user. This recipe details the steps to be performed to enable this feature in Drupal. Getting ready CSS optimization is a requirement only when a site is ready to go live. Until such time, it is recommended that it be left switched off as CSS changes during development will not take effect unless the Drupal cache is cleared. How to do it... Optimization and other performance-related features are sequestered within admin/ settings/performance (Home | Administer | Site configuration | Performance). This performance configuration page should have a section titled Bandwidth optimizations which should contain options for CSS and Javascript optimization. Look for the setting named Optimize CSS files and set it to Enabled as in the following screenshot: Public File system As the screenshot states, the optimized CSS file is cached using Drupal's file system which needs to be set to public to ensure that the user's browser can access and download it. Therefore, it is necessary to set Download method of the Drupal file system to Public. This can be done via admin/settings/file-system (Home | Administer | Site configuration | File system). Once done, click on the Save configuration button at the bottom of the page to save our changes. How it works... Aggregation involves the collating and joining of multiple CSS files into a single stylesheet, while compression reduces the resulting file to a smaller size by trimming out unnecessary elements such as whitespace. The former helps in reducing the number of files that the server has to load and serve. The latter saves on bandwidth and time. The previous and following screenshots demonstrate CSS optimization at work. The previous screenshot is a snippet of the HTML source of a Drupal page running on a stock Garland theme. As displayed, this involves the server performing look-ups and serving eight separate CSS files—seven for all media types and a print stylesheet—for each and every page served. If this is extrapolated to sites of greater complexity, the number of files and, consequently, the server and bandwidth load, begin to take on significant proportions and can seriously impact performance. The preceding screenshot is of the same page as before with one difference—CSS optimization is now turned on. The number of CSS files has now been reduced to only two—one for all media types and the other being the print media type. These stylesheets are stored in the files folder and are cached copies. As a result, each page load now only involves the webserver serving two files instead of the previous eight. There's more... CSS optimization and other performance improvements should be used with care. When to use it CSS optimization is only necessary to improve performance on production sites. Enabling it beforehand will only hinder theme development. Enabling optimization can sometimes be handy when working on sites which are using more than 31 stylesheets—a not too infrequent occurrence on sites using a plethora of modules and an elaborate theme—as this is an upper-bound for Internet Explorer. IE will only load the first 31 stylesheets and ignore the rest. Drupal's CSS optimization feature reduces this number to one, thereby conveniently working around the issue. An alternative is to use modules such as IE CSS Optimizer (http://drupal.org/project/ie_css_optimizer). Other optimizations Other optimization settings can also be configured on the performance page. These include page caching, block caching, and JavaScript optimization. It is also worthwhile browsing the caching and performance modules that are available as contributed modules via http:// drupal.org/project/modules under the category Performance and scalability. Creating the mysite module to hold our tweaks In the course of developing our site, we will frequently come across situations where various elements of the site need to be tweaked in PHP using Drupal's APIs. While a lot of theme-specific cases can be stored in template files, certain tweaks which are theme-agnostic require that we store them in a module to ensure that they are available to all themes. This recipe covers the creation of a module to hold all these bits and pieces. Getting ready Create a folder inside sites/all named modules. This is where custom and contributed modules are usually housed. How to do it... The following list details the procedure involved in creating a module named mysite to hold our theme-agnostic customizations and other odds and ends: Create a folder inside sites/all/modules named mysite where mysite refers to the name of our site. Create a file named mysite.info within the mysite folder. Edit this file and add the following code inside: name = Mysite description = A module to hold odds and ends for mysite. core = 6.x Save the file. Create another file named mysite.module which will hold our odds and ends. Save and exit the editor. Finally, enable the module via the module administration page at admin/build/ modules (Home | Administer | Site building | Modules). How it works... Just as with themes, modules require a .info file which provides information to Drupal on compatibility, dependencies, and so on. Once Drupal ascertains that the module is compatible with the version installed, it loads the .module file of the same name and processes it accordingly. We can test if the module is working by adding a snippet such as the following: <?php /** * Implementation of hook_init(). */ function mysite_init(){ // Display a message on every page load. drupal_set_message("Welcome to MySite!"); } As the comment suggests, the preceding snippet will display a welcome message on every page load. There's more... The Drupal community routinely comes up with modules to ease the pain of development. Module builder There's a module available named Module builder which can be used to generate a skeleton of a general module. This can subsequently be populated as per our requirements. It is available at http://drupal.org/project/module_builder.
Read more
  • 0
  • 0
  • 7646

article-image-silverlight-books-packt-publishing
Packt
18 Nov 2010
1 min read
Save for later

Silverlight Books from Packt Publishing

Packt
18 Nov 2010
1 min read
Microsoft Silverlight and Sharepoint 2010 Integration Microsoft Silverlight 4 Data and Services Cookbook Silverlight 4 User Interface Cookbook Microsoft Silverlight 4 Business Application Development Keep up-to-date with new Silverlight books published by signing up to our Packt newsletters 3D Game Development Microsoft Silverlight 3
Read more
  • 0
  • 0
  • 1227

article-image-introduction-blender-25-color-grading-sequel
Packt
18 Nov 2010
2 min read
Save for later

Introduction to Blender 2.5 Color Grading - A Sequel

Packt
18 Nov 2010
2 min read
Colorizing with hue adjustment For a quick and dirty colorization of images, hue adjustment is your best friend. However, the danger with using hue adjustment is that you don't have much control over your tones compared to when you were using color curves. To add the hue adjustment node in Blender's Node Editor Window, press SHIFT A then choose Color then finally Hue Saturation Value. This will add the Hue Saturation Value Node which is basically used to adjust the image's tint, saturation (grayscale, vibrant colors), and value (brightness). Later on in this article, you'll see just how useful this node will be. But for now, let's stick with just the hue adjustment aspect of this node. Move the mouse over the image to enlarge it. (Adding the Hue Saturation Value Node) (Hue Saturation Value Node) To colorize your images, simply slide the Hue slider. When using the hue slider, it's a good rule of thumb to keep the adjustments at a minimum, but for other special purpose, you can set them the way you want to. Below are some examples of different values of the Hue Adjustment. (Hue at 0.0) (Hue at 0.209) (Hue at 0.333) (Hue at 0.431) (Hue at 0.671) (Hue at 0.853) (Hue at 1.0)
Read more
  • 0
  • 0
  • 7101
article-image-python-text-processing-nltk-20-creating-custom-corpora
Packt
18 Nov 2010
12 min read
Save for later

Python text processing with NLTK 2.0: creating custom corpora

Packt
18 Nov 2010
12 min read
In this article, we'll cover how to use corpus readers and create custom corpora. At the same time, you'll learn how to use the existing corpus data that comes with NLTK. We'll also cover creating custom corpus readers, which can be used when your corpus is not in a file format that NLTK already recognizes, or if your corpus is not in files at all, but instead is located in a database such as MongoDB. Setting up a custom corpus A corpus is a collection of text documents, and corpora is the plural of corpus. So a custom corpus is really just a bunch of text files in a directory, often alongside many other directories of text files. Getting ready You should already have the NLTK data package installed, following the instructions at http://www.nltk.org/data. We'll assume that the data is installed to C:nltk_data on Windows, and /usr/share/nltk_data on Linux, Unix, or Mac OS X. How to do it... NLTK defines a list of data directories, or paths, in nltk.data.path. Our custom corpora must be within one of these paths so it can be found by NLTK. So as not to conflict with the official data package, we'll create a custom nltk_data directory in our home directory. Here's some Python code to create this directory and verify that it is in the list of known paths specified by nltk.data.path: >>> import os, os.path >>> path = os.path.expanduser('~/nltk_data') >>> if not os.path.exists(path): ... os.mkdir(path) >>> os.path.exists(path) True >>> import nltk.data >>> path in nltk.data.path True If the last line, path in nltk.data.path, is True, then you should now have a nltk_ data directory in your home directory. The path should be %UserProfile%nltk_data on Windows, or ~/nltk_data on Unix, Linux, or Mac OS X. For simplicity, I'll refer to the directory as ~/nltk_data. If the last line does not return True, try creating the nltk_data directory manually in your home directory, then verify that the absolute path is in nltk.data.path. It's essential to ensure that this directory exists and is in nltk.data.path before continuing. Once you have your nltk_data directory, the convention is that corpora reside in a corpora subdirectory. Create this corpora directory within the nltk_data directory, so that the path is ~/nltk_data/corpora. Finally, we'll create a subdirectory in corpora to hold our custom corpus. Let's call it cookbook, giving us the full path of ~/nltk_data/corpora/cookbook. Now we can create a simple word list file and make sure it loads. The source code for this article can be downloaded here. Consider a word list file called mywords.txt. Put this file into ~/nltk_data/corpora/cookbook/. Now we can use nltk.data.load() to load the file. >>> import nltk.data >>> nltk.data.load('corpora/cookbook/mywords.txt', format='raw') 'nltkn' We need to specify format='raw' since nltk.data.load() doesn't know how to interpret .txt files. As we'll see, it does know how to interpret a number of other file formats. How it works... The nltk.data.load() function recognizes a number of formats, such as 'raw', 'pickle', and 'yaml'. If no format is specified, then it tries to guess the format based on the file's extension. In the previous case, we have a .txt file, which is not a recognized extension, so we have to specify the 'raw' format. But if we used a file that ended in .yaml, then we would not need to specify the format. Filenames passed in to nltk.data.load() can be absolute or relative paths. Relative paths must be relative to one of the paths specified in nltk.data.path. The file is found using nltk.data.find(path), which searches all known paths combined with the relative path. Absolute paths do not require a search, and are used as is. There's more... For most corpora access, you won't actually need to use nltk.data.load, as that will be handled by the CorpusReader classes covered in the following recipes. But it's a good function to be familiar with for loading .pickle files and .yaml files, plus it introduces the idea of putting all of your data files into a path known by NLTK. Loading a YAML file If you put the synonyms.yaml file into ~/nltk_data/corpora/cookbook (next to mywords.txt), you can use nltk.data. load() to load it without specifying a format. >>> import nltk.data >>> nltk.data.load('corpora/cookbook/synonyms.yaml') {'bday': 'birthday'} This assumes that PyYAML is installed. If not, you can find download and installation instructions at http://pyyaml.org/wiki/PyYAML. See also In the next recipes, we'll cover various corpus readers, and then in the Lazy corpus loading recipe, we'll use the LazyCorpusLoader, which expects corpus data to be in a corpora subdirectory of one of the paths specified by nltk.data.path. Creating a word list corpus The WordListCorpusReader is one of the simplest CorpusReader classes. It provides access to a file containing a list of words, one word per line. Getting ready We need to start by creating a word list file. This could be a single column CSV file, or just a normal text file with one word per line. Let's create a file named wordlist that looks like this: nltk corpus corpora wordnet How to do it... Now we can instantiate a WordListCorpusReader that will produce a list of words from our file. It takes two arguments: the directory path containing the files, and a list of filenames. If you open the Python console in the same directory as the files, then '.' can be used as the directory path. Otherwise, you must use a directory path such as: 'nltk_data/corpora/ cookbook'. >>> from nltk.corpus.reader import WordListCorpusReader >>> reader = WordListCorpusReader('.', ['wordlist']) >>> reader.words() ['nltk', 'corpus', 'corpora', 'wordnet'] >>> reader.fileids() ['wordlist'] How it works... WordListCorpusReader inherits from CorpusReader, which is a common base class for all corpus readers. CorpusReader does all the work of identifying which files to read, while WordListCorpus reads the files and tokenizes each line to produce a list of words. Here's an inheritance diagram: When you call the words() function, it calls nltk.tokenize.line_tokenize() on the raw file data, which you can access using the raw() function. >>> reader.raw() 'nltkncorpusncorporanwordnetn' >>> from nltk.tokenize import line_tokenize >>> line_tokenize(reader.raw()) ['nltk', 'corpus', 'corpora', 'wordnet'] There's more... The stopwords corpus is a good example of a multi-file WordListCorpusReader. Names corpus Another word list corpus that comes with NLTK is the names corpus. It contains two files: female.txt and male.txt, each containing a list of a few thousand common first names organized by gender. >>> from nltk.corpus import names >>> names.fileids() ['female.txt', 'male.txt'] >>> len(names.words('female.txt')) 5001 >>> len(names.words('male.txt')) 2943 English words NLTK also comes with a large list of English words. There's one file with 850 basic words, and another list with over 200,000 known English words. >>> from nltk.corpus import words >>> words.fileids() ['en', 'en-basic'] >>> len(words.words('en-basic')) 850 >>> len(words.words('en')) 234936 Creating a part-of-speech tagged word corpus Part-of-speech tagging is the process of identifying the part-of-speech tag for a word. Most of the time, a tagger must first be trained on a training corpus. Let us take a look at how to create and use a training corpus of part-of-speech tagged words. Getting ready The simplest format for a tagged corpus is of the form "word/tag". Following is an excerpt from the brown corpus: The/at-tl expense/nn and/cc time/nn involved/vbn are/ber astronomical/ jj ./. Each word has a tag denoting its part-of-speech. For example, nn refers to a noun, while a tag that starts with vb is a verb. How to do it... If you were to put the previous excerpt into a file called brown.pos, you could then create a TaggedCorpusReader and do the following: >>> from nltk.corpus.reader import TaggedCorpusReader >>> reader = TaggedCorpusReader('.', r'.*.pos') >>> reader.words() ['The', 'expense', 'and', 'time', 'involved', 'are', ...] >>> reader.tagged_words() [('The', 'AT-TL'), ('expense', 'NN'), ('and', 'CC'), …] >>> reader.sents() [['The', 'expense', 'and', 'time', 'involved', 'are', 'astronomical', '.']] >>> reader.tagged_sents() [[('The', 'AT-TL'), ('expense', 'NN'), ('and', 'CC'), ('time', 'NN'), ('involved', 'VBN'), ('are', 'BER'), ('astronomical', 'JJ'), ('.', '.')]] >>> reader.paras() [[['The', 'expense', 'and', 'time', 'involved', 'are', 'astronomical', '.']]] >>> reader.tagged_paras() [[[('The', 'AT-TL'), ('expense', 'NN'), ('and', 'CC'), ('time', 'NN'), ('involved', 'VBN'), ('are', 'BER'), ('astronomical', 'JJ'), ('.', '.')]]] How it works... This time, instead of naming the file explicitly, we use a regular expression, r'.*.pos', to match all files whose name ends with .pos. We could have done the same thing as we did with the WordListCorpusReader, and pass ['brown.pos'] as the second argument, but this way you can see how to include multiple files in a corpus without naming each one explicitly. TaggedCorpusReader provides a number of methods for extracting text from a corpus. First, you can get a list of all words, or a list of tagged tokens. A tagged token is simply a tuple of (word, tag). Next, you can get a list of every sentence, and also every tagged sentence, where the sentence is itself a list of words or tagged tokens. Finally, you can get a list of paragraphs, where each paragraph is a list of sentences, and each sentence is a list of words or tagged tokens. Here's an inheritance diagram listing all the major methods: There's more... The functions demonstrated in the previous diagram all depend on tokenizers for splitting the text. TaggedCorpusReader tries to have good defaults, but you can customize them by passing in your own tokenizers at initialization time. Customizing the word tokenizer The default word tokenizer is an instance of nltk.tokenize.WhitespaceTokenizer. If you want to use a different tokenizer, you can pass that in as word_tokenizer. >>> from nltk.tokenize import SpaceTokenizer >>> reader = TaggedCorpusReader('.', r'.*.pos', word_ tokenizer=SpaceTokenizer()) >>> reader.words() ['The', 'expense', 'and', 'time', 'involved', 'are', ...] Customizing the sentence tokenizer The default sentence tokenizer is an instance of nltk.tokenize.RegexpTokenize with 'n' to identify the gaps. It assumes that each sentence is on a line all by itself, and individual sentences do not have line breaks. To customize this, you can pass in your own tokenizer as sent_tokenizer. >>> from nltk.tokenize import LineTokenizer >>> reader = TaggedCorpusReader('.', r'.*.pos', sent_ tokenizer=LineTokenizer()) >>> reader.sents() [['The', 'expense', 'and', 'time', 'involved', 'are', 'astronomical', '.']] Customizing the paragraph block reader Paragraphs are assumed to be split by blank lines. This is done with the default para_ block_reader, which is nltk.corpus.reader.util.read_blankline_block. There are a number of other block reader functions in nltk.corpus.reader.util, whose purpose is to read blocks of text from a stream. Their usage will be covered in more detail in the later recipe, Creating a custom corpus view, where we'll create a custom corpus reader. Customizing the tag separator If you don't want to use '/' as the word/tag separator, you can pass an alternative string to TaggedCorpusReader for sep. The default is sep='/', but if you want to split words and tags with '|', such as 'word|tag', then you should pass in sep='|'. Simplifying tags with a tag mapping function If you'd like to somehow transform the part-of-speech tags, you can pass in a tag_mapping_ function at initialization, then call one of the tagged_* functions with simplify_ tags=True. Here's an example where we lowercase each tag: >>> reader = TaggedCorpusReader('.', r'.*.pos', tag_mapping_ function=lambda t: t.lower()) >>> reader.tagged_words(simplify_tags=True) [('The', 'at-tl'), ('expense', 'nn'), ('and', 'cc'), …] Calling tagged_words() without simplify_tags=True would produce the same result as if you did not pass in a tag_mapping_function. There are also a number of tag simplification functions defined in nltk.tag.simplify. These can be useful for reducing the number of different part-of-speech tags. >>> from nltk.tag import simplify >>> reader = TaggedCorpusReader('.', r'.*.pos', tag_mapping_ function=simplify.simplify_brown_tag) >>> reader.tagged_words(simplify_tags=True) [('The', 'DET'), ('expense', 'N'), ('and', 'CNJ'), ...] >>> reader = TaggedCorpusReader('.', r'.*.pos', tag_mapping_ function=simplify.simplify_tag) >>> reader.tagged_words(simplify_tags=True) [('The', 'A'), ('expense', 'N'), ('and', 'C'), ...]
Read more
  • 0
  • 0
  • 21228

article-image-ibm-lotus-notes-85-user-guide-packt-enterprises-book-moment
Packt
18 Nov 2010
1 min read
Save for later

IBM Lotus Notes 8.5 User Guide - Packt Enterprise's Book of the Moment

Packt
18 Nov 2010
1 min read
  Packt Enterprise's Book of the Moment Packt Enterprise's book of the moment has been named as... IBM Lotus Notes 8.5 User Guide This book has been awarded Packt Enterprise's Book of the Moment due to its recent success and a myriad of positive reviews. Written by Karen Hooper a member of the Dr Notes Solutions team and a IBM Certified Instructor and Lotus Notes consultant, this is a practical hands-on user guide with time saving tips and instructions for using Lotus Notes effectively and efficiently. Even if you think you know Lotus Notes this book will reveal hints and tips you never knew existed!   What's more this book is included within the current range of discounts celebrating IBM Month
Read more
  • 0
  • 0
  • 1010
Modal Close icon
Modal Close icon