Examples of Reply


Examples of org.osforce.connect.entity.discussion.Reply

  }

  @AfterReturning("execution(* org.osforce.connect.service.discussion.ReplyService.createReply(..)) ||"
      + "execution(* org.osforce.connect.service.discussion.ReplyService.updateReply(..))")
  public void updateReply(JoinPoint jp) {
    Reply reply = (Reply) jp.getArgs()[0];
    Map<Object, Object> context = CollectionUtil.newHashMap();
    context.put("replyId", reply.getId());
    context.put("template", TEMPLATE_REPLY_UPDATE);
    replyActivityStreamTask.doAsyncTask(context);
    //
    replyCreateEmailTask.doAsyncTask(context);
  }
View Full Code Here

Examples of org.osforce.connect.entity.discussion.Reply

  @Override
  protected void prepareMessage(MimeMessageHelper helper,
      Map<Object, Object> context) throws Exception {
    Long replyId = (Long) context.get("replyId");
    Reply reply = replyService.getReply(replyId);
    context.put("topic", reply.getTopic());
    context.put("reply", reply);
    context.put("site", reply.getTopic().getForum().getProject().getCategory().getSite());
    helper.addTo(reply.getTopic().getEnteredBy().getEmail(),
        reply.getTopic().getEnteredBy().getNickname());
    //
    String subject = FreeMarkerTemplateUtils.processTemplateIntoString(
        configuration.getTemplate(REPLY_CREATE_SUBJECT), context);
    String content = FreeMarkerTemplateUtils.processTemplateIntoString(
        configuration.getTemplate(REPLY_CREATE_CONTENT), context);
View Full Code Here

Examples of org.springside.examples.showcase.common.entity.Reply

    assertNull(subject);
  }

  @Test
  public void createReply() {
    Reply reply = new Reply();
    reply.setTitle("GoodAfternoon");
    reply.setContent("Good Afternoon!!!");
    reply.setModifyTime(new Date());

    User user = userDao.get("1");
    reply.setUser(user);

    Subject subject = subjectDao.get("1");
    reply.setSubject(subject);

    replyDao.save(reply);
    replyDao.flush();
  }
View Full Code Here

Examples of org.uengine.smcp.twister.engine.priv.core.definition.Reply

    protected Class getActivityClass() {
        return Reply.class;
    }

    protected void processSpecificAttributes(Element element, Activity activity) throws DeploymentException {
        Reply reply = (Reply) activity;
        Attribute partnerLink = element.attribute("partnerLink");
        if (partnerLink != null) {
            log.debug("partnerLink=" + partnerLink);
            reply.setPartner(partnerLink.getValue());
        }

        Attribute portType = element.attribute("portType");
        if (portType != null) {
            String portTypeStr = portType.getValue();
            int sepIndex = portTypeStr.indexOf(TwisterDeployerImpl.NS_SEPARATOR);
            if (sepIndex > 0) {
                portTypeStr = portTypeStr.substring(sepIndex + 1, portTypeStr.length());
            }
            log.debug("portType=" + portTypeStr);
            reply.setPortType(portTypeStr);
        }

        Attribute operation = element.attribute("operation");
        if (operation != null) {
            log.debug("operation=" + operation);
            reply.setOperation(operation.getValue());
        }

        Attribute variable = element.attribute("variable");
        if (variable != null) {
            log.debug("variable=" + variable);
            reply.setVariable(variable.getValue());
        }

        Attribute faultName = element.attribute("faultName");
        if (faultName != null) {
            log.debug("faultName=" + faultName);
            reply.setFaultName(faultName.getValue());
        }

    }
View Full Code Here

Examples of org.w3c.jigsaw.http.Reply

      // should be check100Continue() or something
      ContinueEvent cevent = (ContinueEvent) event;
      if ((req.getMajorVersion() == 1) && (req.getMinorVersion() == 1)) {
    try {
        if ((cevent.packet != null) && (frame != null)) {
      Reply r = null;
      try {
          r = frame.dupReply(request, cevent.packet);
          r.setStream((InputStream)null);
      } catch (Exception ex) {}
      request.getClient().sendContinue(r);
        } else {
            request.getClient().sendContinue();
        }
View Full Code Here

Examples of org.w3c.jigsaw.http.Reply

    public ReplyInterface outgoingFilter(RequestInterface req,
           ReplyInterface rep)
  throws ProtocolException
    {
  Request request = (Request) req;
  Reply   reply   = (Reply) rep;
  // Anything to compress ?
  if ( ! reply.hasStream() ) {
      return null;
  }
  // if there is already a Content-Encoding, skip this
  if (reply.getContentEncoding() != null) {
      return null;
  }
  // Match possible mime types:
  MimeType t[]     = getMimeTypes();
  boolean  matched = false;
  if ( t != null ) {
      for (int i = 0 ; i < t.length ; i++) {
    if ( t[i] == null )
        continue;
    if ( t[i].match(reply.getContentType()) > 0 ) {
        matched = true;
        break;
    }
      }
  }
  if ( ! matched )
      return null;
  // Compress:
  try {
      PipedOutputStream pout = new PipedOutputStream();
      PipedInputStream  pin  = new PipedInputStream(pout);
      new GZIPDataMover(reply.openStream()
            , new GZIPOutputStream(pout));
      reply.addContentEncoding("gzip");
      reply.setContentLength(-1);
      reply.setStream(pin);
  } catch (Exception ex) {
      ex.printStackTrace();
  }
  return null;
    }
View Full Code Here

Examples of org.w3c.jigsaw.http.Reply

     */

    protected void error(Request request, String msg)
  throws ProtocolException
    {
  Reply reply = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
  reply.setContent(msg);
  throw new HTTPException(reply);
    }
View Full Code Here

Examples of org.w3c.jigsaw.http.Reply

  reply.setContent(msg);
  throw new HTTPException(reply);
    }

    protected Reply okReply(Request request, byte bits[]) {
  Reply reply = request.makeReply(HTTP.OK);
  reply.setContentType(AdminContext.conftype);
  if ( bits != null ) {
      ByteArrayInputStream in = new ByteArrayInputStream(bits);
      reply.setContentLength(bits.length);
      reply.setStream(in);
  }
  return reply;
    }
View Full Code Here

Examples of org.w3c.jigsaw.http.Reply

    public ReplyInterface perform(RequestInterface ri)
  throws org.w3c.tools.resources.ProtocolException,
         org.w3c.tools.resources.ResourceException
    {
  Request     request  = (Request) ri;
  Reply       reply    = null;
  Reply       extReply = null;
  HttpExtList cman     = request.getHttpCManExtDecl();
  HttpExtList copt     = request.getHttpCOptExtDecl();
  HttpExtList man      = request.getHttpManExtDecl();

  if ((cman != null) || (copt != null)) {
View Full Code Here

Examples of org.w3c.jigsaw.http.Reply

         HttpExtList cman,
         HttpExtList copt)
  throws org.w3c.tools.resources.ProtocolException
    {
  if (cman != null) {
      Reply error = request.makeReply(HTTP.NOT_EXTENDED) ;
      HtmlGenerator content = new HtmlGenerator("Error");
      content.append("<h1>Mandatory extension(s) not supported:",
         "</h1><p>\n");
      content.append("<ul>\n");
      HttpExt exts[] = cman.getHttpExts();
      for (int i=0 ; i < exts.length ; i++)
    content.append("<li> "+exts[i].getName()+"\n");
      content.append("</ul>\n");
      error.setStream(content);
      return error;
  }
  return null;
    }
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.