ShowTable of Contents
This example will allow Administrators to easily create new site structure within WCM, all at render time. Using WCM Authoring Tools component, you can edit/create content within WCM, but there is no easy way to create new Site Area structure.
Following this example will allow users to:
- Create a WCM navigator that uses javascript to build collapsible navigation results.
- Create new Sibling Site Areas, as well as a new default content object. This process will copy over the values from the existing site area and content, including security, workflow, and authoring template values.
- Create new Children Site Areas, as well as a new default content object. This process will copy over the values from the existing site area and content, including security, workflow, and authoring template values.
- The example also shows how to incorporate Authoring Tools component, so that you can edit/create content as well.
- Also, allows you to use Authoring Tools on a remote server, even using Local Rendering Portlet to display. This allows you to invoke authoring tool links on a remote server, and have the request processed by the backend WCM server.
Introduction
This document will serve as a sample on how to get the following functionality into your website. The idea is to provide a navigation of the website which allows you to:
- Create sibling site areas with default content
- Create child site areas with default content
This provides the following:
- Quick content/site structure creation
- Content/site areas get created based on the template of the existing site area/default content. For example, the security settings from the site area get placed on the new site area, and same for the content
This consists of the following resources:
- javascript used to build the expand/collapse navigator
- JSP files to invoke the API to create the site/content
- WCM content to placehold the JSP components so that this can be rendered out in portlets
- 1 WP page with 2 portlets, one to hold the navigator, one to receive the links.
JSP Explanation
There are 5 JSP files associated with this example:
TreeviewInit.jsp – Just used to initialize javascript
getChildSiteAreaName.jsp – Used as a form to retrieve the new Child site area, and child site area default content name. If no default content name is passed, default content will not be created.
getSiblingSiteAreaName.jsp - Used as a form to retrieve the new Sibling site area, and sibling site area default content name. If no default content name is passed, default content will not be created.
createChildSiteArea.jsp – Used to process the API to create the child site area, and the default content for it if passed.
createSiblingSiteArea.jsp - Used to process the API to create the sibling site area, and the default content for it if passed.
Both sets of JSPs work in the same way, the only difference is where the new site area is created. The get*.jsp files are basically forms that submit to the important processing JSPs:
<%
/*
* provide a form to pass on the new site area name
*/
String path=request.getParameter("path");
%>
<form action="?WCM_GLOBAL_CONTEXT=/deployment/DeploymentTools/DeploymentAPISiteArea/createSiblingSiteAreaContent" method=post>
Site Area Name: <input type="text" name="newName"/><br>
Default Content Name: <input type="text" name="newNameContent"/><br>
<input type="hidden" name ="path" value="<%=path%>"/>
<input type="submit" value="Create Site Area"/>
</form>
Now, the path is important, as that tells the underlying logic where the processing is called from, so that it can create a sibling/child. The other important part is here:
<form action="?WCM_GLOBAL_CONTEXT=/deployment/DeploymentTools/DeploymentAPISiteArea/createSiblingSiteAreaContent"
Which says basically that when the form is submitted, its going to be submitted to the current WP page, but in the specific portlet it will update to /deployment/DeploymentTools/DeploymentAPISiteArea/createSiblingSiteAreaContent
Which in my site is a WCM content object that holds a JSP component, that holds the createSiblingSiteArea.jsp to create the sibling site area. This content will be created later in the documentation.
In terms of the createSiblingSiteArea.jsp, here are the important parts:
<%@ taglib uri="/WEB-INF/tld/wcm.tld" prefix="wcm"%>
<wcm:initworkspace user="<%= request.getUserPrincipal() %>" />
Sets up the workspace. This works because we are rendering through a local rendering portlet, so request.getUserPrincipal() returns the current user.
Workspace ws = (Workspace) pageContext.getAttribute(Workspace.WCM_WORKSPACE_KEY);
Retrieves the workspace that was set up by the init tag
String pathFull = request.getParameter("path");
String path = pathFull.substring(1);
Retrieves the path that was passed. Need to pull out the leading /, so thats why we have 2 values.
/* get the new site area name */
String newName = request.getParameter("newName");
String newNameContent = request.getParameter("newNameContent");
Retrieves the names for the new content and site area objects
{code}
/* get the 1st element of the path to get the library name */
int delimEntry = path.indexOf("/");
String libName = path.substring(0, delimEntry);
/* set the library */
ws.setCurrentDocumentLibrary(ws.getDocumentLibrary(libName));
{code}
Sets the current workspace to use the library name that was passed in on the path. For example, a valid path would be libName/site/sitearea/sitearea2
/*
* find SiteArea by path
*/
siteAreaIdIterator = ws.findByPath(path, Workspace.WORKFLOWSTATUS_PUBLISHED);
while (siteAreaIdIterator.hasNext())
{
siblingId = (DocumentId) siteAreaIdIterator.next();
siblingSiteArea = (SiteArea) ws.getById(siblingId);
}
This is where we retrieve the site area based on the path that was passed to the .jsp
Next, this is where most of the work takes place:
if (siblingSiteArea != null)
{
/* get the identity fields */
authors = siblingSiteArea.getAuthors();
owners = siblingSiteArea.getOwners();
readAccess = siblingSiteArea.getReadAccessMembers();
editAccess = siblingSiteArea.getEditAccessMembers();
deleteAccess = siblingSiteArea.getDeleteAccessMembers();
/* Now that we have the current site area, get the docId of the parent */
parentId = siblingSiteArea.getParent();
/* now we have sibling and parent site area, create the new site area */
newSiteArea = ws.createSiteArea(parentId, siblingId, ChildPosition.AFTER);
/* set the name and security */
if ((newName == null) || (newName.equals("")))
{
newName = siblingSiteArea.getName() + "_sibling";
}
newSiteArea.setName(newName);
newSiteArea.addAuthors(authors);
newSiteArea.addOwners(owners);
newSiteArea.addReadAccessMembers(readAccess);
newSiteArea.addEditAccessMembers(editAccess);
newSiteArea.addDeleteAccessMembers(deleteAccess);
newSiteAreaId = newSiteArea.getId();
/* save the site area */
ws.save(newSiteArea);
That whole block did the following:
1. retrieved the parent of the existing site area
2. retrieved the security/author/owner from existing site area
3. created the new site area
4. added the security/author/owner to the new site area
5. Saved the new site area
/*
* now, get the default content to get the authoring template, and create
* default content as well. Only if the default content name has been passed
*/
if ((newNameContent != null) && (!newNameContent.equals("")))
{
defaultContentId = siblingSiteArea.getDefaultContent();
if (defaultContentId != null)
{
defaultContent = (Content) ws.getById(defaultContentId);
authTemplateId = defaultContent.getAuthoringTemplateID();
wfId = defaultContent.getWorkflowId();
wfStageId = defaultContent.getWorkflowStageId();
authors = defaultContent.getAuthors();
owners = defaultContent.getOwners();
readAccess = defaultContent.getReadAccessMembers();
editAccess = defaultContent.getEditAccessMembers();
deleteAccess = defaultContent.getDeleteAccessMembers();
addViewers = defaultContent.getAdditionalViewers();
/* now we have auth template and parent site area */
newContent = ws.createContent(authTemplateId, newSiteAreaId, null, ChildPosition.END);
/* set the identity fields */
newContent.setName(newNameContent);
newContent.addAuthors(authors);
newContent.addOwners(owners);
newContent.addReadAccessMembers(readAccess);
newContent.addEditAccessMembers(editAccess);
newContent.addDeleteAccessMembers(deleteAccess);
newContent.addAdditionalViewers(addViewers);
newContent.setWorkflowId(wfId);
/* save the content */
ws.save(newContent);
/* set the default content */
newContentId = newContent.getId();
/* re retrieve the site area */
/* Now that its saved, loop until the worflow stage id's match */
newContent = (Content)ws.getById(newContentId);
while(!newContent.isPublished()) {
newContent.nextWorkflowStage();
}
newSiteArea = (SiteArea)ws.getById(newSiteAreaId);
newSiteArea.setDefaultContent(newContentId);
ws.save(newSiteArea);
}
}
}
}
That whole block finished out the following:
1. Retrieved default content from existing site area
2. use that content to get the authoring template, workflow, and current workflow stage
3. use that content to get security/author/owner
4. create new content, using the authoring template, workflow retrieved from default content
5. Moved the new content through the workflow until its the same stage
6. set the new content as default content for the newly created site area
Now that the .jsp files are in place, save them to /WPHOME/installedApps/WCM_LocalRenderingPortletHome/*.war/jsp/html
Creating the necessary WCM infrastructure for Content
In order to use the samples, a small WCM infrastructure needs to be put into place to act as placeholders for the WCM JSP components. This is so that when the forms are submitted to invoke the API, the WCM JSP components can be used to process the requests. There are many different ways to do this, this is only one way.
1. Create an Authoring Template named “APIAuthoringTemplate”. Add a JSP component named JSPComp to it. Add the necessary access to the Authoring template, save and close it.
2. Create a new Presentation Template named “APIPresentationTemplate“. In the body, reference the JSPComp you just added to the authoring template by adding
<Element context=”current” type=”content” key=”JSPComp”/><br>
To the presentation template. Add [all authenticated portal users] to read access, save and close the presentation template
3. Create a new site area to hold the API content. For me, it's DeploymentAPISiteArea. In the jsp's that act as forms, the value for this site area name will drive what the action for the form is. For example for mine:
4. ?WCM_GLOBAL_CONTEXT=/deployment/DeploymentTools/DeploymentAPISiteArea/createSiblingSiteAreaContent
This supposes a Library named deployment, Site named DeploymentTools, and site area named DeploymentAPISiteArea In this site area, add the mapping of the APIAuthoringTemplate authoring template to the APIPresentationTemplate presentation template you created in 1+2 above. Assign the necessary access to the site area, save and close
5. Create a piece of content, select the APIAuthoringTemplate authoring template. Name the content “createSiblingSiteAreaContent” Populate the JSPComp with /jsp/html/createSiblingSiteArea.jsp. Assign the necessary access, save the content under the site area created in step 3.
6. Create a piece of content, select the APIAuthoringTemplate authoring template. Name the content “createChildSiteAreaContent” Populate the JSPComp with /jsp/html/createChildSiteArea.jsp. Assign the necessary access, save the content under the site area created in step 3.
7. Create a piece of content, select the APIAuthoringTemplate authoring template. Name the content “getChildSiteAreaNameContent” Populate the JSPComp with /jsp/html/getChildSiteAreaName.jsp. Assign the necessary access, save the content under the site area created in step 3.
8. Create a piece of content, select the APIAuthoringTemplate authoring template. Name the content “getSiblingSiteAreaNameContent” Populate the JSPComp with /jsp/html/getSiblingSiteAreaName.jsp. Assign the necessary access, save the content under the site area created in step 3.
9. Final step is to update the getSiblingSiteAreaName.jsp and getChildSiteAreaName.jsp to use the correct path to the createSiblingSiteAreaContent and createChildSiteAreaContent content objects. This should be /libraryname/sitename/siteareaname/createSiblingSiteAreaContent and /libraryname/sitename/siteareaname/createChildSiteAreaContent
Creating the necessary WCM infrastructure for Navigation
Now that the necessary items for the API processing are in place, all thats left is to create the necessary WCM Navigator to display the buttons for invoking the necessary API operations.
The first step is to create the necessary HTML components for the navigator design elements. This is so that for each level in the navigation, we can create the correct javascript/html entry.
1.
Create a new Image component named IMG – CreateNew.jpg Upload an image to it that you want to show for creating sibling site areas
2. Create a new Image component named IMG - childButton Upload an image to it that you want to show for creating child site areas.
3. Create a new HTML component named HTML - CreateChildSiteArea . For the HTML, enter:
<a href="?WCM_GLOBAL_CONTEXT=/Deployment/deploymenttools/deploymentapisitearea/getchildsiteareanamecontent&path=<Placeholder tag="sitepath"/>" target="" title=""><Component name="img - childbutton"/></a>
Basically, all this ends up being is an href with an image as its text, and a link to display the content to display the form for creating a child site area. Also, it passes to the form the path of the Current site area. You will want to ensure that /Deployment/deploymenttools/deploymentapisitearea/getchildsiteareanamecontent is the correct path to your getChildSiteAreaNameContent
4. Create a new HTML component named HTML - CreateSiblingSiteArea . For the HTML, enter:
<a href="?WCM_GLOBAL_CONTEXT=/Deployment/deploymenttools/deploymentapisitearea/getsiblingsiteareanamecontent&path=<Placeholder tag="sitepath"/>" target="" title=""><Component name="img – createnew.jpg"/></a>
Basically, all this ends up being is an href with an image as its text, and a link to display the content to display the form for creating a child site area. Also, it passes to the form the path of the Current site area. You will want to ensure that /Deployment/deploymenttools/deploymentapisitearea/getsiblingsiteareanamecontent is the correct path to your getSiblingSiteAreaNameContent
5. Create a new HTML component named HTML - AltDesignHighlightExpand1 . Enter the following:
<script>foldersTree = gFld("<Placeholder tag="title"/>", "<Placeholder tag="href"/>") ;
foldersTree.treeID = "Frameless";</script>
Don't worry too much about the javascript, basically it sets up the information necessary to create the tree view of the expand/collapse navigator.
6. Create a new HTML component named HTML – AltDesignHighlightSiteAreaExpand1. Enter the following:
<script>foldersTree = gFld('<Placeholder tag="title"/>', '<Placeholder tag="href"/>') ;
foldersTree.treeID = "Frameless";</script>
You'll notice its pretty much ths aem as the other. The reason you need both is if you have Content being displayed in the top level, which I suppose may be impossible but it's there for simplification of the example
7. Create HTML component named HTML – AltDesignHighlightExpand2, enter the following
<script>aux1 = insFld(foldersTree, gFld("<Placeholder tag="title"/>", "<Placeholder tag="href"/>"));</script>
8. Create HTML component named HTML – AltDesignHighlightExpand3, enter the following
<script>aux2 = insFld(aux1, gFld("<Placeholder tag="title"/>", "<Placeholder tag="href"/>"));</script>
9. Create HTML component named HTML – AltDesignHighlightExpand4, enter the following
<script>aux3 = insFld(aux2, gFld("<Placeholder tag="title"/>", "<Placeholder tag="href"/>"));</script>
10. Create HTML component named HTML – AltDesignHighlightExpand5, enter the following
<script>aux4 = insFld(aux3, gFld("<Placeholder tag="title"/>", "<Placeholder tag="href"/>"));</script>
You'll notice the pattern, which is just to pass the prior level to the method, and give a new javascript name. This is all for building the tree later.
11. Create a new HTML component named HTML – AltDesignHighlightSiteAreaExpand2. Enter the following:
<script>aux1 = insFld(foldersTree, gFld('<Placeholder tag="title"/>', '<Placeholder tag="href"/>', ' <Component name="html - createsiblingsitearea"/> <Component name="html – createchildsitearea"/>'));</script>
One difference you'll notice is that we're now passing the HTML components that we created to hold the code for the links to create child and sibling site areas. That way, when the navigator is created, when it renders it will be able to render out the links.
12. Create a new HTML component named HTML – AltDesignHighlightSiteAreaExpand3. Enter the following:
<script>aux2 = insFld(aux1, gFld('<Placeholder tag="title"/>', '<Placeholder tag="href"/>', ' <Component name="html - createsiblingsitearea"/> <Component name="html – createchildsitearea"/>'));</script>
13. Create a new HTML component named HTML – AltDesignHighlightSiteAreaExpand4. Enter the following:
<script>aux3 = insFld(aux2, gFld('<Placeholder tag="title"/>', '<Placeholder tag="href"/>', ' <Component name="html - createsiblingsitearea"/> <Component name="html – createchildsitearea"/>'));</script>
14. Create a new HTML component named HTML – AltDesignHighlightSiteAreaExpand5. Enter the following:
<script>aux4 = insFld(aux3, gFld('<Placeholder tag="title"/>', '<Placeholder tag="href"/>', ' <Component name="html - createsiblingsitearea"/> <Component name="html – createchildsitearea"/>'));</script>
15. Create a new file resource component named FILE - treeJavascript.js , upload the ftiens4.js file included with the example. Note, this is the javascript library used to create the expand/collapse.
16. Create a new File Resource Component named FILE - ua.js Upload the ua.js file included.
17. Create a new JSP Component named JSP - TreeviewInit.jsp For the path, enter /jsp/html/TreeviewInit.jsp
18. There are some images that go along with the javascript for the tree view. Unzip the images.zip thats included with the files, and place in the /WPHOME/installedApps/WCM_LocalRenderingPortletHome/*.war/images directory
Next, we will create the navigator itself.
1. Create a new navigator component, named whatever you like
2. Choose Start Type to be Selected, and choose a top level site. This can be changed to fit needs later.
3. Choose “Include Start”, ancestor level none, Descendent level All, Preceding and Next Siblings level none.
4. Show Site unchecked, check Show Content. Select Expand current navigator branch one level: and Expand navigator to display current site area:
5. Results per page, this has to be large to work with large site areas. I chose 1000 here.
6. header:
<HTML>
<HEAD>
<STYLE>
/* */
/* Styles for the tree. */
/* */
SPAN.TreeviewSpanArea A {
font-size: 9pt;
font-family: verdana,helvetica;
text-decoration: none;
color: black;}
SPAN.TreeviewSpanArea A:hover {
color: '#820082';}
</STYLE>
<!------------------------------------------------------------>
</script>
<script language="JAVASCRIPT" src="<Component name="file - ua.js"/>"> </script>
<script language="JAVASCRIPT" src="<Component name="file - treejavascript.js"/>"></script>
</HEAD>
<BODY bgcolor="white" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onResize="if (navigator.family == 'nn4') window.location.reload()">
<Component jsp - treeviewinit.jsp"/>
</script>
7. Footer:
</script>
<TABLE cellspacing="0" cellpadding="2" border="0" width="100%">
<TR>
<TD bgcolor="white">
<TABLE border=0><TR><TD><FONT size=-2><a href="http://www.treemenu.net/" title="" target="_blank" style="font-size:7pt;text-decoration:none;color:silver"/></FONT></TD></TR></TABLE>
<SPAN class=TreeviewSpanArea>
<SCRIPT>initializeDocument()</SCRIPT>
</SPAN>
</TD>
</TR>
</TABLE>
8. Navigator result design 1
<AlternateDesign normal="MyCoInternetDesign/html - altdesignhighlightexpand1" type="content"/>
<AlternateDesign normal="MyCoInternetDesign/html - altdesignhighlightsiteareaexpand1" type="sitearea"/>
9. Navigator result design 2
<AlternateDesign normal="MyCoInternetDesign/html - altdesignhighlightexpand2" type="content"/>
<AlternateDesign normal="MyCoInternetDesign/html - altdesignhighlightsiteareaexpand2" type="sitearea"/>
10. Navigator result design 3
<AlternateDesign normal="MyCoInternetDesign/html - altdesignhighlightexpand3" type="content"/>
<AlternateDesign normal="MyCoInternetDesign/html - altdesignhighlightsiteareaexpand3" type="sitearea"/>
11. Navigator result design 4
<AlternateDesign normal="MyCoInternetDesign/html - altdesignhighlightexpand4" type="content"/>
<AlternateDesign normal="MyCoInternetDesign/html - altdesignhighlightsiteareaexpand4" type="sitearea"/>
12. Navigator result design 5
<AlternateDesign normal="MyCoInternetDesign/html - altdesignhighlightexpand5" type="content"/>
<AlternateDesign normal="MyCoInternetDesign/html - altdesignhighlightsiteareaexpand5" type="sitearea"/>
13. Save and close the navigator.
Once the navigator is complete, now you just have to deploy to the Website.
Creating the WP Page and Portlets for the editing navigator
1. In WP Administration, create a new WP page.
2. On the page, deploy 2 Web Content Viewer portlets, side by side.
3. On the left hand portlet, click on the Edit Shared Settings. Choose the following settings:
Content Type: Component
Component: Select the navigator component you have created
Content: Select a top level content object in the site that you want to edit
Broadcast To: This Page
Receive From: This Portlet
4. On the right hand portlet, click on Edit Shared Settings. Choose the following Settings:
Content Type: Content
Content: Choose a top level content object in the site you're editing
Broadcast To: This Page
Receive From: Other Portlets and This Portlet

Now, when you render the page, you should see something along these lines. Obviously, the content will differ:
Optional: Adding inline editing tools to the navigator
One last thing that may help is to add inline editing tools to the navigator. This way, when content is referenced by the navigator component, authors are only a click away. The first example will be valid for editing content on the local server. The second example will show how to use javascript to manipulate the URLs that are generated by the authoring tools component so that users are redirected to the backend WCM server.
1. Create an authoring tools component named AT - Remote Authoring Links. In each of the design fields, use the following:
<a href="<Placeholder tag="href"/>" target="_blank"><Placeholder tag="name"/></a>
2. Save and close the authoring tools components
3. Edit and save the following HTML components:
HTML - AltDesignHighlightExpand1
<script>foldersTree = gFld('<Placeholder tag="title"/>', '<Placeholder tag="href"/>',' <Component name="AT - Remote Authoring Links"/>') ;
foldersTree.treeID = "Frameless";</script>
HTML - AltDesignHighlightExpand2
<script>aux1 = insFld(foldersTree, gFld('<Placeholder tag="title"/>', '<Placeholder tag="href"/>',' <Component name="AT - Remote Authoring Links"/>'));</script>
HTML - AltDesignHighlightExpand3
<script>aux2 = insFld(aux1, gFld('<Placeholder tag="title"/>', '<Placeholder tag="href"/>',' <Component name="AT - Remote Authoring Links"/>'));</script>
HTML - AltDesignHighlightExpand4
<script>aux3 = insFld(aux2, gFld('<Placeholder tag="title"/>', '<Placeholder tag="href"/>',' <Component name="AT - Remote Authoring Links"/>'));</script>
HTML - AltDesignHighlightExpand5
<script>aux4 = insFld(aux3, gFld('<Placeholder tag="title"/>', '<Placeholder tag="href"/>',' <Component name="AT - Remote Authoring Links"/>'));</script>
In each case, all you will be doing is adding an extra parameter to the javascript methods that are defined. Specifically, you will just be passing a reference to the authoring tools component. That way, when the link to the content is rendered in the navigator, you will see the relevant links next to the content name:
If you want the links to be opened on a remote WP server, there is only a slight change.
1. In the authoring tools, use the following designs:
new:
<a id="<Placeholder tag="idnum"/>new" href="http://wcmauthoringserverhost:port<Placeholder tag="href"/>" onclick=changeLinkHref(\'<Placeholder tag="idnum"/>new\')>new</a>
read:
<a id="<Placeholder tag="idnum"/>read" href="http://wcmauthoringserverhost:port<Placeholder tag="href"/>" onclick=changeLinkHref(\'<Placeholder tag="idnum"/>read\')>read</a>
edit:
<a id="<Placeholder tag="idnum"/>edit" href="http://wcmauthoringserverhost:port<Placeholder tag="href"/>" onclick=changeLinkHref(\'<Placeholder tag="idnum"/>edit\')>edit</a>
delete:
<a id="<Placeholder tag="idnum"/>delete" href="http://wcmauthoringserverhost:port<Placeholder tag="href"/>" onclick=changeLinkHref(\'<Placeholder tag="idnum"/>delete\')>delete</a>
2. Create a text file with the following:
function getParameter ( queryString, parameterName ) {
// Add "=" to the parameter name (i.e. parameterName=value)
var parameterName = parameterName + "=";
if ( queryString.length > 0 ) {
// Find the beginning of the string
begin = queryString.indexOf ( parameterName );
// If the parameter name is not found, skip it, otherwise return the value
if ( begin != -1 ) {
// Add the length (integer) to the beginning
begin += parameterName.length;
// Multiple parameters are separated by the "&" sign
end = queryString.indexOf ( "&" , begin );
if ( end == -1 ) {
end = queryString.length
}
// now, check and see if # is there. If so, make that the end instead of &
end2 = queryString.indexOf ( "#" , begin );
if ((end2 > 0)&&(end2 < end)) {
end = end2;
}
// Return the string
return unescape ( queryString.substring ( begin, end ) );
}
// Return "null" if no parameter has been found
return "null";
}
}
function findLinkByHref(href) {
for (var i=0; i<document.links.length; i++) {
if (document.links[i].href == href) return i;
}
return -1;
}
function changeLinkHref(id) {
var newHref = generateNewURL(id);
if (document.links.length > 0) {
if (document.getElementById) {
document.getElementById(id).href = newHref;
}
else if (document.all) {
document.all[id].href = newHref;
}
else {
var index = findLinkByHref(oldHref);
if (index > -1) {
document.links[index].href = newHref;
}
}
}
}
function generateNewURL(elementId)
{
//var queryString = window.top.location.search.substring(1);
var queryString = document.getElementById(elementId).href;
var newURL = "http://wcmaix02.rtp.raleigh.ibm.com/wps/myportal/wcmAuthoring";
// now, need to see if pid and at exist
var pid = getParameter ( queryString, 'pid' );
var at = getParameter ( queryString, 'atid' );
var docid = getParameter ( queryString, 'docid' );
var authAction = getParameter ( queryString, 'wcmAuthoringAction' );
var dirType = getParameter ( queryString, 'directType' );
newURL = newURL+"?wcmAuthoringAction="+authAction;
if(dirType != "null")
{
newURL = newURL+"&directType="+dirType;
}
if(pid != "null")
{
newURL = newURL+"&pid="+pid;
}
if(at != "null")
{
newURL = newURL+"&atid="+at;
}
if(docid != "null")
{
newURL = newURL+"&docid="+docid;
}
return newURL;
}
3. Create a WCM File resource component, named FILE - deployment.js. Upload the file you created in step 2 to the file reasource, grant [all users] read access on the file resource component.
4. In the header of the navigator component that is used for the editing, add a
into the header. This will include the javascript you created above, so that the methods are available to the authoring tool component.