Package org.nightlabs.jfire.prop

Examples of org.nightlabs.jfire.prop.Struct


  public static final StructBlockID COMMENT_BLOCK = StructBlockID.create(DEV_ORGANISATION_ID, "Order.comment");
  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");
View Full Code Here


  public static final StructBlockID COMMENT_BLOCK = StructBlockID.create(DEV_ORGANISATION_ID, "Offer.comment");
  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");
View Full Code Here

TOP

Related Classes of org.nightlabs.jfire.prop.Struct

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.