Examples of ERXResponse


Examples of er.extensions.appserver.ERXResponse

        appendIdentifierTagAndValue(this, _id, woresponse, wocontext);
      }

      @Override
      public void appendToResponse(WOResponse woresponse, WOContext wocontext) {
        WOResponse newResponse = cleanupXHTML ? new ERXResponse() : woresponse;
        super.appendToResponse(newResponse, wocontext);

        processResponse(this, newResponse, wocontext, 0, nameInContext(wocontext, wocontext.component()));
        if (ERXPatcher.DynamicElementsPatches.cleanupXHTML) {
          woresponse.appendContentString(newResponse.contentString());
View Full Code Here

Examples of er.extensions.appserver.ERXResponse

        appendIdentifierTagAndValue(this, _id, woresponse, wocontext);
      }

      @Override
      public void appendToResponse(WOResponse woresponse, WOContext wocontext) {
        WOResponse newResponse = cleanupXHTML ? new ERXResponse() : woresponse;
        super.appendToResponse(newResponse, wocontext);

        processResponse(this, newResponse, wocontext, 0, nameInContext(wocontext, wocontext.component()));
        if (ERXPatcher.DynamicElementsPatches.cleanupXHTML) {
          woresponse.appendContentString(newResponse.contentString());
View Full Code Here

Examples of er.extensions.appserver.ERXResponse

     
      @Override
      public void appendAttributesToResponse(WOResponse woresponse, WOContext wocontext) {
        if (woresponse instanceof ERXResponse && JavaScript.removeLanguageAttribute) {
          // 5.3 + 5.4 hackaround to pop the language attribute off of the script tag
          ERXResponse response = (ERXResponse)woresponse;
          response.pushContent();
          super.appendAttributesToResponse(woresponse, wocontext);
          String contentString = response.contentString();
          String language = (String)_language.valueInComponent(wocontext.component());
          Pattern pattern = Pattern.compile("\\s*language\\s*=\\s*\"?" + language + "\"?", Pattern.CASE_INSENSITIVE);
          contentString = pattern.matcher(contentString).replaceFirst("");
          response.setContent(contentString);
          response.popContent(true);
        }
        else {
          super.appendAttributesToResponse(woresponse, wocontext);
        }
      }
View Full Code Here

Examples of er.extensions.appserver.ERXResponse

    }


    public WOResponse getPathAction() {
        WORequest aRequest = request();
        ERXResponse aResponse = new ERXResponse();

        if (aRequest.isUsingWebServer())  {
            aResponse.setStatus(WOMessage.HTTP_STATUS_FORBIDDEN);
            aResponse.appendContentString("Access Denied");
            return aResponse;
        }
        String aPath = aRequest.headerForKey("filepath");
        boolean showFiles = (aRequest.headerForKey("showFiles") != null) ? true : false;

        // looking for roots, or root listing of only 1 root
        if (aPath == null && !singleRoot) {
            aResponse.appendContentString(xmlRoots);
            aResponse.setHeader("YES", "isRoots");
        } else {
            if (aPath == null) aPath = rootStrings[0];
            NSArray anArray = fileListForStartingPath(aPath, showFiles);

            if (anArray == null) {
                aResponse.appendContentString("ERROR");
            } else {
                _JavaMonitorCoder aCoder = new _JavaMonitorCoder();
                String anXMLString = null;
                anXMLString = aCoder.encodeRootObjectForKey(anArray, "pathArray");
                anXMLString = (anXMLString) + " \r\n";
                aResponse.appendContentString(anXMLString);
                aResponse.setHeader(aPath, "filepath");
            }
        }
        return aResponse;
    }
View Full Code Here

Examples of er.extensions.appserver.ERXResponse

        // For error handling
        if (aResponse == null) {
            if (willChange) {
                _siteConfig.hostErrorArray.addObjectIfAbsent(this);
            }
            aResponse = new ERXResponse(errorResponse);
        } else {
            // if we successfully synced, clear the error dictionary
            if (isSync && isAvailable) {
                if (NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelDetailed, NSLog.DebugGroupDeployment))
                    NSLog.debug.appendln("Cleared sync request for host " + name());
View Full Code Here

Examples of er.extensions.appserver.ERXResponse

    }
   
    // actions   
    public WOActionResults removeAttachment() {
      object().removeObjectFromBothSidesOfRelationshipWithKey(attachment, propertyKey());   
    return new ERXResponse();
    }
View Full Code Here

Examples of er.extensions.appserver.ERXResponse

      invokeAction = false;
      return (WOActionResults) valueForBinding("action");
    } else if (invokeAction) {
      invokeAction = false;
      willAccept = true;
      return new ERXResponse(localizer().localizedStringForKey("UnacceptableMimetype"), ERXHttpStatusCodes.BAD_REQUEST); // CHECKME 406 or 415?
    }
    return super.invokeAction(request, context);
  }
View Full Code Here

Examples of er.extensions.appserver.ERXResponse

    }
   
    @Override
    public void appendToResponse(WOResponse response, WOContext context) {
        if (isEnabled()) {
            ERXResponse newResponse = new ERXResponse();

            super.appendToResponse(newResponse, context);

            String contentString = newResponse.contentString();
            contentString = contentString.replaceAll(" ", "");
            if (log.isDebugEnabled()) {
                log.debug("Converting content string:\n" + contentString);
            }
            byte[] bytes;
View Full Code Here

Examples of er.extensions.appserver.ERXResponse

      // Skip, because this has already been added ...
      return;
    }
    // default to inline for ajax requests
    boolean inline = booleanValueForBinding( "inline", ERXAjaxApplication.isAjaxRequest( wocontext.request() ) );
    WOResponse response = inline ? originalResponse : new ERXResponse();

    String href = styleSheetUrl();
    if( href == null ) {
      String key = styleSheetKey();
      ERXExpiringCache<String, WOResponse> cache = cache( session() );
      String md5;
      WOResponse cachedResponse = cache.objectForKey( key );
      if( cache.isStale( key ) || ERXApplication.isDevelopmentModeSafe() ) {
        cachedResponse = new ERXResponse();
        super.appendToResponse( cachedResponse, wocontext );
        // appendToResponse above will change the response of
        // "wocontext" to "newresponse". When this happens during an
        // Ajax request, it will lead to backtracking errors on
        // subsequent requests, so restore the original response "r"
View Full Code Here

Examples of er.extensions.appserver.ERXResponse

   */
  @Override
  public void appendToResponse(WOResponse response, WOContext context) {
    start = System.currentTimeMillis(); current = start;
    if (isEnabled()) {
      ERXResponse newResponse = new ERXResponse();
      newResponse.setContentEncoding(response.contentEncoding());

      super.appendToResponse(newResponse, context);

      if (log.isDebugEnabled()) {
        String contentString = newResponse.contentString();
        log.debug("Converting content string:\n" + contentString);
      }

      try {
        NSData data = transform(transformer(), newResponse.content());
        if(hasBinding("data") && canSetValueForBinding("data")) {
          setValueForBinding(data, "data");
        }
        if(hasBinding("stream") && canSetValueForBinding("stream")) {
          setValueForBinding(data.stream(), "stream");
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.