public boolean isSemiCenteralized() {
   ResultPage result =
       NliUserManagementServiceProxy.getInstance()
           .findAllOrganizationUnits(0, 100, new GridFilter());
   if (result.getCount() == 1) return true;
   else return false;
 }
  private void initGuiComponents() {
    this.setTitle(props.getProperty("title.text"));
    btnConfirm = ComponentFactory.createButton(confirmAction);
    btnCancel = ComponentFactory.createButton(cancelAction);

    txfImageURL = ComponentFactory.createTextField(20);
    txfDatabaseURL = ComponentFactory.createTextField(20);
    txfUserName = ComponentFactory.createTextField(20);
    txfPassword = new JPasswordField(20);
    txfFromMemberNo = ComponentFactory.createTextField(20);
    txfToMemberNo = ComponentFactory.createTextField(20);
    txfProfileDatabase = ComponentFactory.createTextField(20);
    txfMultimediaDatabase = ComponentFactory.createTextField(20);

    libraryList =
        NliUserManagementServiceProxy.getInstance().findAllWorkGroupsByType(LibraryUnit.class);

    tblLibrary = ComponentFactory.createTable();
    initTable(libraryList);

    cmbLocations = ComponentFactory.createComboBox();
    List list = NliProfileServiceProxy.getInstance().findLocationsAtFirstLevel();
    cmbLocations.setModel(new DefaultComboBoxModel(list.toArray()));
    cmbLocations.setRenderer(
        new DefaultListCellRenderer() {
          @Override
          public Component getListCellRendererComponent(
              JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            Location location = (Location) value;
            Component listCellRendererComponent =
                super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
            if (location != null) setText(location.getTitle());
            return listCellRendererComponent;
          }
        });

    cbUseUniqueNameToFindUser = new JCheckBox(props.getProperty("useUniqueNameToFindUser.text"));
    cbIsOrg = new JCheckBox(props.getProperty("isOrg.text"));
    cbIsUniversity = new JCheckBox(props.getProperty("isUniversity.text"));
    cbUseProfileSetting = new JCheckBox(props.getProperty("useProfileSetting.text"));

    txfDatabaseURL.setText(
        "jdbc:sqlserver://192.168.1.17:1433;databaseName=ParsProfile_ParsAzarakhsh;integratedSecurity=false");
    txfUserName.setText("digilibadminlogin");
    txfPassword.setText("manager");
    txfImageURL.setText("F:\\pimage");
    txfFromMemberNo.setText("1");
    txfToMemberNo.setText("10");
    txfProfileDatabase.setText("ParsLibrary_ParsAzarakhsh");
    txfMultimediaDatabase.setText("ParsMultimedia_ParsAzarakhsh");
  }
Exemplo n.º 3
0
  protected StorageJSFTable createTable() {
    List<Role> roles = new ArrayList<Role>();
    Role role =
        NliUserManagementServiceProxy.getInstance().findRoleByCode(Administrator.ROLE_ADMIN);
    roles.add(role);

    WorklistUsersDataFetcher fetcher =
        new WorklistUsersRowData.WorklistUsersDataFetcher(getLocale(), roles);
    return new StorageJSFTable(
        new UserColumnModel(),
        fetcher,
        new GridCriteriaModel(),
        null,
        null,
        true,
        0,
        Constants.KEY_TABLE_LOV);
  }
/** Author: Vahid Hassani Date: ۲۰۰۹/۵/۱۲ Time: ۱۶:۳۰:۲۹ */
public class SelectAccessModuleParentBean extends BaseBean {

  private JSFTable model;
  private NliUserManagementServiceProxy service = NliUserManagementServiceProxy.getInstance();

  public SelectAccessModuleParentBean() {

    AccessModule accessModule = (AccessModule) JsfUtils.getFromPageFlow("accessModule");
    //        if (JsfUtils.getFromPageFlow("grid_"+AccessModuleRowData.class.getName() + "_fetcher")
    // == null ){
    AccessModuleRowData.AccessModuleDataFetcher fetcher =
        new AccessModuleRowData.AccessModuleDataFetcher(
            JsfUtils.getInstance().getLocale(), accessModule, true);
    //        }
    this.model = Util.makeTableFromRowData(AccessModuleRowData.class, fetcher, 100);
  }

  public JSFTable getModel() {
    return model;
  }

  public void setModel(JSFTable model) {
    this.model = model;
  }

  public void selectAndReturn(ActionEvent event) {

    AccessModuleRowData row = (AccessModuleRowData) JsfUtils.resolveVariable("row");
    AccessModule accessModule = (AccessModule) row.getEntity();

    Map map = new HashMap();
    map.put(UserManagementConstants.SELECTED_ACCESSMODULE_OBJECT_NAME, accessModule);

    RequestContext.getCurrentInstance().returnFromDialog(accessModule.getTitle(), map);
  }
}