Have you always wondered how things are coded and why, or why someone uses more execNative than others. Some people like to distribute a whole bunch of scripts that they run after deploying them. Why should I create a component type and when you I just create XML templates and use a lot of copy paste.
We have tried to answer some of these questions in documents that we would refer to as best practises document but also guidelines based on years of experience.
Here is one example (taken from the document):
5.6. Plan Parameters
| Pros | Flexible to use since you set them when installing the components. Static components due to "interactive" installs... Passwords since they may not always be allowed storing somewhere. |
| Cons | The variables are not stored after install of component. Hard to re-use variables. This will however change a little bit when we release SPS 6.0 later this year, where we are introduciong Variable Sets for Plans. |
| Example of usage | Using this kind of variables is perfect for non static data that is only needed when doing the installation and when you need an interaction from the operator running the plan. This should be used when doing ad-hoc plans where one just need a quick response back without the complexity of updating the component or container and also avoid the version number increase. A typical example when this is used is when you have a plan that simply reports a specific logfile or textfile back to the Web UI, i.e. /usr/bin/cat <filename> where filename would be the parameters inputted by the user at run-time. |
The following example is a complete XML of a working plan. This is because all sections are needed to exemplify the use of plan parameters, e.g. paramList is needed to be able to use the parameter in combination with the execNative procedure.
<executionPlan xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' name='StartServer-plan' version='5.0' path=/ >
<paramList>
<param name='ServerName' prompt='Enter server to start:'>
</paramList>
<varList>
<var name='RunUser' default=':[session:UserName]'>
</varList>
<simpleSteps>
<execNative userToRunAs=':[RunUser]'>
<exec value='start.sh'></exec>
<arg value=':[ServerName]'></arg>
</execNative>
</simpleSteps>
</executionPlan>
For more information, please read at the following links:
BigAdmin:
http://www.sun.com/bigadmin/hubs/sysmgmt/learn/training.jsp
Forums:
http://forum.java.sun.com/forum.jspa?forumID=887
Stay tuned for information about the SPS 6.0 release coming up...