concept service in category liferay

appears as: Services, service, services, service
Liferay in Action: The Official Guide to Liferay Portal Development

This is an excerpt from Manning's book Liferay in Action: The Official Guide to Liferay Portal Development.

When Java portals were first announced, they were hailed as the solution to many of the problems facing enterprises and solution architects. The web had grown up. Instead of using proprietary interfaces, everybody finally standardized on TCP/IP networking and open protocols such as HTTP, SOAP, IMAP, SMTP, and the like. Services, applications, and email operated on these open protocols, and products that once relied on proprietary protocols now opened up to the web. Those products that didn’t (or whose vendors delayed doing so) were relegated to the dustbin of history. And when we had all of these siloed services speaking the same language, we needed a way to bring everything together for the end user.

Enter the Java portal. The release of the Java portal specification came with the promise of bringing services together in a single unified web desktop. Not only would it unify everything for a corporation’s internal applications, but it would also be the hub of all business to business (B2B), business to consumer (B2C), business to employee (B2E), and even government to public (G2P) communication. It would be the presentation layer for the brand-new service-oriented architecture that we had just finished (or were in the process of) implementing. It could also be a platform for new applications. And it could finally bring together our static web sites and our applications, which resided on separate application servers.

Figure 6.10. If data coming from the same web page is saved to the database as three different entities, it’s best to group the entire operation in one transaction. That way, if there is an interruption in service, you don’t wind up with corrupted or orphaned data in your database.

Speaking of a custom service, you can create services in hooks using Service Builder. This is done in the same exact manner as you would do it in a portlet. But if you want to use the service you create in a hook in a separate plugin, you have to copy the .jar that is generated in the hook’s WEB-INF/lib folder to the same folder in the plugin in order to make the classes available to it. This is the same procedure you would use if you had generated the service in your portlet. Alternatively, the .jar files for shared services can be copied to your application server’s global classpath, and then the services will be available to all plugins. We’ll look at this in further detail in Inkwell’s hook, which is the subject of the rest of this chapter.