Exemplo n.º 1
0
 public static boolean isTransferedToClient(DynamicType type) {
   String annotation = type.getAnnotation(DynamicTypeAnnotations.KEY_TRANSFERED_TO_CLIENT);
   if (annotation == null) {
     return true;
   }
   return !annotation.equals(DynamicTypeAnnotations.VALUE_TRANSFERED_TO_CLIENT_NEVER);
 }
  @Inject
  public Export2iCalConverter(
      TimeZoneConverter timezoneConverter,
      RaplaLocale raplaLocale,
      Logger logger,
      ClientFacade facade)
      throws RaplaException {
    this.timezoneConverter = timezoneConverter;
    this.facade = facade;
    this.raplaLocale = raplaLocale;
    this.logger = logger;
    TimeZone zone = timezoneConverter.getImportExportTimeZone();

    calendar = raplaLocale.createCalendar();
    DynamicType[] dynamicTypes =
        facade.getDynamicTypes(DynamicTypeAnnotations.VALUE_CLASSIFICATION_TYPE_RESOURCE);
    for (DynamicType type : dynamicTypes) {
      if (type.getAnnotation(DynamicTypeAnnotations.KEY_LOCATION) != null) {
        hasLocationType = true;
      }
    }
    CompatibilityHints.setHintEnabled(CompatibilityHints.KEY_RELAXED_VALIDATION, true);

    RaplaConfiguration config =
        facade
            .getSystemPreferences()
            .getEntry(Export2iCalPlugin.ICAL_CONFIG, new RaplaConfiguration());
    global_export_attendees =
        config
            .getChild(Export2iCalPlugin.EXPORT_ATTENDEES)
            .getValueAsBoolean(Export2iCalPlugin.DEFAULT_exportAttendees);
    global_export_attendees_participation_status =
        config
            .getChild(Export2iCalPlugin.EXPORT_ATTENDEES_PARTICIPATION_STATUS)
            .getValue(Export2iCalPlugin.DEFAULT_attendee_participation_status);

    try {
      exportAttendeesAttribute =
          config.getChild(Export2iCalPlugin.EXPORT_ATTENDEES_EMAIL_ATTRIBUTE).getValue();
    } catch (ConfigurationException e) {
      exportAttendeesAttribute = "";
      getLogger().info("ExportAttendeesMailAttribute is not set. So do not export as meeting");
    }
    if (zone != null) {
      final String timezoneId = zone.getID();

      try {
        TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
        timeZone = registry.getTimeZone(timezoneId);
      } catch (Exception rc) {
        final VTimeZone vTimeZone = new VTimeZone();
        timeZone = new net.fortuna.ical4j.model.TimeZone(vTimeZone);
        final int rawOffset = zone.getRawOffset();
        timeZone.setRawOffset(rawOffset);
      }
    }
  }
Exemplo n.º 3
0
 private boolean isInternalType(Allocatable alloc) {
   DynamicType type = alloc.getClassification().getType();
   String annotation = type.getAnnotation(DynamicTypeAnnotations.KEY_CLASSIFICATION_TYPE);
   return annotation != null
       && annotation.equals(DynamicTypeAnnotations.VALUE_CLASSIFICATION_TYPE_RAPLATYPE);
 }