Package de.forsthaus.backend.model

Examples of de.forsthaus.backend.model.SecRole


@Repository
public class SecRoleDAOImpl extends BasisDAO<SecRole> implements SecRoleDAO {

  @Override
  public SecRole getNewSecRole() {
    return new SecRole();
  }
View Full Code Here


      if (cb != null) {

        if (cb.isChecked() == true) {

          // Get the role object by casting
          SecRole aRole = (SecRole) listitem.getAttribute("data");
          // get the user
          SecUser anUser = getSelectedUser();

          // check if the item is newly checked. If so we cannot
          // found it in the SecUserrole-table
          SecUserrole anUserRole = getSecurityService().getUserroleByUserAndRole(anUser, aRole);

          // if new, we make a newly Object
          if (anUserRole == null) {
            anUserRole = getSecurityService().getNewSecUserrole();
            anUserRole.setSecUser(anUser);
            anUserRole.setSecRole(aRole);
          }

          try {
            // save to DB
            getSecurityService().saveOrUpdate(anUserRole);
          } catch (DataAccessException e) {
            ZksampleMessageUtils.showErrorMessage(e.getMostSpecificCause().toString());
          }

        } else if (cb.isChecked() == false) {

          // Get the role object by casting
          SecRole aRole = (SecRole) listitem.getAttribute("data");
          // get the user
          SecUser anUser = getSelectedUser();

          // check if the item is newly checked. If so we cannot
          // found it in the SecUserrole-table
View Full Code Here

  }

  @Override
  public void render(Listitem item, Object data) throws Exception {

    final SecRole role = (SecRole) data;

    Listcell lc = new Listcell();
    final Checkbox cb = new Checkbox();

    // get the role for which we pull the data
    final SecUser user = this.parentController.getSelected();

    if (user != null) {
      if (getSecurityService().isUserInRole(user, role)) {
        cb.setChecked(true);
      } else {
        cb.setChecked(false);
      }
    } else {
      cb.setChecked(false);
    }

    lc.appendChild(cb);
    lc.setParent(item);

    lc = new Listcell(role.getRolShortdescription());
    lc.setParent(item);

    // lc = new Listcell();
    // Image img = new Image();
    // img.setSrc("/images/icons/page_detail.gif");
View Full Code Here

        if (cb.isChecked() == true) {

          // Get the group object by casting
          SecGroup aGroup = (SecGroup) listitem.getAttribute("data");
          // get the role
          SecRole aRole = getSelectedRole();

          // check if the item is newly checked. If so we cannot found
          // it in the SecGroupRight-table
          SecRolegroup aRoleGroup = getSecurityService().getRolegroupByRoleAndGroup(aRole, aGroup);

          // if new, we make a newly Object
          if (aRoleGroup == null) {
            aRoleGroup = getSecurityService().getNewSecRolegroup();
            aRoleGroup.setSecGroup(aGroup);
            aRoleGroup.setSecRole(aRole);
          }

          try {
            // save to DB
            getSecurityService().saveOrUpdate(aRoleGroup);
          } catch (DataAccessException e) {
            ZksampleMessageUtils.showErrorMessage(e.getMostSpecificCause().toString());
          }

        } else if (cb.isChecked() == false) {

          // Get the group object by casting
          SecGroup aGroup = (SecGroup) listitem.getAttribute("data");
          // get the role
          SecRole aRole = getSelectedRole();

          // check if the item is newly unChecked. If so we must
          // found it in the SecRolegroup-table
          SecRolegroup aRoleGroup = getSecurityService().getRolegroupByRoleAndGroup(aRole, aGroup);
View Full Code Here

    // get the selected object
    Listitem item = this.listBoxSecRole.getSelectedItem();

    // Casting
    SecRole aRole = (SecRole) item.getAttribute("data");
    setSelectedRole(aRole);

    // ++ create the searchObject and init sorting ++//
    HibernateSearchObject<SecGroup> soSecRolegroup = new HibernateSearchObject<SecGroup>(SecGroup.class, getCountRowsSecRolegroup());
    soSecRolegroup.addSort("grpShortdescription", false);
View Full Code Here

  private static final Logger logger = Logger.getLogger(AppRolesListModelItemRenderer.class);

  @Override
  public void render(Listitem item, Object data) throws Exception {

    final SecRole role = (SecRole) data;

    Listcell lc = new Listcell(String.valueOf(role.getId()));
    lc.setParent(item);
    lc = new Listcell(role.getRolShortdescription());
    lc.setParent(item);

    item.setAttribute("data", data);
    // ComponentsCtrl.applyForward(img, "onClick=onImageClicked");
    // ComponentsCtrl.applyForward(item, "onClick=onClicked");
View Full Code Here

    // get the params map that are overhanded by creation.
    Map<String, Object> args = getCreationArgsMap(event);

    if (args.containsKey("role")) {
      SecRole aRole = (SecRole) args.get("role");
      setRole(aRole);
    } else {
      setRole(null);
    }
View Full Code Here

   *
   * @throws InterruptedException
   */
  private void doDelete() throws InterruptedException {

    final SecRole aRole = getRole();

    // Show a confirm box
    String msg = Labels.getLabel("message.Question.Are_you_sure_to_delete_this_record") + "\n\n --> " + aRole.getRolShortdescription();
    String title = Labels.getLabel("message.Deleting.Record");

    MultiLineMessageBox.doSetTemplate();
    if (MultiLineMessageBox.show(msg, title, MultiLineMessageBox.YES | MultiLineMessageBox.NO, MultiLineMessageBox.QUESTION, true, new EventListener() {
      @Override
View Full Code Here

   *
   * @throws InterruptedException
   */
  public void doSave() throws InterruptedException {

    final SecRole aRole = getRole();

    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    // force validation, if on, than execute by component.getValue()
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    if (!isValidationOn()) {
View Full Code Here

  private static final Logger logger = Logger.getLogger(SecRolegroupRoleListModelItemRenderer.class);

  @Override
  public void render(Listitem item, Object data) throws Exception {

    final SecRole role = (SecRole) data;

    Listcell lc;

    lc = new Listcell(role.getRolShortdescription());
    lc.setParent(item);

    // lc = new Listcell();
    // Image img = new Image();
    // img.setSrc("/images/icons/page_detail.gif");
View Full Code Here

TOP

Related Classes of de.forsthaus.backend.model.SecRole

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.