public LayoutBlock createNewLayoutBlock(String systemName,String userName){
  LayoutBlock block=null;
  if (userName == null || userName.equals("")) {
    log.error("Attempt to create a LayoutBlock with no user name");
    return null;
  }
  block=getByUserName(userName);
  if (block != null) {
    return null;
  }
  String sName="";
  if (systemName == null) {
    boolean found=true;
    while (found) {
      sName="ILB" + blkNum;
      blkNum++;
      block=getBySystemName(sName);
      if (block == null) {
        found=false;
      }
    }
  }
 else {
    block=getBySystemName((systemName.toUpperCase()));
    if (block != null) {
      return null;
    }
    sName=systemName.toUpperCase();
  }
  block=new LayoutBlock(sName,userName);
  register(block);
  return block;
}

public LayoutBlock createNewLayoutBlock ( String systemName , String userName ) { LayoutBlock block = null ; if ( userName == null || userName . equals ( "" ) ) { log . error ( "Attempt to create a LayoutBlock with no user name" ) ; return null ; } block = getByUserName ( userName ) ; if ( block != null ) { return null ; } String sName = "" ; if ( systemName == null ) { boolean found = true ; while ( found ) { sName = "ILB" + blkNum ; blkNum ++ ; block = getBySystemName ( sName ) ; if ( block == null ) { found = false ; } } } else { block = getBySystemName ( ( systemName . toUpperCase ( ) ) ) ; if ( block != null ) { return null ; } sName = systemName . toUpperCase ( ) ; } block = new LayoutBlock ( sName , userName ) ; register ( block ) ; return block ; }
method to create a new layoutblock if the layoutblock does not exist returns null if a layoutblock with the same systemname or username already exists , or if there is trouble creating a new layoutblock . note that since the username is used to address layoutblocks , the user name must be present . if the user name is not present , the new layoutblock is not created , and null is returned .
