Package org.openbravo.base.structure

Examples of org.openbravo.base.structure.ClientEnabled


  // TODO: this is maybe not the best location for this functionality??
  protected void setClientOrganization(Object o) {
    final OBContext obContext = OBContext.getOBContext();
    if (o instanceof ClientEnabled) {
      final ClientEnabled ce = (ClientEnabled) o;
      // reread the client
      if (ce.getClient() == null) {
        final Client client = SessionHandler.getInstance().find(Client.class,
            obContext.getCurrentClient().getId());
        ce.setClient(client);
      }
    }
    if (o instanceof OrganizationEnabled) {
      final OrganizationEnabled oe = (OrganizationEnabled) o;
      // reread the client and organization
View Full Code Here


    }
  }

  protected void checkClientOrganizationSet(BaseOBObject bob) {
    if (bob.getEntity().isClientEnabled()) {
      final ClientEnabled ce = (ClientEnabled) bob;
      if (ce.getClient() == null) {
        error("The client of entity " + bob.getIdentifier()
            + " is not set. For a client data import the client needs"
            + " to be set. Check that the xml was created "
            + "with client/organization property export to true");
      }
View Full Code Here

    if (isOptionClientImport()) {
      return;
    }

    if (bob.getEntity().isClientEnabled()) {
      final ClientEnabled ce = (ClientEnabled) bob;
      if (!ce.getClient().getId().equals(getClient().getId())) {
        warn(prefix + " entity " + bob.getIdentifier()
            + " eventhough it does not belong to the target client " + getClient().getIdentifier()
            + " but to client " + ce.getClient().getIdentifier());
      }
    }
    if (bob.getEntity().isOrganizationEnabled()) {
      final OrganizationEnabled oe = (OrganizationEnabled) bob;
      if (!oe.getOrganization().getId().equals(getOrganization().getId())) {
View Full Code Here

      String newClientId = null;

      // and never insert anything in client 0
      for (final BaseOBObject bob : ir.getInsertedObjects()) {
        if (bob instanceof ClientEnabled) {
          final ClientEnabled ce = (ClientEnabled) bob;
          assertNotNull(ce.getClient());
          assertTrue(!ce.getClient().getId().equals("0"));
          newClientId = ce.getClient().getId();
        }
      }
      assertTrue(newClientId != null);
      assertTrue(!clientId.equals(newClientId));
      commitTransaction();
View Full Code Here

TOP

Related Classes of org.openbravo.base.structure.ClientEnabled

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.