/**
   * Get the contents of the Columns object with the given role name, or of the 'Columns' for the
   * default role if nothing for the specified role can be found.
   *
   * @param the name of the role
   * @return the contents of 'Columns' as an array of 'Column'
   */
  public Column[] getColumns(String strRoleName) {
    Columns columns = null;

    columns = getColumnsByRole(strRoleName);

    if (columns == null) return null;
    else return (Column[]) columns.getColumnList().toArray(new ColumnImpl[0]);
  }
  /*
   * (non-Javadoc)
   * @see com.silverpeas.workflow.api.model.Presentation#deleteColumns(java.lang. String)
   */
  public void deleteColumns(String strRoleName) throws WorkflowException {
    Columns search = createColumns();

    search.setRoleName(strRoleName);
    if (!columnsList.remove(search))
      throw new WorkflowException(
          "PresentationImpl.deleteColumns",
          "workflowEngine.EX_COLUMNS_NOT_FOUND",
          "Columns role name=" + strRoleName == null ? "<null>" : strRoleName);
  }
  /*
   * (non-Javadoc)
   * @see com.silverpeas.workflow.api.model.Presentation#getColumnsByRole(java.lang .String)
   */
  public Columns getColumnsByRole(String strRoleName) {
    Columns search;
    int index, indexDefault;

    if (columnsList == null) return null;

    search = createColumns();
    search.setRoleName(strRoleName);
    index = columnsList.indexOf(search);

    if (index == -1) {
      search.setRoleName("default");
      indexDefault = columnsList.indexOf(search);

      if (indexDefault == -1) return null;

      return (Columns) columnsList.get(indexDefault);
    } else return (Columns) columnsList.get(index);
  }