As with any development project, Script Portlet development has to concern itself with the following aspects:
- Easy and convenient packaging and movement of code artifacts across environments.
- Availability of assets across environments; for example:
- Source control
- Source code revision control that aids in tracking and provides control over changes to it
In this article we will look at the Script Portlet features that are available for these tasks.
Versioning with WCM
IBM Web Content Manager (WCM) has a set of features to maintain and manage WCM assets. Because the Script Portlet leverages WCM to store its code artifacts, you can use these WCM features to manage Script Portlet applications. Script Portlet developers should be aware of these features. WCM offers features for version control, change management, workflow approval, and project support. For individual pieces of content, you can see creation date and time; creator; modification times; and modifiers. You can configure the WCM versioning; for information go to Web content authoring options . However, the level of versioning offered by WCM may not be sufficient for some projects. In this case, external revision control systems like Git, SVN, Rational Team Concert, and others can be used. Those systems may offer advanced features like version comparison, merging, splitting streams, and associations between defects and code fixes.
Using Revision Control Tools with Script Portlet
You can use the command line features available with Script Portlet 1.3 to easily manage your Script Portlet application code in your preferred revision control system and automatically “push” the latest changes into WebSphere Portal. You can push the changes from a developer’s workstation and from automated build and deploy systems, as shown in the picture below.
Script Portlet lets you easily work with external editors like Eclipse, Sublime Text, or others. See the document on Script Portlet Support for External Editors for more information . You can work in an external editor of your choice and then deploy the code artifacts onto WebSphere Portal to run as a Script Portlet. This integration allows developers to work efficiently with a minimal learning curve. Read this article for details about the Script Portlet command-line tool .
Revision control is critical if you are working with code artifacts, and with Script Portlet you have a good end-to-end story in this area. Revision control systems such as Git have integration capabilities with many source code editors. For example, from the Java developer’s viewpoint, Eclipse provides EGit project as an Eclipse Team provider for Git  to integrate with Git for supporting revision control. Similarly, for Sublime Text, various Git plugins are available such as SublimeGit .
In addition, these revision control systems also offer command-line tools to deal with scenarios where the source editor of your choice may not have an integration with them.
End-to-end story for development
The integration between editor and repository can be leveraged to synchronize code between your editor and a revision control system. Further, the Script Portlet command line tool can be used to conveniently deploy this code into WebSphere Portal as a Script Portlet instance.
Managing Script Portlet Code across Multiple Environments
Once the development is done and the code is safe in a revision control system, there is usually a need to move the code efficiently across various environments staging, integration, production, etc. The command line Script Portlet tool can be run as a batch process offering developers, testers, and build or integration automation an efficient way to deploy the code. This can be done from Java code, Node.js, or using a callout from an integration system such as Jenkins.
From Staging to Production
After you have developed, tested, and refined Script Portlet code, you can move it to a live production environment. Because the Script Portlet content items are in WCM libraries, you can also use syndication to update the contents of these libraries on the target environment. You can refer to this section in the Knowledge Center for information .
End to end story for all environments
Script Portlet code in revision control systems can be readily deployed using batch command-line tool from Script Portlet that can be further integrated with other build and deployment systems.
The Big Picture
The following graphic shows a pictorial summary of how code is moved between systems when using a source code repository.
- Documentation on Web content authoring options
- Script Portlet Support for External Editors article
- Using Command Line Push to Deploy Script Portlet Applications article
- EGit home page
- SublimeGit home page
- Documentation on Staging to Production
- IBM WebSphere Portal and IBM Web Content Manager V8.5 documentation