Examples of Context


Examples of net.asfun.jangod.base.Context

  protected Application application;
  JangodInterpreter interpreter;
 
  public Processor(Application application) {
    this.application = application;
    context = new Context(application);
    interpreter = new JangodInterpreter(context);
  }
View Full Code Here

Examples of net.cloudcodex.server.Context

    }
   
    @Test
    public void testPostingWithObsoleteTimestamp() throws Exception {
      // try to post after a scene update.
      Context context = new Context(player1);
      final Date oldTimestamp = scene.getTimestamp();
      Thread.currentThread().sleep(1000);
      scene.setIntroduction("Introduction updated");
      dao.save(context, scene);
      boolean result = messageService.playerPostAction(
          context, campaignId, char1Id,
          scene.getKey().getId(), oldTimestamp,
          MessageAction.SPEECH, "a speech");
     
      assertFalse(result);
      assertTrue(context.hasError(Errors.OUTOFDATE));
    }
View Full Code Here

Examples of net.fckeditor.requestcycle.Context

   * @return the get response instance associated with this request
   */
  GetResponse doGet(final HttpServletRequest request) {
    logger.debug("Entering Dispatcher#doGet");
   
    Context context = ThreadLocalData.getContext();
    context.logBaseParameters();
   
    GetResponse getResponse = null;
    // check parameters
    if (!Command.isValidForGet(context.getCommandStr()))
      getResponse = GetResponse.getInvalidCommandError();
    else if (!ResourceType.isValidType(context.getTypeStr()))
      getResponse = GetResponse.getInvalidResourceTypeError();
    else if (!UtilsFile.isValidPath(context.getCurrentFolderStr()))
      getResponse = GetResponse.getInvalidCurrentFolderError();
    else {
     
      // in contrast to doPost the referrer has to send an explicit type
      ResourceType type = context.getResourceType();
      Command command = context.getCommand();
     
      // check permissions for user action
      if ((command.equals(Command.GET_FOLDERS) || command.equals(Command.GET_FOLDERS_AND_FILES))
          && !RequestCycleHandler.isGetResourcesEnabled(request))
        getResponse = GetResponse.getGetResourcesDisabledError();
      else if (command.equals(Command.CREATE_FOLDER) && !RequestCycleHandler.isCreateFolderEnabled(request))
        getResponse = GetResponse.getCreateFolderDisabledError();
      else {
        // make the connector calls, catch its exceptions and generate
        // the proper response object
        try {
          if (command.equals(Command.CREATE_FOLDER)) {
            String newFolderNameStr = request
                .getParameter("NewFolderName");
            logger.debug("Parameter NewFolderName: {}",
                newFolderNameStr);       
            String sanitizedNewFolderNameStr = UtilsFile
                .sanitizeFolderName(newFolderNameStr);
            if (Utils.isEmpty(sanitizedNewFolderNameStr))
              getResponse = GetResponse
                  .getInvalidNewFolderNameError();
            else {
              logger.debug(
                  "Parameter NewFolderName (sanitized): {}",
                  sanitizedNewFolderNameStr);
              connector.createFolder(type, context
                  .getCurrentFolderStr(),
                  sanitizedNewFolderNameStr);
              getResponse = GetResponse.getOK();
            }
          } else if (command.equals(Command.GET_FOLDERS)
              || command
                  .equals(Command.GET_FOLDERS_AND_FILES)) {
            String url = UtilsResponse.getUrl(RequestCycleHandler
                .getUserFilesPath(request), type, context
                .getCurrentFolderStr());
            getResponse = getFoldersAndOrFiles(command, type, context
                .getCurrentFolderStr(), url);
          }
        } catch (InvalidCurrentFolderException e) {
          getResponse = GetResponse.getInvalidCurrentFolderError();
        } catch (InvalidNewFolderNameException e) {
View Full Code Here

Examples of net.mindengine.galen.suite.reader.Context

        assertThat(realText, is(expectedText));
    }

    @Test
    public void shouldAllowTo_loadCustomJavascript() {
        Context context = new Context();
        VarsParser template = new VarsParser(context, EMPTY_PROPERTIES, new VarsParserJsProcessor(context, jsFunctions));
        String realText = template.parse("${load('/specs/customFunction.js')} got it from js: ${customFunction('qwe', 'ert')}");

        assertThat(realText, is(" got it from js: qwe-ert"));
    }
View Full Code Here

Examples of net.rim.device.api.io.messaging.Context

    if (DeviceInfo.isSimulator()) {
      _factory.setPreferredTransportTypes(new int[] { TransportInfo.TRANSPORT_TCP_WIFI,
          TransportInfo.TRANSPORT_TCP_CELLULAR });
    }

    _context = new Context("YoutubeDispatcher", _factory);

    _processor = new XMLHashtableMessageProcessor(false, false);
  }
View Full Code Here

Examples of net.sf.laja.context.Context

    return new AttributeRef(namespaces);
  }

  @Override
  public IReference createReference(ITemplate itemplate, IMacro imacro, IFunction ifunction) {
    Context context = getContext(itemplate, imacro, ifunction);
    return new Reference(source, context, templateTextWriter, namespaces);
  }
View Full Code Here

Examples of net.sf.urlchecker.commands.Context

    @Test
    public void testChainListeners() {
        final InputStream inStream = this.getClass().getClassLoader()
                .getResourceAsStream("dummyData.xml");
        final Context context = new StandardContext();

        // We need to add the listener to the context before we start. this test
        // class has been amended to implement the chain listener because the
        // invocation of the fireEvent method uses ClosureUtils from Apache
        // Commons and an in-line listener method is not accessible at run time.
        context.addListener(this);

        try {
            context.setSource(new InputStreamReader(inStream, "UTF-8"));

            final long t = System.currentTimeMillis();
            resolver.process(context);
            final long tt = System.currentTimeMillis();
            LOGGER.info("Total Time:" + (tt - t) + "ms");
View Full Code Here

Examples of net.sourceforge.aprog.context.Context

   * @return
   * <br>Not null
   * <br>New
   */
  public static final Context newContext() {
    final Context result = new Context();

    result.set(APPLICATION_NAME, AFConstants.APPLICATION_NAME);
    result.set(APPLICATION_VERSION, AFConstants.APPLICATION_VERSION);
    result.set(APPLICATION_COPYRIGHT, AFConstants.APPLICATION_COPYRIGHT);
    result.set(APPLICATION_ICON_PATH, AFConstants.APPLICATION_ICON_PATH);

    return result;
  }
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.Context

        + ", methodName: " + methodName + ", args: " + args);
    /*
     * 1. lookup functions by name. 2. Find context and scope. 3. Convert
     * thisObject to ScriptableObject 4. Convert args 5. Get return value
     */
    Context jsContext = Context.getCurrentContext();
    ScriptableObject jsThis;
    if (thisObj.getType() == ValueType.NULL) {
      jsThis = window;
    } else {
      jsThis = (ScriptableObject) makeJsvalFromValue(jsContext, thisObj);
View Full Code Here

Examples of nexj.core.runtime.Context

            join(keys, ", ")
         }, cause);

      if (location instanceof ContextHolder)
      {
         Context context = ((ContextHolder)location).getContext();

         if (context != null)
         {
            StringBuffer buf = new StringBuffer(128);

            buf.append(m_sErrCode);
            buf.append('.');
            buf.append((location == null) ? "Object" : location.getLazyClassName());

            if (keys != null)
            {
               buf.append('.');
               append(buf, keys, "-");
            }

            String sFullId = buf.toString();

            if (context.getString(sFullId) != sFullId)
            {
               m_sErrCode = sFullId;

               if (location instanceof Named)
               {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.