Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

RestrictedRenderResponse.java 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. @ITMillApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal.gwt.server;
  5. import java.io.IOException;
  6. import java.io.OutputStream;
  7. import java.io.PrintWriter;
  8. import java.io.Serializable;
  9. import java.util.Collection;
  10. import java.util.Locale;
  11. import javax.portlet.CacheControl;
  12. import javax.portlet.PortletMode;
  13. import javax.portlet.PortletURL;
  14. import javax.portlet.RenderResponse;
  15. import javax.portlet.ResourceURL;
  16. import javax.servlet.http.Cookie;
  17. import org.w3c.dom.DOMException;
  18. import org.w3c.dom.Element;
  19. /**
  20. * Read-only wrapper for a {@link RenderResponse}.
  21. *
  22. * Only for use by {@link PortletApplicationContext} and
  23. * {@link PortletApplicationContext2}.
  24. */
  25. class RestrictedRenderResponse implements RenderResponse, Serializable {
  26. private RenderResponse response;
  27. RestrictedRenderResponse(RenderResponse response) {
  28. this.response = response;
  29. }
  30. public void addProperty(String key, String value) {
  31. response.addProperty(key, value);
  32. }
  33. public PortletURL createActionURL() {
  34. return response.createActionURL();
  35. }
  36. public PortletURL createRenderURL() {
  37. return response.createRenderURL();
  38. }
  39. public String encodeURL(String path) {
  40. return response.encodeURL(path);
  41. }
  42. public void flushBuffer() throws IOException {
  43. // NOP
  44. // TODO throw?
  45. }
  46. public int getBufferSize() {
  47. return response.getBufferSize();
  48. }
  49. public String getCharacterEncoding() {
  50. return response.getCharacterEncoding();
  51. }
  52. public String getContentType() {
  53. return response.getContentType();
  54. }
  55. public Locale getLocale() {
  56. return response.getLocale();
  57. }
  58. public String getNamespace() {
  59. return response.getNamespace();
  60. }
  61. public OutputStream getPortletOutputStream() throws IOException {
  62. // write forbidden
  63. return null;
  64. }
  65. public PrintWriter getWriter() throws IOException {
  66. // write forbidden
  67. return null;
  68. }
  69. public boolean isCommitted() {
  70. return response.isCommitted();
  71. }
  72. public void reset() {
  73. // NOP
  74. // TODO throw?
  75. }
  76. public void resetBuffer() {
  77. // NOP
  78. // TODO throw?
  79. }
  80. public void setBufferSize(int size) {
  81. // NOP
  82. // TODO throw?
  83. }
  84. public void setContentType(String type) {
  85. // NOP
  86. // TODO throw?
  87. }
  88. public void setProperty(String key, String value) {
  89. response.setProperty(key, value);
  90. }
  91. public void setTitle(String title) {
  92. response.setTitle(title);
  93. }
  94. public void setNextPossiblePortletModes(Collection<PortletMode> portletModes) {
  95. // NOP
  96. // TODO throw?
  97. }
  98. public ResourceURL createResourceURL() {
  99. return response.createResourceURL();
  100. }
  101. public CacheControl getCacheControl() {
  102. return response.getCacheControl();
  103. }
  104. public void addProperty(Cookie cookie) {
  105. // NOP
  106. // TODO throw?
  107. }
  108. public void addProperty(String key, Element element) {
  109. // NOP
  110. // TODO throw?
  111. }
  112. public Element createElement(String tagName) throws DOMException {
  113. // NOP
  114. return null;
  115. }
  116. }