Thursday, September 20, 2012

How to delete a profile from a IBM WebSphere Application Server

1) Location:

<root>\AppServer\bin\manageprofiles.bat

syntax:

manageprofiles.bat -delete -profileName <profile_name> (case sensitive commands)

Note: This used to be wasprofile.bat in version 6.0.x and is depricated in 6.1. The Windows service for the profile will have been set to disabled now.

2) Delete the profile folder

e.g <root>\ApplicationServer\profiles\<profile_name>

3) Validate the profile registry and lists the non-valid profiles that it purges

manageprofiles.bat -validateAndUpdateRegistry


4) Remove the Windows service that is set to run the profile.

WASService.exe -remove service_name

e.g If the service name is "IBM Websphere Application Server V6.1 - <computername>Node<xx>"

Then the command will be:

WASService.exe -remove "<computername>Node<xx>"

Note: The same procedure applies to Linux running the correct script

Wednesday, September 19, 2012

Get Parent workitem on save precondition

Nice snippet found in jazz.net!!
 
public IWorkItemHandle findParent(AdvisableOperation operation) throws TeamRepositoryException {
Object data = operation.getOperationData();

if (data instanceof ISaveParameter) // from Workitem -> save operation
{
ISaveParameter saveParameter = (ISaveParameter) data;
IWorkItemReferences ref = saveParameter.getNewReferences();
List<IEndPointDescriptor> types = ref.getTypes();
for (IEndPointDescriptor desc : types)
{
if (desc.getId().equalsIgnoreCase("parent")) // "parent" is an RTC/Jazz string ID
{
List<IReference> refList = ref.getReferences(desc);

if (refList.size() > 0)
{
IReference iRef = refList.get(0); // Only one parent
Object obj = iRef.resolve();
if (obj instanceof IWorkItemHandle) // Only looking for Workitems.
{
return (IWorkItemHandle) obj;
}
else
return null;
}
else
return null;
}
}
}
return null;


The WorkItemEndPoints are only a subset. 

Example for requirements: Use the WorkItemLinkTypes and the ILinkRegistry.
ILinkTypeRegistry.INSTANCE.getLinkType(WorkItemLinkTypes.IMPLEMENTS_REQUIREMENT).getTargetEndPointDescriptor() 

Monday, September 17, 2012

RTC - Import plugins for Jetty based launches

Always the same thing happens to me when I prepare a development environment for RTC. Where are the plugins for Jetty?

There are three plugins you will need to import (one from the RTC SDK and two from your installed server).




Anyway, with this diagram I hope I never forget import the plugins!