Example #1
0
 /** Add rules for digesting tool elements. */
 protected void addToolRules(Digester digester) {
   digester.addObjectCreate("toolbox/tool", getToolInfoClass());
   digester.addBeanPropertySetter("toolbox/tool/key", "key");
   digester.addBeanPropertySetter("toolbox/tool/class", "classname");
   digester.addRule("toolbox/tool/parameter", new ParameterRule());
   digester.addSetNext("toolbox/tool", "addTool");
 }
 public void addRuleInstances(Digester digester) {
   digester.addObjectCreate(prefix, CalendarBundle.class);
   digester.addSetProperties(prefix, TAG_CLASS_NAME, "className");
   digester.addBeanPropertySetter(prefix + "/" + TAG_NAME, "calendarName");
   digester.addBeanPropertySetter(prefix + "/" + TAG_DESCRIPTION, "description");
   digester.addSetNext(prefix, setNextMethodName);
 }
Example #3
0
 /** Add rules for digesting data elements. */
 protected void addDataRules(Digester digester) {
   digester.addObjectCreate("toolbox/data", getDataInfoClass());
   digester.addSetProperties("toolbox/data");
   digester.addBeanPropertySetter("toolbox/data/key", "key");
   digester.addBeanPropertySetter("toolbox/data/value", "value");
   digester.addSetNext("toolbox/data", "addData");
 }
Example #4
0
 public void addRuleInstances(Digester digester) {
   digester.addObjectCreate("*/Ciudad", Ciudad.class);
   digester.addBeanPropertySetter("*/Ciudad/Id", "id");
   digester.addBeanPropertySetter("*/Ciudad/Codigo", "codigo");
   digester.addBeanPropertySetter("*/Ciudad/Nombre", "nombre");
   digester.addBeanPropertySetter("*/Ciudad/IdProvincia", "idProvincia");
 }
Example #5
0
 @Override
 protected Digester getDigester() {
   Digester digester = super.getDigester();
   digester.addBeanPropertySetter("eveapi/result/serverOpen");
   digester.addBeanPropertySetter("eveapi/result/onlinePlayers");
   return digester;
 }
Example #6
0
  protected Digester createSoftwareVenderDigester() {
    // Initialize the digester
    Digester digester = new Digester();
    digester.setValidating(false);

    digester.addObjectCreate("*/SoftwareVendor", SoftwareVenderItem.class);
    digester.addBeanPropertySetter("*/SoftwareVendor/Name", "name");
    digester.addBeanPropertySetter("*/SoftwareVendor/Description", "description");
    digester.addSetNext("*/SoftwareVendor", "add");
    return digester;
  }
Example #7
0
 protected Digester createSoftwareCategoryDigester() {
   Digester digester = new Digester();
   digester.addObjectCreate("*/SoftwareCategory", SoftwareCategoryItem.class);
   digester.addBeanPropertySetter("*/SoftwareCategory/Name", "name");
   digester.addBeanPropertySetter("*/SoftwareCategory/Description", "description");
   digester.addSetNext("*/SoftwareCategory", "add");
   digester.addObjectCreate("*/SoftwareCategory/SoftwareCategory", SoftwareCategoryItem.class);
   digester.addBeanPropertySetter("*/SoftwareCategory/SoftwareCategory/Name", "name");
   digester.addBeanPropertySetter(
       "*/SoftwareCategory/SoftwareCategory/Description", "description");
   digester.addSetNext("*/SoftwareCategory/SoftwareCategory", "addSoftwareCategory");
   return digester;
 }
Example #8
0
 protected Digester getDigester() {
   Digester digester = new Digester();
   ConvertUtils.register(DateUtils.getGMTConverter(), Date.class);
   ConvertUtils.register(new EveRaceConverter(), EveRace.class);
   ConvertUtils.register(new EveBloodlineConverter(), EveBloodline.class);
   ConvertUtils.register(new EveAncestryConverter(), EveAncestry.class);
   digester.setValidating(false);
   digester.addObjectCreate("eveapi", clazz);
   digester.addSetProperties("eveapi");
   digester.addObjectCreate("eveapi/error", ApiError.class);
   digester.addSetProperties("eveapi/error");
   digester.addBeanPropertySetter("eveapi/error");
   digester.addSetNext("eveapi/error", "setError");
   digester.addBeanPropertySetter("eveapi/currentTime");
   digester.addBeanPropertySetter("eveapi/cachedUntil");
   return digester;
 }
 public void addRuleInstances(Digester digester) {
   digester.addObjectCreate(prefix, clazz);
   digester.addBeanPropertySetter(prefix + "/" + TAG_NAME, "name");
   digester.addBeanPropertySetter(prefix + "/" + TAG_GROUP, "group");
   digester.addBeanPropertySetter(prefix + "/" + TAG_DESCRIPTION, "description");
   digester.addBeanPropertySetter(prefix + "/" + TAG_VOLATILITY, "volatility");
   digester.addRule(
       prefix + "/" + TAG_MISFIRE_INSTRUCTION, new MisfireInstructionRule("misfireInstruction"));
   digester.addBeanPropertySetter(prefix + "/" + TAG_CALENDAR_NAME, "calendarName");
   digester.addObjectCreate(prefix + "/" + TAG_JOB_DATA_MAP, JobDataMap.class);
   digester.addCallMethod(
       prefix + "/" + TAG_JOB_DATA_MAP + "/" + TAG_ENTRY,
       "put",
       2,
       new Class[] {Object.class, Object.class});
   digester.addCallParam(prefix + "/" + TAG_JOB_DATA_MAP + "/" + TAG_ENTRY + "/" + TAG_KEY, 0);
   digester.addCallParam(prefix + "/" + TAG_JOB_DATA_MAP + "/" + TAG_ENTRY + "/" + TAG_VALUE, 1);
   digester.addSetNext(prefix + "/" + TAG_JOB_DATA_MAP, "setJobDataMap");
   digester.addBeanPropertySetter(prefix + "/" + TAG_JOB_NAME, "jobName");
   digester.addBeanPropertySetter(prefix + "/" + TAG_JOB_GROUP, "jobGroup");
   Converter converter = new DateConverter(new String[] {XSD_DATE_FORMAT, DTD_DATE_FORMAT});
   digester.addRule(
       prefix + "/" + TAG_START_TIME,
       new SimpleConverterRule("startTime", converter, Date.class));
   digester.addRule(
       prefix + "/" + TAG_END_TIME, new SimpleConverterRule("endTime", converter, Date.class));
 }
 /** Add the default set of digest rules */
 protected void addDefaultDigesterRules(Digester digester) {
   digester.addSetProperties(TAG_QUARTZ, TAG_OVERWRITE_EXISTING_JOBS, "overWriteExistingJobs");
   digester.addObjectCreate(TAG_QUARTZ + "/" + TAG_JOB_LISTENER, "jobListener", "class-name");
   digester.addCallMethod(TAG_QUARTZ + "/" + TAG_JOB_LISTENER, "setName", 1);
   digester.addCallParam(TAG_QUARTZ + "/" + TAG_JOB_LISTENER, 0, "name");
   digester.addSetNext(TAG_QUARTZ + "/" + TAG_JOB_LISTENER, "addListenerToSchedule");
   digester.addRuleSet(
       new CalendarRuleSet(TAG_QUARTZ + "/" + TAG_CALENDAR, "addCalendarToSchedule"));
   digester.addRuleSet(new CalendarRuleSet("*/" + TAG_BASE_CALENDAR, "setBaseCalendar"));
   digester.addObjectCreate(TAG_QUARTZ + "/" + TAG_JOB, JobSchedulingBundle.class);
   digester.addObjectCreate(TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_JOB_DETAIL, JobDetail.class);
   digester.addBeanPropertySetter(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_JOB_DETAIL + "/" + TAG_NAME, "name");
   digester.addBeanPropertySetter(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_JOB_DETAIL + "/" + TAG_GROUP, "group");
   digester.addBeanPropertySetter(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_JOB_DETAIL + "/" + TAG_DESCRIPTION, "description");
   digester.addBeanPropertySetter(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_JOB_DETAIL + "/" + TAG_JOB_CLASS, "jobClass");
   digester.addCallMethod(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_JOB_DETAIL + "/" + TAG_JOB_LISTENER_REF,
       "addJobListener",
       0);
   digester.addBeanPropertySetter(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_JOB_DETAIL + "/" + TAG_VOLATILITY, "volatility");
   digester.addBeanPropertySetter(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_JOB_DETAIL + "/" + TAG_DURABILITY, "durability");
   digester.addBeanPropertySetter(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_JOB_DETAIL + "/" + TAG_RECOVER, "requestsRecovery");
   digester.addObjectCreate(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_JOB_DETAIL + "/" + TAG_JOB_DATA_MAP,
       JobDataMap.class);
   digester.addCallMethod(
       TAG_QUARTZ
           + "/"
           + TAG_JOB
           + "/"
           + TAG_JOB_DETAIL
           + "/"
           + TAG_JOB_DATA_MAP
           + "/"
           + TAG_ENTRY,
       "put",
       2,
       new Class[] {Object.class, Object.class});
   digester.addCallParam(
       TAG_QUARTZ
           + "/"
           + TAG_JOB
           + "/"
           + TAG_JOB_DETAIL
           + "/"
           + TAG_JOB_DATA_MAP
           + "/"
           + TAG_ENTRY
           + "/"
           + TAG_KEY,
       0);
   digester.addCallParam(
       TAG_QUARTZ
           + "/"
           + TAG_JOB
           + "/"
           + TAG_JOB_DETAIL
           + "/"
           + TAG_JOB_DATA_MAP
           + "/"
           + TAG_ENTRY
           + "/"
           + TAG_VALUE,
       1);
   digester.addSetNext(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_JOB_DETAIL + "/" + TAG_JOB_DATA_MAP,
       "setJobDataMap");
   digester.addSetNext(TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_JOB_DETAIL, "setJobDetail");
   digester.addRuleSet(
       new TriggerRuleSet(
           TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_TRIGGER + "/" + TAG_SIMPLE,
           SimpleTrigger.class));
   digester.addBeanPropertySetter(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_TRIGGER + "/" + TAG_SIMPLE + "/" + TAG_REPEAT_COUNT,
       "repeatCount");
   digester.addBeanPropertySetter(
       TAG_QUARTZ
           + "/"
           + TAG_JOB
           + "/"
           + TAG_TRIGGER
           + "/"
           + TAG_SIMPLE
           + "/"
           + TAG_REPEAT_INTERVAL,
       "repeatInterval");
   digester.addSetNext(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_TRIGGER + "/" + TAG_SIMPLE, "addTrigger");
   digester.addRuleSet(
       new TriggerRuleSet(
           TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_TRIGGER + "/" + TAG_CRON, CronTrigger.class));
   digester.addBeanPropertySetter(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_TRIGGER + "/" + TAG_CRON + "/" + TAG_CRON_EXPRESSION,
       "cronExpression");
   digester.addRule(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_TRIGGER + "/" + TAG_CRON + "/" + TAG_TIME_ZONE,
       new SimpleConverterRule("timeZone", new TimeZoneConverter(), TimeZone.class));
   digester.addSetNext(
       TAG_QUARTZ + "/" + TAG_JOB + "/" + TAG_TRIGGER + "/" + TAG_CRON, "addTrigger");
   digester.addSetNext(TAG_QUARTZ + "/" + TAG_JOB, "addJobToSchedule");
 }
  public TVShow getShowInfo(String name) {
    log.info("getting show info for {}", name);

    ConvertUtils.register(getDateConverter(), Date.class);
    try {
      int showid = getShowId(name);
      if (showid == -1) {
        return null;
      } // no show by that name
      Response response =
          client.get("http://www.tvrage.com/feeds/full_show_info.php?sid=" + showid);

      log.debug("Found TV Show named {} at http://www.tvrage.com/feeds/full_show_info.php", name);

      Digester digest = new Digester();
      digest.addObjectCreate("Show", TVShow.class);
      digest.addBeanPropertySetter("Show/name");
      digest.addBeanPropertySetter("Show/showid", "id");
      digest.addBeanPropertySetter("Show/started", "startedDate");
      digest.addBeanPropertySetter("Show/origin_country", "country");
      digest.addBeanPropertySetter("Show/status");
      digest.addBeanPropertySetter("Show/runtime");
      digest.addObjectCreate("Show/Episodelist/Season", Season.class);
      digest.addSetProperties("Show/Episodelist/Season", "no", "number");
      digest.addSetNext("Show/Episodelist/Season", "addSeason");
      digest.addObjectCreate("Show/Episodelist/Season/episode", Episode.class);
      digest.addSetNext("Show/Episodelist/Season/episode", "addEpisode");
      digest.addBeanPropertySetter("Show/Episodelist/Season/episode/seasonnum", "episodeNum");
      digest.addBeanPropertySetter("Show/Episodelist/Season/episode/epnum", "absoluteEpisodeNum");
      digest.addBeanPropertySetter("Show/Episodelist/Season/episode/prodnum", "productionNum");
      digest.addBeanPropertySetter("Show/Episodelist/Season/episode/airdate", "airDate");
      digest.addBeanPropertySetter("Show/Episodelist/Season/episode/link", "detailsLink");
      digest.addBeanPropertySetter("Show/Episodelist/Season/episode/title");
      return (TVShow) digest.parse(response.getBody());
    } catch (Exception e) {
      log.error("error fetching TV show data for show " + name, e);
      return null;
    }
  }
  static {
    MockeyXmlFileConfigurationParser.fullSetDigester = new Digester();

    fullSetDigester.setValidating(false);
    fullSetDigester.addObjectCreate(ROOT, InMemoryMockeyStorage.class);

    fullSetDigester.addSetProperties(ROOT, "universal_error_service_id", "universalErrorServiceId");
    fullSetDigester.addSetProperties(
        ROOT, "universal_error_scenario_id", "universalErrorScenarioId");
    fullSetDigester.addSetProperties(ROOT, "universal_twist_info_id", "universalTwistInfoId");

    fullSetDigester.addObjectCreate(ROOT_PROXYSERVER, ProxyServerModel.class);
    fullSetDigester.addSetProperties(ROOT_PROXYSERVER, "proxy_url", "proxyUrl");
    fullSetDigester.addSetProperties(ROOT_PROXYSERVER, "proxy_enabled", "proxyEnabled");
    fullSetDigester.addSetNext(ROOT_PROXYSERVER, "setProxy");

    fullSetDigester.addObjectCreate(ROOT_SERVICEREF, ServiceRef.class);
    fullSetDigester.addSetProperties(ROOT_SERVICEREF, "file", "fileName");
    fullSetDigester.addSetNext(ROOT_SERVICEREF, "saveOrUpdateServiceRef");

    fullSetDigester.addObjectCreate(ROOT_SERVICE, Service.class);
    fullSetDigester.addSetNext(ROOT_SERVICE, "saveOrUpdateService");

    fullSetDigester.addSetProperties(ROOT_SERVICE, "name", "serviceName");
    fullSetDigester.addSetProperties(ROOT_SERVICE, "description", "description");
    fullSetDigester.addSetProperties(ROOT_SERVICE, "http_content_type", "httpContentType");
    fullSetDigester.addSetProperties(ROOT_SERVICE, "hang_time", "hangTime");
    fullSetDigester.addSetProperties(ROOT_SERVICE, "url", "url");
    fullSetDigester.addSetProperties(ROOT_SERVICE, "tag", "tag");
    fullSetDigester.addSetProperties(ROOT_SERVICE, "last_visit", "lastVisit");

    fullSetDigester.addSetProperties(ROOT_SERVICE, "proxyurl", "realServiceUrlByString");
    fullSetDigester.addSetProperties(ROOT_SERVICE, "default_real_url_index", "defaultRealUrlIndex");

    fullSetDigester.addSetProperties(ROOT_SERVICE, "service_response_type", "serviceResponseType");
    fullSetDigester.addSetProperties(ROOT_SERVICE, "default_scenario_id", "defaultScenarioId");

    fullSetDigester.addObjectCreate(ROOT_SERVICE_REAL_URL, Url.class);
    fullSetDigester.addSetProperties(ROOT_SERVICE_REAL_URL, "url", "url");
    fullSetDigester.addSetNext(ROOT_SERVICE_REAL_URL, "saveOrUpdateRealServiceUrl");

    fullSetDigester.addObjectCreate(ROOT_SERVICE_SCENARIO, Scenario.class);
    fullSetDigester.addSetProperties(ROOT_SERVICE_SCENARIO, "id", "id");
    fullSetDigester.addSetProperties(ROOT_SERVICE_SCENARIO, "name", "scenarioName");
    fullSetDigester.addSetProperties(ROOT_SERVICE_SCENARIO, "last_visit", "lastVisit");
    fullSetDigester.addSetProperties(ROOT_SERVICE_SCENARIO, "tag", "tag");
    fullSetDigester.addBeanPropertySetter(SCENARIO_MATCH, "matchStringArg");
    fullSetDigester.addBeanPropertySetter(SCENARIO_REQUEST, "requestMessage");
    fullSetDigester.addBeanPropertySetter(SCENARIO_RESPONSE, "responseMessage");

    fullSetDigester.addSetNext(ROOT_SERVICE_SCENARIO, "saveOrUpdateScenario");

    // PLAN
    fullSetDigester.addObjectCreate(ROOT_PLAN, ServicePlan.class);
    fullSetDigester.addSetProperties(ROOT_PLAN, "name", "name"); //
    fullSetDigester.addSetProperties(ROOT_PLAN, "description", "description"); //
    fullSetDigester.addSetProperties(ROOT_PLAN, "id", "id");
    fullSetDigester.addSetProperties(ROOT_PLAN, "tag", "tag");
    fullSetDigester.addSetProperties(ROOT_PLAN, "last_visit", "lastVisit");
    fullSetDigester.addSetNext(ROOT_PLAN, "saveOrUpdateServicePlan");
    fullSetDigester.addObjectCreate(ROOT_PLAN_ITEM, PlanItem.class);
    fullSetDigester.addSetProperties(ROOT_PLAN_ITEM, "hang_time", "hangTime");
    fullSetDigester.addSetProperties(ROOT_PLAN_ITEM, "service_id", "serviceId");
    fullSetDigester.addSetProperties(ROOT_PLAN_ITEM, "scenario_id", "scenarioId");
    fullSetDigester.addSetProperties(
        ROOT_PLAN_ITEM, "service_response_type", "serviceResponseType");
    fullSetDigester.addSetNext(ROOT_PLAN_ITEM, "addPlanItem");

    // TWIST CONFIGURATION
    fullSetDigester.addObjectCreate(ROOT_TWIST_CONFIG, TwistInfo.class);
    fullSetDigester.addSetProperties(ROOT_TWIST_CONFIG, "name", "name"); //
    fullSetDigester.addSetProperties(ROOT_TWIST_CONFIG, "id", "id");
    fullSetDigester.addSetNext(ROOT_TWIST_CONFIG, "saveOrUpdateTwistInfo");
    fullSetDigester.addObjectCreate(ROOT_TWIST_CONFIG_ITEM, PatternPair.class);
    fullSetDigester.addSetProperties(ROOT_TWIST_CONFIG_ITEM, "origination", "origination");
    fullSetDigester.addSetProperties(ROOT_TWIST_CONFIG_ITEM, "destination", "destination");
    fullSetDigester.addSetNext(ROOT_TWIST_CONFIG_ITEM, "addPatternPair");
  }
Example #13
0
  @Override
  protected Digester getDigester() {
    Digester digester = super.getDigester();
    digester.addBeanPropertySetter("eveapi/result/characterID");
    digester.addBeanPropertySetter("eveapi/result/name");
    digester.addBeanPropertySetter("eveapi/result/race");
    digester.addBeanPropertySetter("eveapi/result/bloodLine");
    digester.addBeanPropertySetter("eveapi/result/gender");
    digester.addBeanPropertySetter("eveapi/result/corporationName");
    digester.addBeanPropertySetter("eveapi/result/corporationID");
    digester.addBeanPropertySetter("eveapi/result/balance");
    digester.addObjectCreate(
        "eveapi/result/attributeEnhancers/intelligenceBonus", IntelligenceBonus.class);
    digester.addBeanPropertySetter(
        "eveapi/result/attributeEnhancers/intelligenceBonus/augmentatorName");
    digester.addBeanPropertySetter(
        "eveapi/result/attributeEnhancers/intelligenceBonus/augmentatorValue");
    digester.addSetNext(
        "eveapi/result/attributeEnhancers/intelligenceBonus", "addAttributeEnhancer");

    digester.addObjectCreate("eveapi/result/attributeEnhancers/memoryBonus", MemoryBonus.class);
    digester.addBeanPropertySetter("eveapi/result/attributeEnhancers/memoryBonus/augmentatorName");
    digester.addBeanPropertySetter("eveapi/result/attributeEnhancers/memoryBonus/augmentatorValue");
    digester.addSetNext("eveapi/result/attributeEnhancers/memoryBonus", "addAttributeEnhancer");

    digester.addObjectCreate("eveapi/result/attributeEnhancers/charismaBonus", CharismaBonus.class);
    digester.addBeanPropertySetter(
        "eveapi/result/attributeEnhancers/charismaBonus/augmentatorName");
    digester.addBeanPropertySetter(
        "eveapi/result/attributeEnhancers/charismaBonus/augmentatorValue");
    digester.addSetNext("eveapi/result/attributeEnhancers/charismaBonus", "addAttributeEnhancer");

    digester.addObjectCreate(
        "eveapi/result/attributeEnhancers/perceptionBonus", PerceptionBonus.class);
    digester.addBeanPropertySetter(
        "eveapi/result/attributeEnhancers/perceptionBonus/augmentatorName");
    digester.addBeanPropertySetter(
        "eveapi/result/attributeEnhancers/perceptionBonus/augmentatorValue");
    digester.addSetNext("eveapi/result/attributeEnhancers/perceptionBonus", "addAttributeEnhancer");

    digester.addObjectCreate(
        "eveapi/result/attributeEnhancers/willpowerBonus", WillpowerBonus.class);
    digester.addBeanPropertySetter(
        "eveapi/result/attributeEnhancers/willpowerBonus/augmentatorName");
    digester.addBeanPropertySetter(
        "eveapi/result/attributeEnhancers/willpowerBonus/augmentatorValue");
    digester.addSetNext("eveapi/result/attributeEnhancers/willpowerBonus", "addAttributeEnhancer");

    digester.addBeanPropertySetter("eveapi/result/attributes/intelligence");
    digester.addBeanPropertySetter("eveapi/result/attributes/memory");
    digester.addBeanPropertySetter("eveapi/result/attributes/charisma");
    digester.addBeanPropertySetter("eveapi/result/attributes/perception");
    digester.addBeanPropertySetter("eveapi/result/attributes/willpower");

    digester.addObjectCreate("eveapi/result/rowset/row", ApiSkill.class);
    digester.addSetProperties("eveapi/result/rowset/row");
    digester.addSetNext("eveapi/result/rowset/row", "addSkill");
    return digester;
  }
Example #14
0
  /**
   * Create Digester rules for manufacturers and models
   *
   * @return
   */
  protected Digester createManufacturerDigester() {
    // Initialize the digester
    Digester digester = new Digester();
    digester.setValidating(false);
    // Manufacturer stage
    digester.addObjectCreate("*/Manufacturer", ManufacturerItem.class);
    digester.addBeanPropertySetter("*/Manufacturer/ExternalID", "externalID");
    digester.addBeanPropertySetter("*/Manufacturer/Name", "name");
    digester.addBeanPropertySetter("*/Manufacturer/Description", "description");
    digester.addSetNext("*/Manufacturer", "add");

    digester.addCallMethod("*/Models", "addIncludeFile4Model", 1);
    digester.addCallParam("*/Models", 0, "filename");

    // Model stage
    digester.addFactoryCreate("*/Models/Model", ModelItemObjectCreationFactory.class);
    // digester.addObjectCreate("*/Models/Model", ModelItem.class);
    digester.addSetNext("*/Models/Model", "addModel");

    // Basic information
    // digester.addCallMethod("*/Models/Model", "setFamilyID", 1);
    // digester.addCallParam("*/Models/Model", 0, "family");
    digester.addBeanPropertySetter("*/Models/Model/ExternalID", "externalID");
    digester.addBeanPropertySetter("*/Models/Model/Name", "name");
    digester.addBeanPropertySetter("*/Models/Model/Description", "description");
    // digester.addBeanPropertySetter("*/Models/Model/FamilyID", "familyID");
    digester.addBeanPropertySetter("*/Models/Model/IconFile", "iconFile");
    digester.addBeanPropertySetter("*/Models/Model/IsOmaDmEnabled", "isOmaDmEnabled");
    digester.addBeanPropertySetter("*/Models/Model/OmaDmVersion", "omaDmVersion");
    digester.addBeanPropertySetter("*/Models/Model/IsOmaCpEnabled", "isOmaCpEnabled");
    digester.addBeanPropertySetter("*/Models/Model/OmaCpVersion", "omaCpVersion");
    digester.addBeanPropertySetter("*/Models/Model/IsNokiaOtaEnabled", "isNokiaOtaEnabled");
    digester.addBeanPropertySetter("*/Models/Model/NokiaOtaVersion", "nokiaOtaVersion");
    digester.addBeanPropertySetter(
        "*/Models/Model/SupportedDownloadMethods", "supportedDownloadMethods");
    digester.addBeanPropertySetter("*/Models/Model/FirmwareVersionNode", "firmwareVersionNode");
    digester.addBeanPropertySetter("*/Models/Model/FirmwareUpdateNode", "firmwareUpdateNode");
    digester.addBeanPropertySetter("*/Models/Model/FirmwareDownloadNode", "firmwareDownloadNode");
    digester.addBeanPropertySetter(
        "*/Models/Model/FirmwareDownloadAndUpdateNode", "firmwareDownloadAndUpdateNode");
    digester.addBeanPropertySetter("*/Models/Model/FirmwareStatusNode", "firmwareStatusNode");
    // DDF Information
    digester.addCallMethod("*/Models/Model/DDFs/DDF", "addDdfFile", 1);
    digester.addCallParam("*/Models/Model/DDFs/DDF", 0, "filename");
    // DM Profile Mappings
    digester.addCallMethod(
        "*/Models/Model/ProfileMappings/ProfileMapping", "addProfileMappingFile", 1);
    digester.addCallParam("*/Models/Model/ProfileMappings/ProfileMapping", 0, "filename");
    // CP Templates
    digester.addCallMethod("*/Models/Model/CPTemplates", "addCpTemplatesFiles", 1);
    digester.addCallParam("*/Models/Model/CPTemplates", 0, "filename");
    // TAC Informations
    digester.addCallMethod("*/Models/Model/TACs/TAC", "addTac", 1);
    digester.addCallParam("*/Models/Model/TACs/TAC", 0);
    // Firmwares
    digester.addObjectCreate("*/Models/Model/Firmwares/Firmware", FirmwareItem.class);
    digester.addBeanPropertySetter("*/Models/Model/Firmwares/Firmware/FromVersion", "fromVersion");
    digester.addBeanPropertySetter("*/Models/Model/Firmwares/Firmware/ToVersion", "toVersion");
    digester.addBeanPropertySetter("*/Models/Model/Firmwares/Firmware/Status", "status");
    digester.addBeanPropertySetter("*/Models/Model/Firmwares/Firmware/Filename", "filename");
    digester.addSetNext("*/Models/Model/Firmwares/Firmware", "addFirmware");
    // Specifications
    digester.addCallMethod("*/Models/Model/Specifications/Specification", "setSpecification", 3);
    digester.addCallParam("*/Models/Model/Specifications/Specification", 0, "category");
    digester.addCallParam("*/Models/Model/Specifications/Specification", 1, "name");
    digester.addCallParam("*/Models/Model/Specifications/Specification", 2, "value");

    // Model Family stage
    digester.addFactoryCreate("*/Models/Family", ModelFamilyItemObjectCreationFactory.class);
    // digester.addObjectCreate("*/Models/Family", ModelFamilyItem.class);
    digester.addSetNext("*/Models/Family", "addModelFamily");
    // Basic information
    // digester.addCallMethod("*/Models/Family", "setParentID", 1);
    // digester.addCallParam("*/Models/Family", 0, "parent");
    // digester.addSetNestedProperties("*/Models/Family", "parent", "parentID");
    digester.addBeanPropertySetter("*/Models/Family/ExternalID", "externalID");
    digester.addBeanPropertySetter("*/Models/Family/Name", "name");
    digester.addBeanPropertySetter("*/Models/Family/Description", "description");
    // digester.addBeanPropertySetter("*/Models/Family/ParentID", "parentID");
    digester.addBeanPropertySetter("*/Models/Family/IconFile", "iconFile");
    digester.addBeanPropertySetter("*/Models/Family/IsOmaDmEnabled", "isOmaDmEnabled");
    digester.addBeanPropertySetter("*/Models/Family/OmaDmVersion", "omaDmVersion");
    digester.addBeanPropertySetter("*/Models/Family/IsOmaCpEnabled", "isOmaCpEnabled");
    digester.addBeanPropertySetter("*/Models/Family/OmaCpVersion", "omaCpVersion");
    digester.addBeanPropertySetter("*/Models/Family/IsNokiaOtaEnabled", "isNokiaOtaEnabled");
    digester.addBeanPropertySetter("*/Models/Family/NokiaOtaVersion", "nokiaOtaVersion");
    digester.addBeanPropertySetter(
        "*/Models/Family/SupportedDownloadMethods", "supportedDownloadMethods");
    digester.addBeanPropertySetter("*/Models/Family/FirmwareVersionNode", "firmwareVersionNode");
    digester.addBeanPropertySetter("*/Models/Family/FirmwareUpdateNode", "firmwareUpdateNode");
    digester.addBeanPropertySetter("*/Models/Family/FirmwareDownloadNode", "firmwareDownloadNode");
    digester.addBeanPropertySetter(
        "*/Models/Family/FirmwareDownloadAndUpdateNode", "firmwareDownloadAndUpdateNode");
    digester.addBeanPropertySetter("*/Models/Family/FirmwareStatusNode", "firmwareStatusNode");
    // DDF Information
    digester.addCallMethod("*/Models/Family/DDFs/DDF", "addDdfFile", 1);
    digester.addCallParam("*/Models/Family/DDFs/DDF", 0, "filename");
    // DM Profile Mappings
    digester.addCallMethod(
        "*/Models/Family/ProfileMappings/ProfileMapping", "addProfileMappingFile", 1);
    digester.addCallParam("*/Models/Family/ProfileMappings/ProfileMapping", 0, "filename");
    // CP Templates
    digester.addCallMethod("*/Models/Family/CPTemplates", "addCpTemplatesFiles", 1);
    digester.addCallParam("*/Models/Family/CPTemplates", 0, "filename");
    // Firmwares
    digester.addObjectCreate("*/Models/Family/Firmwares/Firmware", FirmwareItem.class);
    digester.addBeanPropertySetter("*/Models/Family/Firmwares/Firmware/FromVersion", "fromVersion");
    digester.addBeanPropertySetter("*/Models/Family/Firmwares/Firmware/ToVersion", "toVersion");
    digester.addBeanPropertySetter("*/Models/Family/Firmwares/Firmware/Status", "status");
    digester.addBeanPropertySetter("*/Models/Family/Firmwares/Firmware/Filename", "filename");
    digester.addSetNext("*/Models/Family/Firmwares/Firmware", "addFirmware");
    // Specifications
    digester.addCallMethod("*/Models/Family/Specifications/Specification", "setSpecification", 3);
    digester.addCallParam("*/Models/Family/Specifications/Specification", 0, "category");
    digester.addCallParam("*/Models/Family/Specifications/Specification", 1, "name");
    digester.addCallParam("*/Models/Family/Specifications/Specification", 2, "value");

    return (digester);
  }
Example #15
0
  protected Digester createSoftwareDigester() {
    Digester digester = new Digester();
    digester.setValidating(false);
    digester.addObjectCreate("*/Software", SoftwareItem.class);
    digester.addBeanPropertySetter("*/Software/ExternalId", "externalId");
    digester.addBeanPropertySetter("*/Software/Vendor", "vendor");
    digester.addBeanPropertySetter("*/Software/Category", "category");
    digester.addBeanPropertySetter("*/Software/Name", "name");
    digester.addBeanPropertySetter("*/Software/Version", "version");
    digester.addBeanPropertySetter("*/Software/Status", "status");
    digester.addBeanPropertySetter("*/Software/LicenseType", "licenseType");
    digester.addBeanPropertySetter("*/Software/Description", "description");
    digester.addObjectCreate("*/Software/Packages/Package", SoftwarePackageItem.class);
    digester.addBeanPropertySetter("*/Software/Packages/Package/Name", "name");

    digester.addObjectCreate(
        "*/Software/Packages/Package/Remote", SoftwarePackage4RemoteItem.class);
    digester.addBeanPropertySetter("*/Software/Packages/Package/Remote/Url", "url");
    digester.addSetNext("*/Software/Packages/Package/Remote", "setRemote");

    digester.addObjectCreate("*/Software/Packages/Package/Local", SoftwarePackage4LocalItem.class);
    digester.addBeanPropertySetter("*/Software/Packages/Package/Local/MimeType", "mimeType");
    digester.addBeanPropertySetter("*/Software/Packages/Package/Local/File", "file");
    digester.addSetNext("*/Software/Packages/Package/Local", "setLocal");

    digester.addObjectCreate(
        "*/Software/Packages/Package/InstallOptions/InstOpts",
        SoftwarePackage4InstallOptionsItem.class);
    digester.addObjectCreate(
        "*/Software/Packages/Package/InstallOptions/InstOpts/StdOpt",
        SoftwarePackage4StdOptItem.class);
    digester.addSetProperties("*/Software/Packages/Package/InstallOptions/InstOpts/StdOpt");
    digester.addSetNext("*/Software/Packages/Package/InstallOptions/InstOpts/StdOpt", "addStdOpt");
    digester.addObjectCreate(
        "*/Software/Packages/Package/InstallOptions/InstOpts/StdSymOpt",
        SoftwarePackage4StdSymOptItem.class);
    digester.addSetProperties("*/Software/Packages/Package/InstallOptions/InstOpts/StdSymOpt");
    digester.addSetNext(
        "*/Software/Packages/Package/InstallOptions/InstOpts/StdSymOpt", "addStdSymOpt");
    digester.addSetNext("*/Software/Packages/Package/InstallOptions/InstOpts", "addInstallOptions");

    digester.addObjectCreate(
        "*/Software/Packages/Package/TargetModels/Model", SoftwarePackage4TargetModelsItem.class);
    digester.addBeanPropertySetter(
        "*/Software/Packages/Package/TargetModels/Model/Vendor", "vendor");
    digester.addBeanPropertySetter("*/Software/Packages/Package/TargetModels/Model/Name", "name");
    digester.addSetNext("*/Software/Packages/Package/TargetModels/Model", "addModels");
    digester.addSetNext("*/Software/Packages/Package", "addSoftwarePackage");
    digester.addSetNext("*/Software", "add");

    return digester;
  }