My webMethods Server was designed to allow the dynamic deployment of any MWS resource to occur at runtime without requiring a restart. This includes the deployment of items such as: Portlets, MWS Pages, Skins, Shells, Aliases, Rules, etc... Since Portlets are developed in the CAF Designer IDE, the technique for deploying Portlets is fairly well documented. The other resources (eg: MWS Pages) are created and configured inside the MWS itself. There are two main techniques for migrating these other types of resources from one MWS to another MWS: Content Migration Wizard and Deployer. Both of these tools are geared towards MWS Administrators running production portal installations. This document focuses on a third use case: CAF Developers who are pre-packaging MWS Pages and other MWS resources for distribution.
MWS Resources are imported by xml documents. There isn't a schema or dtd for these documents, but there are some guidelines to follow.
At the heart of any Importing of MWS Resources is the main xml document containing the MWS resources. As long as the xml import conforms to the guidelines above, it may be deployed in one of three types of packages:
A MWS Page is created with the <folder> tag. Because it is a container, it can contain nested child nodes of other portlets and portal resources like the following:
In the example above, there are no attributes set on the <page>, <column>, or <row>. However, you may set some attributes on both the <column>, or <row> as in the following:
If you are using the WebPage renderer which hides any Auto-Positioned Portlets, then you will want to use <hobos> tag. This is demonstrated in the example below. (Please note, the relation tag hasn't been defined yet, but will be in the Advanced Topics section)
Another common thing when modifying a MWS Page Layout is to hide the titlebars and/or the borders of portlets. This technique uses the <layout> tag as in the following example.
Content (documents) can be created in the same manner as any other MWS resource. The one key thing to note is that the actual contents of the file must be available with the xml import as well (eg: the bytes of the file whether it is plain text or binary). This means that you have can need to use either the cdp or the pdp option when deploying an xmlimport with content. (see Deployment Options). When defining a content item to import you must set a special attribute 'content' which points to the location inside of your deployable component as in the following example:
Aliases are a portable, convenient mechanism to uniquely identify MWS Resources. Every MWS Resource has a unique ID, but those ids are not portable from one MWS installation to another, where aliases are portable. Aliases come in two flavors: system aliases and non-system aliases. There is no difference in their behavior, just in whether they can be easily edited or removed. (You get a warning in the Alias Administration Portlet if you attempt to remove or modify a system alias.) The following examples demonstrate how to set multiple aliases on multiple resources.
Renderers are an important concept in the MWS that helps to decide how a specific MWS Page should be displayed. Some common renderers are: MWS Page Renderer, Folder Details Renderer, Web Page Renderer, Thumbnail Renderer, etc... As a MWS administrator/user you would typically set these by browsing to the Properties page of an item and modify its Display Properties. There are two main types of display properties you can set: Full Page View and Portlet View. They represent how an item will appear when it's Maximized, and how the item will appear when it is placed on a MWS Page. The following table shows some of the common renderers that are available:
Name | Type | Description | Alias | Usage |
---|---|---|---|---|
Properties | Full Page | Used to draw the properties page of a MWS Resource | renderers.properties |
|
Folder Details | Full Page | Used to draw the current MWS page as a detailed list | renderers.details |
|
Thumbnails | Full Page | Used to draw the current MWS page as a series of thumbnails | renderers.thumbnails |
|
WebPage | Full Page | Used to draw the current MWS page as a MWS page but hides any auto-positioned portlets | folder.presManager.renderers/webpagerenderer |
|
Folder Details | Portlet View | Used to draw the current folder in details on a MWS Page | portlet.pseudo.folderview |
|
Simple FolderView Details | Portlet View | Used to draw the current folder in simple details on a MWS Page | portlet.pseudo.folderview.simple |
|
List of Links | Portlet View | Used to draw the current folder with a simple List of Links on a MWS Page | portlet.pseudo.listoflinks |
|
Thumbnails | Portlet View | Used to draw the current folder with thumbnails on a MWS Page | portlet.pseudo.folderview.thumbnails |
|
When creating Composite Applications, you typically will be wiring properties from one portal to the next. The following example demonstrates how to create an xmlImport that captures this wiring information. Please note, that all wired properties must use aliases instead of IThingIDs
.
Resource Bundles are generally only used deploying HTMLText portlets with localizable strings. The following demonstrates this technique:
Occasionally, the xmlImport files get so large that you want to split them into smaller pieces. Using the include will assist with this:
This statement allows you to exectue MWS Verbs (aka Commands). The following examples demonstrate this technique:
This is a short cut for invoking the delete command.
Users can be imported into the MWS's internal System Directory Service much like you would import a folder into the MWS.
Similar to users, Groups can be created in the same fashion. Notice how the following example takes care to have the same attributes for name, groupName and the cn part of the dn.
Now that we've created some internal users and groups, we might want to add some of these users to some of the groups or roles. The following command demonstrates this as well as why you would want to assign aliases to the previously imported users and groups and roles.
Roles come in a variety of 'flavors' depending on their implemenetation. The simplest type of role is a Static Role where the members are statically defined from any available user, group or role in the MWS Directory System. Static Roles are fairly similar to users and groups, but due to the ability to have different implementation patterns, in order to define a static role you need to define both the storage of the role and the MWS System definition of a role. In the following example we add the previous group and user to a new static role:
We've seen how to incrementally add a user and a group, but we also have the ability to perform a bulk import by using the LDIF standard. This gives us the ability to define users, groups and group membership in one file. In order to perform a bulk ldif import you will need to use two files, the xmlImport file as well as the ldif file. In order to create the simplest possible cdp for an ldif import create the following directory structure:
In order to automatically import a connection to an external ldap directory service you can use the following example that specifies the minimum necessary connection info. The exact parameters may vary based on your customized LDAP directory service (AD/ADAM/etc...)
The databased directory service is similiar in concept to the LDAP dir service but there are many more parameters that are highly dependent on the external database schema.
In a previous step we've created both static roles and created connections to an external ldap directory service. Now we can combine those techniques and create a role based upon an ldap query.
In order to assign dynamic attributes to roles, you will execute four different ModifyPrincipal commands. They will separately modify:
In some cases, you may want to override on a per user basis the value of one of these dynamic role attributes. This is done with yet again another call to ModifyPrincipal. In the following example, we provide a different attribute value for the attributes: role1date1 and role1float1.
Security information can be set like nearly any other MWS data via xmlImport as well. You can set ACLs/ACEs, GRANT and DENY privileges, add/remove items from Security realms and set authentication schemes.
The ACL tag creates a new set of permissions exclusively for the Everyone Group and sets an alias. Later that alias can be used on any resource that you choose. The following example creates a named ACL that allows the Everyone Group READ and MODIFY access and then applies that acl to a new folder under Public Folders. Note how the aclName attribute must match the alias of the ACL. Valid values for different access rights may be found on the SDK site (http://ajax-softwareag.com/) and searching for IAccessRight.java
The more flexible tag: ACE allows you fine-grained control over the complete ACL. It allows you to specify users, groups and roles (Not just the Everyone Group). It allows you to grant and deny any available Permission, and it allows you to optinally set this ACE recursively. Finally, it also allows you to remove any existing ACEs. This tag is applied on the specific resource that you want to modify security for as a child resource. In the following example, the My webMethods Administrators Role is Granted ALL rights to the public folder recursively.
The right tag has the following boolean attributes: [delegate|grant|deny]
The ace tag has an action attribute that has the valid attributes: [add|remove|removeAll]. The add action requires the right child tag to determine what to add. The remove action just removes any security setting for the principal referenced by the uid attribute. The removeAll value will remove all of the ACEs for that resource.
The recusrive boolean attribute determines whether or not to apply this change to all descendents.
In the next example, the ability to add multiple rights together is demonstrated.
An authentication scheme can be placed on any resource by setting the authLevel property. This allows you to designate resources as anonymous, requiring BASIC auth, NTLM auth, or whathever auth scheme you require. Valid auth schemes can be determined by looking at the English names of the auth schemes listed in the System Folder: "folder.auth.schemes" (this is an alias). In the following example, the public folder is changed to be anonymous.
Security Realms are a single ACL that is shared by many different resources. They are created just like any other resource and you set the security on them using the ACE tag. Configuring a resource to be part of a security realm doesn't have a unique tag, instead it is performed by using the executecommand tag. In the following example, a new Security Realm is created and configured, and then a new folder is added to the Security Realm. You should note that the security realm must have an alias in order to be able to reference it from the executecommand tag.
Name | Type | Description | Example | Relates to |
---|---|---|---|---|
alias (userAlias) | Attribute | used to identify the alias of a MWS resource | Context, Any MWS Resource | |
Column | Tag | used to create a new column in a MWS Page Layout | Any MWS Page | |
Config | Tag | Root Node of xml import document | ||
Content | Tag | Imports a document to the MWS | ||
Context | Tag | Sets the current MWS Resource node | ||
Executecommand | Tag | Runs a portal command | ||
Hobos | Tag | used to create auto positioned portlets in a MWS Page Layout | Any MWS Page | |
Include | Tag | Includes external xml import documents | ||
Layout | Tag | used to hide titlebars and borders on any MWS Resource in a MWS Page Layout | Any MWS Resource in a MWS Page | |
name | Attribute | used to identify the name of a MWS resource | Any MWS Resource | |
Page | Tag | Starts the layout information of a MWS Page | Any MWS Page | |
Property | Tag | Sets the value of named property of a MWS Resources | Any MWS Resource | |
Relation | Tag | Sets a renderer (using a relation) on a MWS Resource. | Any MWS Resource | |
resourceBundleClass | Attribute | used to identify the location of localizable text for html text portlets | Any MWS Resource | |
Row | Tag | used to create a new row in a MWS Page Layout | Any MWS Page | |
Wiring | Tag | Configures wiring between any two MWS Resources | Any two MWS Resources |