Thursday 31 October 2013

WCS Code to find storeId from user LogonId (Expecting that user has registereigd customer role from one store only)

MemberRoleAccessBean m = new MemberRoleAccessBean();
Enumeration mEnum = m.findByMemberIdRoleId(cmdContext.getUserId(),Integer.valueOf("-29"));
Enumeration sEnum = null;
if(mEnum.hasMoreElements()){
   m =(MemberRoleAccessBean)mEnum.nextElement();
   StoreEntityAccessBean stAb = new StoreEntityAccessBean();
   sEnum = stAb.findByMember(Long.valueOf(m.getOrgEntityId()));
   if (sEnum.hasMoreElements()){
   stAb =(StoreEntityAccessBean)sEnum.nextElement();
   storeId = stAb.getStoreEntityId();
}
}

No comments:

Post a Comment

How to customize java.util.logging.Logger class to write logs in separate file than System.out.log in Websphere commerce/ HCL commerce)

/** * This method updated the passed in java.util.logging.Logger object with * custom file handler to write logs data form that class ...