Examples of StructLocal


Examples of org.nightlabs.jfire.prop.StructLocal

  public static final StructFieldID COMMENT_FIELD = StructFieldID.create(COMMENT_BLOCK, "Order.comment");

  public static IStruct getOrderStructLocal(PersistenceManager pm) {
    String devOrganisationID = Organisation.DEV_ORGANISATION_ID;
    Struct articleContainerStruct = null;
    StructLocal articleContainerStructLocal = null;
    try {
      articleContainerStruct = Struct.getStruct(devOrganisationID, Order.class, Struct.DEFAULT_SCOPE, pm);
    } catch (JDOObjectNotFoundException e) {
      // articleContainerStruct not persisted yet.
      articleContainerStruct = new Struct(devOrganisationID, Order.class.getName(), Struct.DEFAULT_SCOPE);
      createDefaultStructure(articleContainerStruct);
      // TODO use MultiLanguagePropertiesBundle for externalization
      articleContainerStruct.getName().setText(Locale.ENGLISH.getLanguage(), "Order");
      articleContainerStruct.getName().setText(Locale.GERMAN.getLanguage(), "Auftrag");
      articleContainerStruct = pm.makePersistent(articleContainerStruct);
    }

    try {
      articleContainerStructLocal = StructLocal.getStructLocal(pm, devOrganisationID, Order.class, articleContainerStruct.getStructScope(), StructLocal.DEFAULT_SCOPE);
    } catch (JDOObjectNotFoundException e) {
      articleContainerStructLocal = new StructLocal(articleContainerStruct, StructLocal.DEFAULT_SCOPE);
      // TODO use MultiLanguagePropertiesBundle for externalization
      articleContainerStructLocal.getName().setText(Locale.ENGLISH.getLanguage(), "Default order structure");
      articleContainerStructLocal.getName().setText(Locale.GERMAN.getLanguage(), "Standardstruktur für Aufträge");
      articleContainerStructLocal = pm.makePersistent(articleContainerStructLocal);
    }
    return articleContainerStructLocal;
  }
View Full Code Here

Examples of org.nightlabs.jfire.prop.StructLocal

  public static final StructFieldID COMMENT_FIELD = StructFieldID.create(COMMENT_BLOCK, "Offer.comment");

  public static IStruct getOfferStructLocal(PersistenceManager pm) {
    String devOrganisationID = Organisation.DEV_ORGANISATION_ID;
    Struct articleContainerStruct = null;
    StructLocal articleContainerStructLocal = null;
    try {
      articleContainerStruct = Struct.getStruct(devOrganisationID, Offer.class, Struct.DEFAULT_SCOPE, pm);
    } catch (JDOObjectNotFoundException e) {
      // articleContainerStruct not persisted yet.
      articleContainerStruct = new Struct(devOrganisationID, Offer.class.getName(), Struct.DEFAULT_SCOPE);
      createDefaultStructure(articleContainerStruct);
      // TODO use MultiLanguagePropertiesBundle for externalization
      articleContainerStruct.getName().setText(Locale.ENGLISH.getLanguage(), "Offer");
      articleContainerStruct.getName().setText(Locale.GERMAN.getLanguage(), "Angebot");
      articleContainerStruct = pm.makePersistent(articleContainerStruct);
    }

    try {
      articleContainerStructLocal = StructLocal.getStructLocal(pm, devOrganisationID, Offer.class, articleContainerStruct.getStructScope(), StructLocal.DEFAULT_SCOPE);
    } catch (JDOObjectNotFoundException e) {
      articleContainerStructLocal = new StructLocal(articleContainerStruct, StructLocal.DEFAULT_SCOPE);
      // TODO use MultiLanguagePropertiesBundle for externalization
      articleContainerStructLocal.getName().setText(Locale.ENGLISH.getLanguage(), "Default offer structure");
      articleContainerStructLocal.getName().setText(Locale.GERMAN.getLanguage(), "Standardstruktur für Angebote");
      articleContainerStructLocal = pm.makePersistent(articleContainerStructLocal);
    }
    return articleContainerStructLocal;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.