Esempio n. 1
0
  public WOActionResults createDataStore() throws IOException, MessagingException {
    File emailFile = new File("Resources/largeEmail.eml");
    javax.mail.Message message = convertEmlToMessage(emailFile);

    EOObjectStore osc = new ERXObjectStoreCoordinator(true);
    EOEditingContext ec = ERXEC.newEditingContext(osc);
    ec.lock();
    try {
      DataContainer container =
          (DataContainer)
              EOUtilities.createAndInsertInstance(ec, DataContainer.class.getSimpleName());

      DataStore dataStore =
          (DataStore) EOUtilities.createAndInsertInstance(ec, DataStore.class.getSimpleName());
      dataStore.setDataContainer(container);

      ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
      message.writeTo(byteStream);
      NSData rawEmail = new NSData(byteStream.toByteArray());
      dataStore.setData(rawEmail);

      ec.saveChanges();
    } finally {
      ec.unlock();
      ec.dispose();
      osc.dispose();
      ec = null;
      osc = null;
    }
    return null;
  }
Esempio n. 2
0
 public static Category createCategory(EOEditingContext editingContext, Integer id, String name) {
   Category eo =
       (Category) EOUtilities.createAndInsertInstance(editingContext, _Category.ENTITY_NAME);
   eo.setId(id);
   eo.setName(name);
   return eo;
 }
Esempio n. 3
0
 public WOActionResults saveType() {
   EOEditingContext ec = (EOEditingContext) valueForBinding("ec");
   ec.lock();
   try {
     boolean newType = (currType == null);
     if (newType) {
       currType = (ItogType) EOUtilities.createAndInsertInstance(ec, ItogType.ENTITY_NAME);
       Number maxSort = (Number) valueForBinding("maxSort");
       if (maxSort != null) {
         currType.setSort(new Integer(maxSort.intValue() + 1));
       } else {
         currType.setSort(new Integer(1));
       }
     }
     currType.setName(itogName);
     currType.setTitle(itogTitle);
     currType.setInYearCount((itogCount == null) ? new Integer(0) : itogCount);
     ec.saveChanges();
     //			if(newType) {
     //				allTypes = allTypes.arrayByAddingObject(currType);
     //				itogsList = NSArray.EmptyArray;
     //			}
     setValueForBinding(currType, "currType");
   } catch (Exception e) {
     SetupItogs.logger.log(WOLogLevel.WARNING, "Error saving changes in list ", e);
     session().takeValueForKey(e.getMessage(), "message");
     ec.revert();
   } finally {
     ec.unlock();
   }
   return (WOActionResults) valueForBinding("actionResult");
 }
Esempio n. 4
0
 public org.pachyderm.foundation.eof.PDBScreen createEveryScreenRelationship() {
   EOEnterpriseObject eo =
       EOUtilities.createAndInsertInstance(
           editingContext(), org.pachyderm.foundation.eof.PDBScreen.ENTITY_NAME);
   addObjectToBothSidesOfRelationshipWithKey(eo, _PDBPresentation.EVERY_SCREEN_KEY);
   return (org.pachyderm.foundation.eof.PDBScreen) eo;
 }
Esempio n. 5
0
 public static EOBap createBap(
     EOEditingContext editingContext, NSTimestamp dCreation, NSTimestamp dModification) {
   EOBap eo = (EOBap) EOUtilities.createAndInsertInstance(editingContext, _EOBap.ENTITY_NAME);
   eo.setDCreation(dCreation);
   eo.setDModification(dModification);
   return eo;
 }
 public static EOVPersonnelActuelEns createVPersonnelActuelEns(
     EOEditingContext editingContext, org.cocktail.feve.eos.modele.grhum.EOIndividu toIndividu) {
   EOVPersonnelActuelEns eo =
       (EOVPersonnelActuelEns)
           EOUtilities.createAndInsertInstance(editingContext, _EOVPersonnelActuelEns.ENTITY_NAME);
   eo.setToIndividuRelationship(toIndividu);
   return eo;
 }
 public static ERSyncClientDevice createERSyncClientDevice(
     EOEditingContext editingContext, Boolean disable, String name) {
   ERSyncClientDevice eo =
       (ERSyncClientDevice)
           EOUtilities.createAndInsertInstance(editingContext, _ERSyncClientDevice.ENTITY_NAME);
   eo.setDisable(disable);
   eo.setName(name);
   return eo;
 }
 /**
  * A static factory method for creating a new UserMessageSubscription object given required
  * attributes and relationships.
  *
  * @param editingContext The context in which the new object will be inserted
  * @param isEnabledValue
  * @return The newly created object
  */
 public static UserMessageSubscription create(
     EOEditingContext editingContext, boolean isEnabledValue) {
   UserMessageSubscription eoObject =
       (UserMessageSubscription)
           EOUtilities.createAndInsertInstance(
               editingContext, _UserMessageSubscription.ENTITY_NAME);
   eoObject.setIsEnabled(isEnabledValue);
   return eoObject;
 }
Esempio n. 9
0
 public static MovieRole createMovieRole(
     EOEditingContext editingContext,
     webobjectsexamples.businesslogic.movies.common.Movie movie,
     webobjectsexamples.businesslogic.movies.common.Talent talent) {
   MovieRole eo =
       (MovieRole) EOUtilities.createAndInsertInstance(editingContext, _MovieRole.ENTITY_NAME);
   eo.setMovieRelationship(movie);
   eo.setTalentRelationship(talent);
   return eo;
 }
 public static TimePointApplication createTimePointApplication(
     EOEditingContext editingContext,
     Integer instanceWeight,
     com.dyned.woremotesiteconfig.eom.StoredApp storedApp,
     com.dyned.woremotesiteconfig.eom.TimePoint timePoint) {
   TimePointApplication eo =
       (TimePointApplication)
           EOUtilities.createAndInsertInstance(editingContext, _TimePointApplication.ENTITY_NAME);
   eo.setInstanceWeight(instanceWeight);
   eo.setStoredAppRelationship(storedApp);
   eo.setTimePointRelationship(timePoint);
   return eo;
 }
Esempio n. 11
0
 public static PDBPresentation createPDBPresentation(
     EOEditingContext editingContext,
     String identifier,
     Integer pk,
     org.pachyderm.foundation.eof.PDBScreen primeScreen) {
   PDBPresentation eo =
       (PDBPresentation)
           EOUtilities.createAndInsertInstance(editingContext, _PDBPresentation.ENTITY_NAME);
   eo.setIdentifier(identifier);
   eo.setPk(pk);
   eo.setPrimeScreenRelationship(primeScreen);
   return eo;
 }
Esempio n. 12
0
 public static IndividuUlr createIndividuUlr(
     EOEditingContext editingContext,
     Integer noIndividu,
     String nomUsuel,
     Integer persId,
     String prenom) {
   IndividuUlr eo =
       (IndividuUlr) EOUtilities.createAndInsertInstance(editingContext, _IndividuUlr.ENTITY_NAME);
   eo.setNoIndividu(noIndividu);
   eo.setNomUsuel(nomUsuel);
   eo.setPersId(persId);
   eo.setPrenom(prenom);
   return eo;
 }
Esempio n. 13
0
 public static ResaTypeObjet createResaTypeObjet(
     EOEditingContext editingContext,
     Integer rfoKey,
     Integer rtoKey,
     String rtoLibelle,
     org.cocktail.edtweb.server.metier.ResaFamilleObjet resaFamilleObjet) {
   ResaTypeObjet eo =
       (ResaTypeObjet)
           EOUtilities.createAndInsertInstance(editingContext, _ResaTypeObjet.ENTITY_NAME);
   eo.setRfoKey(rfoKey);
   eo.setRtoKey(rtoKey);
   eo.setRtoLibelle(rtoLibelle);
   eo.setResaFamilleObjetRelationship(resaFamilleObjet);
   return eo;
 }
Esempio n. 14
0
 public static Employee createEmployee(
     EOEditingContext editingContext,
     Boolean admin,
     String firstName,
     NSTimestamp hireDate,
     Boolean insured,
     String lastName,
     er.uber.model.EmployeeStatus status,
     er.uber.model.Company company) {
   Employee eo =
       (Employee) EOUtilities.createAndInsertInstance(editingContext, _Employee.ENTITY_NAME);
   eo.setAdmin(admin);
   eo.setFirstName(firstName);
   eo.setHireDate(hireDate);
   eo.setInsured(insured);
   eo.setLastName(lastName);
   eo.setStatus(status);
   eo.setCompanyRelationship(company);
   return eo;
 }
  public NSArray<AttendeeSelectedVEvent> myEventForAttendeeList() {
    NSArray<VEvent> venueEvents = venue.eventsSorted();
    NSArray<AttendeeSelectedVEvent> attendeeSelectedVEvents =
        attendee.selectedEventsForVenue(venue);

    NSMutableArray<AttendeeSelectedVEvent> results =
        attendeeSelectedVEvents.mutableClone(); // new NSMutableArray<AttendeeSelectedVEvent>();

    int attendeeSelectedVEventsCount = attendeeSelectedVEvents.count();

    for (int venueEventIndex = 0; venueEventIndex < venueEvents.count(); venueEventIndex++) {
      VEvent vEvent = venueEvents.objectAtIndex(venueEventIndex);
      boolean eventFound = false;
      // ------------
      for (int attendeeSelectedVEventIndex = 0;
          attendeeSelectedVEventIndex < attendeeSelectedVEventsCount;
          attendeeSelectedVEventIndex++) {
        VEvent attendeeSelectedVEvent =
            attendeeSelectedVEvents.objectAtIndex(attendeeSelectedVEventIndex).event();
        if (attendeeSelectedVEvent.equals(vEvent)) {
          log.debug("Not adding " + vEvent.lable());
          eventFound = true;
          break;
        }
      }
      // ------------
      if (!eventFound) {
        log.debug("Adding event " + vEvent.lable());
        AttendeeSelectedVEvent newAttendeeSelectedVEvents =
            (AttendeeSelectedVEvent)
                (EOUtilities.createAndInsertInstance(ec, AttendeeSelectedVEvent.ENTITY_NAME));
        newAttendeeSelectedVEvents.setParticipants(0);
        newAttendeeSelectedVEvents.setEventRelationship(vEvent);
        newAttendeeSelectedVEvents.setVenueRelationship(venue);
        attendee.addToSelectedEventsRelationship(newAttendeeSelectedVEvents);
        results.addObject(newAttendeeSelectedVEvents);
      }
    }
    return results; // attendee.selectedEventsForVenue(venue);
  }
Esempio n. 16
0
 public static EOTypeUniteTemps createTypeUniteTemps(EOEditingContext editingContext) {
   EOTypeUniteTemps eo =
       (EOTypeUniteTemps)
           EOUtilities.createAndInsertInstance(editingContext, _EOTypeUniteTemps.ENTITY_NAME);
   return eo;
 }
Esempio n. 17
0
 public static Group createGroup(EOEditingContext editingContext) {
   Group eo = (Group) EOUtilities.createAndInsertInstance(editingContext, _Group.ENTITY_NAME);
   return eo;
 }
 public static ERRole createERRole(EOEditingContext editingContext, String name) {
   ERRole eo = (ERRole) EOUtilities.createAndInsertInstance(editingContext, _ERRole.ENTITY_NAME);
   eo.setName(name);
   return eo;
 }