Package util.paramhandler

Examples of util.paramhandler.ParamParser


  /**
   * Create the Growl-Container
   */
  public GrowlContainer() {
    mParser = new ParamParser();
  }
View Full Code Here


      }

      return;
    }

    ParamParser parser = new ParamParser();

    String title = parser.analyse(formating.getTitleValue(), program);
    String content = parser.analyse(formating.getContentValue(), program);
    String url = program.getChannel().getWebpage();

    try {
      Launch.openURL(urlFactory(title, content, url));
    } catch (Exception e) {
View Full Code Here

      if (dcopLocation != null) {
        dcopLocation = dcopLocation.trim();
        if (dcopLocation.length() > 0) {
          // create the notification message
          if (mParser == null) {
            mParser = new ParamParser();
          }
          final String title = mParser.analyse(titleFormat,program);
          final String message = mParser.analyse(descriptionFormat, program);

          // run the notification command
View Full Code Here

      SimpleDateFormat formatDay = new SimpleDateFormat("yyyy-MM-dd");
      formatDay.setTimeZone(TimeZone.getTimeZone("GMT"));
      SimpleDateFormat formatTime = new SimpleDateFormat("HH:mm:ss");
      formatTime.setTimeZone(TimeZone.getTimeZone("GMT"));

      ParamParser parser = new ParamParser();
      for (Program program : programs) {
        final String title = parser.analyse(formatting.getTitleValue(), program);

        // First step: search for event in calendar
        boolean createEvent = true;

        CalendarEventEntry entry = findEntryForProgram(myService, postUrl, title, program);

        if (entry != null) {
          int ret = JOptionPane.showConfirmDialog(null, mLocalizer.msg("alreadyAvailable", "already available", program.getTitle()), mLocalizer.msg("title", "Add event?"),  JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

          if (ret != JOptionPane.YES_OPTION) {
            createEvent = false;
          }
        }

        // add event to calendar
        if (createEvent) {
          EventEntry myEntry = new EventEntry();

          myEntry.setTitle(new PlainTextConstruct(title));

          String desc = parser.analyse(formatting.getContentValue(), program);
          myEntry.setContent(new PlainTextConstruct(desc));

          Calendar c = CalendarToolbox.getStartAsCalendar(program);

          DateTime startTime = new DateTime(c.getTime(), c.getTimeZone());
View Full Code Here

   *          The formatting value for the program
   */
  public void export(File intothis, final Program[] list,
      final CalendarExportSettings settings, final AbstractPluginProgramFormating formatting) {
    try {
      final ParamParser parser = new ParamParser();

      final boolean nulltime = settings.getNullTime();

      mTime.setTimeZone(TimeZone.getTimeZone("GMT"));
      mDate.setTimeZone(TimeZone.getTimeZone("GMT"));

      final PrintStreamProcessor processor = new PrintStreamProcessor() {
        public void process(PrintStream out) throws IOException {
          out.println("BEGIN:VCALENDAR");
          out.println("PRODID:-//TV-Browser//Calendar Export Plugin");
          printVersion(out);

          for (int i = 0; i < list.length; i++) {
            Program p = list[i];

            out.println();
            out.println("BEGIN:VEVENT");

            Calendar c = Calendar.getInstance();

            printCreated(out, mDate.format(c.getTime()) + "T"
                + mTime.format(c.getTime()), i);

            if (settings.isClassificationPrivate()) {
              out.println("CLASS:PRIVATE");
            }
            else if (settings.isClassificationConfidential()) {
              out.println("CLASS:CONFIDENTIAL");
            }
            else if (settings.isClassificationPublic()) {
              out.println("CLASS:PUBLIC");
            }

            out.println("PRIORITY:3");

            String category = settings.getCategory().trim();
            if (category.length() > 0) {
              out.println("CATEGORIES:" + category);
            }

            c = CalendarToolbox.getStartAsCalendar(p);

            out.println("UID:" + mDate.format(c.getTime()) + "-" + p.getID());

            String summary = parser.analyse(formatting.getTitleValue(), p);

            out.println("SUMMARY:" + CalendarToolbox.noBreaks(summary));

            out.println("DTSTART:" + mDate.format(c.getTime()) + "T"
                + mTime.format(c.getTime()) + "Z");

            String desc = parser.analyse(formatting.getContentValue(), p);
            if (parser.showErrors()) {
              return;
            }
            out.println("DESCRIPTION:" + CalendarToolbox.noBreaks(desc));

            if (!nulltime) {
View Full Code Here

public class ParamParserTest extends TestCase {

  public void testAnalyse() {
    PluginManager manager = PluginManagerImpl.getInstance();
    ParamParser parser = new ParamParser();

    String in = "oblda {clean(\"halloechen du da ?!\")} da \\{ {concat(urlencode(isset(original_title, \"hallo\"), \"utf8\"), \"HHHHH\")} {\"str}i()ng\"}test bla";
   
    System.out.println(in);
    String result = parser.analyse(in, manager.getExampleProgram());
   
    System.out.println(result);
    System.out.println(parser.getErrorString());

    assertEquals("oblda halloechen_du_da_ da { The+WaltonsHHHHH str}i()ngtest bla", result);
  }
View Full Code Here

    if (settings.getNullTime()) {
      nullTime = true;
    }

    for (Program program : programs) {
      ParamParser parser = new ParamParser();
      String title = parser.analyse(formating.getTitleValue(), program);
      String desc = parser.analyse(formating.getContentValue(), program);
      Date start = CalendarToolbox.getStartAsCalendar(program).getTime();
      Date end = CalendarToolbox.getEndAsCalendar(program).getTime();

      if (!writeEvent(title, desc, start, end, alarmBefore, useAlarm, showtime, categories, nullTime, classification)) {
        return false;
View Full Code Here

            script.append("  set startDate to my getDateForISOdate(\"").append(formatDay.format(start.getTime())).append("\", \"").append(formatHour.format(start.getTime())).append("\")\n");
            script.append("  set endDate to my getDateForISOdate(\"").append(formatDay.format(end.getTime())).append("\", \"").append(formatHour.format(end.getTime())).append("\")\n");
            script.append("\n");
            script.append("  set props to {start date:startDate, end date:endDate, summary:\"");

            ParamParser parser = new ParamParser();

            String title = parser.analyse(formatting.getTitleValue(), program);
            script.append(title);

            script.append("\", description:\"");

            String desc = parser.analyse(formatting.getContentValue(), program);
            script.append(desc.replaceAll("\"", "\\\\\"").replace('\n', ' '));

            script.append("\"}\n");
            script.append("  set theEvent to make new event at end of (events of TVBrowserCalendar) with properties props\n");
View Full Code Here

    }
    if ("true".equals(mSettings.getProperty("useexec"))) {
      String fName = mSettings.getProperty("execfile", "").trim();
      if (StringUtils.isNotEmpty(fName)) {
        for (ReminderListItem reminder : reminders) {
          ParamParser parser = new ParamParser();
          String fParam = parser.analyse(
              mSettings.getProperty("execparam", ""), reminder.getProgram());

          try {
            ExecutionHandler executionHandler = new ExecutionHandler(fParam,
                fName);
View Full Code Here

   * @param program Program to search on the Web
   * @param address Search-Engine to use
   */
  protected void openUrl(final Program program, final WebAddress address) {
    try {
      final ParamParser parser = new ParamParser();
      final String result = parser.analyse(address.getUrl(), program);

      if (parser.hasErrors()) {
        final String errorString = parser.getErrorString();
        mLog.warning("URL parse error " + errorString+ " in " + address.getUrl());
        parser.showErrors(UiUtilities.getLastModalChildOf(getParentFrame()));
      } else {
        Launch.openURL(result);
      }

    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of util.paramhandler.ParamParser

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.