Package com.tll.common.model

Examples of com.tll.common.model.Model$ModelPropSet


      // set the quasi-id
      ai.setId(ais.getAccountId() + '|' + ais.getInterfaceId());

      final Marshaler marshaler = context.getMarshaler();
      final MarshalOptions moptions = context.getMarshalOptionsResolver().resolve(SmbizEntityType.ACCOUNT_INTERFACE);
      final Model m = marshaler.marshalEntity(ai, moptions);
      payload.setModel(m);
    }
    else
      throw new IllegalArgumentException("Unhandled account interface data search type.");
  }
View Full Code Here


    ai = marshaler.marshalModel(model, ai);
    isvc.setAccountInterface(ai);

    final MarshalOptions moptions = context.getMarshalOptionsResolver().resolve(SmbizEntityType.ACCOUNT_INTERFACE);
    final Model m = marshaler.marshalEntity(ai, moptions);
    payload.setModel(m);
  }
View Full Code Here

    return "Account";
  }

  @Override
  protected Model entityToModel(IEntityType entityType, IEntity e) throws Exception {
    final Model m = super.entityToModel(entityType, e);
    assert m != null;
    final Account a = (Account) e;
    if(a.getParent() != null) {
      final PrimaryKey<Account> pk = new PrimaryKey<Account>(Account.class, a.getParent().getId());
      final IAccountService svc = context.getEntityServiceFactory().instance(IAccountService.class);
      final Account parent = svc.load(pk);
      final Model mparent = new Model(SmbizEntityType.ACCOUNT);
      mparent.set(new StringPropertyValue(Model.ID_PROPERTY, parent.getId()));
      mparent.set(new StringPropertyValue(Model.NAME_PROPERTY, parent.getName()));
      m.set(new RelatedOneProperty(SmbizEntityType.ACCOUNT, mparent, "parent", true));
    }
    return m;
  }
View Full Code Here

    }
    catch(final ClassCastException e) {
      s.addMsg("Invalid account type.", MsgLevel.ERROR, MsgAttr.STATUS.flag);
      return p;
    }
    Model maccount = request.getAccount();
    if(maccount == null) {
      s.addMsg("No account specified.", MsgLevel.ERROR, MsgAttr.STATUS.flag);
      return p;
    }
    final Collection<Model> maios = request.getAccountInterfaces();
View Full Code Here

    return "Customer Account";
  }

  @Override
  protected Model entityToModel(IEntityType entityType, IEntity e) throws Exception {
    final Model m = super.entityToModel(entityType, e);
    return m;
  }
View Full Code Here

          @Override
          public void onValueChange(ValueChangeEvent<SmbizEntityType> event) {
            intfType = event.getValue();
            assert intfType != null;
            final Model m = ModelAssembler.assemble(intfType);
            assert m != null;
            intfStack.addInterface(m, false);
            IntfSlectDlg.this.hide();
            intfStack.showInterface(intfStack.getNumInterfaces() - 1);
          }
View Full Code Here

          @Override
          public void onValueChange(ValueChangeEvent<SmbizEntityType> event) {
            intfType = event.getValue();
            assert intfType != null;
            final Model m = ModelAssembler.assemble(intfType);
            assert m != null;
            intfStack.addInterface(m, false);
            IntfSlectDlg.this.hide();
            intfStack.showInterface(intfStack.getNumInterfaces() - 1);
          }
View Full Code Here

      return config.getListingElementName();
    }

    @Override
    protected void doEditRow(int rowIndex) {
      final Model rowData = getRowData(rowIndex);
      final String cid = rowData.asString("customer.id");
      final ModelKey ck = new ModelKey(SmbizEntityType.CUSTOMER, cid, null);
      ViewManager.get().dispatch(
          new ShowViewRequest(new EditViewInitializer(AccountEditView.klas, ck)));
    }
View Full Code Here

    userSessionListeners.remove(listener);
  }

  public void onAdminContextChange(AdminContext ac, ChangeType changeType) {
    if(changeType == ChangeType.USER_CHANGE) {
      final Model user = ac.getUser();
      final Model account = ac.getUserAccount();

      // update the current user panel
      rightNav.setCurrentUser(user);
      rightNav.setCurrentAccount(account);

      // clear out the views
      ViewManager.get().clear();

      // set the initial view based on the user's account type
      ViewManager.get().dispatch(
          new ShowViewRequest(MainViewClass.getMainViewClass((SmbizEntityType) account.getEntityType())));
    }
    else if(changeType == ChangeType.ACCOUNT_CHANGE) {
      // update the current account panel
      rightNav.setCurrentAccount(ac.getAccount());
    }
View Full Code Here

    private void setCurrentUser(Model user) {
      vlUsername.setText(user.asString("emailAddress"));
      vlUsername.setViewInitializer(new EditViewInitializer(UserEditView.klas, user));
      lblUserDateCreated.setText(Fmt.format(user.getDateCreated(), GlobalFormat.DATE));
      final Model account = user.nestedModel("account");
      if(account != null) {
        vlUserAccount.setText(account.getName());
        vlUserAccount.setViewInitializer(new EditViewInitializer(AccountEditView.klas, account));
      }
      else {
        vlUserAccount.setText("-");
        vlUserAccount.setViewInitializer(null);
View Full Code Here

TOP

Related Classes of com.tll.common.model.Model$ModelPropSet

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.