Sunday, April 3, 2011

wM Broker as JMS Provider using JBoss

1. Set java home and JBoss home path under environment variables
2. Start the JBoss server
3. Go to MWS->Administration->Messaging->Broker Servers->Broker ->Adding New Broker for JMS (Not required, default one also can be used)
4. Go to MWS->Administration->Messaging->Naming Directories->Providers to ADD JMS Provider. Give Provider Name, Predefined Template and Provider URL
5. Go to MWS->Administration->Messaging->Naming Directories->Connection Factories to ADD Connection Factory. Give Lookup Name, Provider, Connection Factory Type, Broker, client group…
6. Go to MWS->Administration->Messaging->Naming Directories->Destination to ADD destination (Topic/Queue)
7. Add the created Destination to Document Types. Go to MWS->Administration->Messaging->Broker Servers->Document Types->ADD Topic under Broker80
8. Go to MWS->Administration->Messaging->Broker Servers->Client Groups->Add Document Types for IS-JMS client group under Broker80. SAG_JMS::Topic
9. Write a flow service to publish the document using pub.jms: send service.Set Connection Alias Name, Destination Name, Destination Type.
10. Check in MWS for Docs Published under the topic SAG_JMS::Topic


Sample Screen Shots













JSP page not loading in webMethods

Got - HTTP Status 404 - Servlet jsp 

Check for the following points and take action to rectify the issue.
1) The correspoding package where you have ur JSP's should have a package dependency mentionedWmTomcat and WmPublic

2) Navigate to IS_DIR\packages\WmTomcat\lib\ folder create a folder called endorsed and place xercesImpl.jar. 


Restart IS and try invoking the JSP

Select all table values using java script in CAF


CAF.Progress.overlay(document.blockEdgePanel4, "Please wait...");
if(this.checked)
{
  var checkedGroups = CAF.model('#{activePageBean.clientIds['hiddenCheckedGroups']}').getValue();
var Moduletable = CAF.model('#{activePageBean.clientIds['htmlForm:DataListTable']}');
var ModuleTemp = Moduletable.template();
for(i=0;i<Moduletable.getRowCount();i++)
{
var checkboxID = ModuleTemp.getControlId('htmlSelectBooleanCheckbox1');
var groupID = ModuleTemp.getControlId('htmlOutputLabel');
var replaceValue = Moduletable.get(i);
var newCheckboxID = checkboxID.replace('__template',replaceValue);
var newgroupID = groupID.replace('__template',replaceValue);
if(newCheckboxID != null)
{
  CAF.model(newCheckboxID).setValue(true);
  var groupValue =  CAF.model(newgroupID).getValue();      
  var Ltrim = '<SPAN class=caf-label-text>';
  var Rtrim = '</SPAN><SPAN class=caf-label-separator></SPAN>';
  groupValue = groupValue.replace(Ltrim,'');
  groupValue = groupValue.replace(Rtrim,'');
  if(checkedGroups.search(groupValue) == -1)
  {
  groupValue = groupValue+',';
      checkedGroups =checkedGroups+groupValue;
      }
}

}
 CAF.model('#{activePageBean.clientIds['hiddenCheckedGroups']}').setValue(checkedGroups);
 CAF.model('#{activePageBean.clientIds['htmlInputHidden1']}').setValue(true);
}

if(!this.checked)
{

var Moduletable = CAF.model('#{activePageBean.clientIds['htmlForm:DataListTable']}');
var ModuleTemp = Moduletable.template();
var checkedGroups = CAF.model('#{activePageBean.clientIds['hiddenCheckedGroups']}').getValue();
CAF.Progress.overlay(document.body, "Please wait...");
for(i=0;i< Moduletable.getRowCount();i++)
{

var checkboxID = ModuleTemp.getControlId('htmlSelectBooleanCheckbox1');
var replaceValue = Moduletable.get(i);
var  newCheckboxID = checkboxID.replace('__template',replaceValue);
if(newCheckboxID != null)
{
  CAF.model( newCheckboxID).setValue(false);
     }  
}
checkedGroups = '';
CAF.model('#{activePageBean.clientIds['hiddenCheckedGroups']}').setValue(checkedGroups);
CAF.model('#{activePageBean.clientIds['htmlInputHidden1']}').setValue(false);
}
CAF.Progress.hide(document.blockEdgePanel4);

Select table values using java script in CAF


var Moduletable = CAF.model('#{activePageBean.clientIds['defaultForm:asyncTable1']}');


var ModuleTemp = Moduletable.template();




for(i=0;i< Moduletable.getRowCount();i++)

{




var id1 = ModuleTemp.getControlId('htmlOutputText7');


var id2 = ModuleTemp.getControlId('htmlOutputText4');


var id3 = ModuleTemp.getControlId('htmlOutputText6');


var id4 = ModuleTemp.getControlId('htmlSelectOneMenu1');


var id5 = ModuleTemp.getControlId('htmlSelectOneMenu');


var sysID = Moduletable.get(i);


var idm1 = id1.replace('__template',sysID);

var idm2 = id2.replace('__template',sysID);

var idm3 = id3.replace('__template',sysID);

var idm4 = id4.replace('__template',sysID);

var idm5 = id5.replace('__template',sysID);

var modulename = CAF.model(idm1).getValue();

var date3 = CAF.model(idm2).getValue();

var date7 = CAF.model(idm3).getValue();

var exammonth= CAF.model(idm4).getValue();

var examyear = CAF.model(idm5).getValue();


var startmonth =date3.getMonth();

var startyear = date3.getYear();


startmonth =startmonth+ 1;


var endmonth =date7.getMonth();

var endyear = date7.getYear();


endmonth = endmonth + 1;

if(startyear > examyear)

{

alert('Enter valid Exam month and Year for'+ modulename);

return false;

}


if(endyear <examyear )

{

alert('Enter valid Exam month and Year for '+ modulename);

return false;

}


if(startyear == examyear)

{

if(startmonth >exammonth )

{

alert('Enter valid Exam month and Year for '+modulename);

return false;

}

}


if(endyear == examyear)

{

if(endmonth < exammonth )

{

alert('Enter valid Exam month and Year for '+ modulename);


return false;

}

}

}

Saturday, April 12, 2008

Formatting date from java util date

public String getdd_mm_yyyy(java.util.Date dat)
{
DateFormat df = DateFormat.getDateInstance();
String s = "";
StringBuffer tos = new StringBuffer(s);
FieldPosition fp = new FieldPosition(DateFormat.YEAR_FIELD);
StringBuffer sb = df.format(dat,tos,fp);
String s1 = sb.toString();
StringTokenizer st = new StringTokenizer(s1," ");
String mon=null , dd=null , yyyy=null;
if (st.hasMoreTokens())
{
mon = st.nextToken();
dd = st.nextToken();
yyyy = st.nextToken();
}
dd = dd.substring(0,dd.length()-1);
if (Integer.parseInt(dd)<10) dd="0"+dd;
s = dd + "-" + mon + "-" + yyyy;
return(s);
}

public java.util.Date getUtilDateFrom_ddmmyyyy(String ddmmyyyy)
{
String tempYear=null,tempMonth=null,tempDay=null;
String strtemp = ddmmyyyy;
StringTokenizer tokenss = new StringTokenizer(strtemp,"/");
if(tokenss.hasMoreTokens())
{
tempDay = tokenss.nextToken();
tempMonth = tokenss.nextToken();
tempYear = tokenss.nextToken();
}
return(new java.util.Date(Integer.parseInt(tempYear)-1900,Integer.parseInt(tempMonth)-1,Integer.parseInt(tempDay)));
}