import java.util.Map;
import com.vaadin.terminal.StreamVariable.StreamingStartEvent;
+import com.vaadin.terminal.gwt.client.ApplicationConnection;
/**
* This interface defines the methods for painting XML to the UIDL stream.
* terminals Receivers are typically rendered for the client side as URLs,
* where the client side implementation can do an http post request.
* <p>
+ * The urls in UIDL message may use Vaadin specific protocol. Before
+ * actually using the urls on the client side, they should be passed via
+ * {@link ApplicationConnection#translateVaadinUri(String)}.
+ * <p>
* Note that in current terminal implementation StreamVariables are cleaned
* from the terminal only when:
* <ul>
}
uidlUri = themeUri + uidlUri.substring(7);
}
+ if (uidlUri.startsWith("app://")) {
+ uidlUri = getAppUri() + uidlUri.substring(6);
+ }
return uidlUri;
}
this.client = client;
paintableId = uidl.getId();
nextUploadId = uidl.getIntAttribute("nextid");
- element.setAction(uidl.getStringVariable("action"));
+ final String action = client.translateVaadinUri(uidl
+ .getStringVariable("action"));
+ element.setAction(action);
submitButton.setText(uidl.getStringAttribute("buttoncaption"));
fu.setName(paintableId + "_file");
streamVariableToSeckey.put(value, seckey);
}
- return getApplication().getURL()
- + AbstractApplicationServlet.UPLOAD_URL_PREFIX + key + "/"
- + seckey;
+ return "app://" + AbstractApplicationServlet.UPLOAD_URL_PREFIX + key
+ + "/" + seckey;
}
"Application not specified for resorce "
+ value.getClass().getName());
}
- String uri;
- if (a.getURL() != null) {
- uri = a.getURL().getPath();
- } else {
- uri = "";
- }
- if (uri.length() > 0 && uri.charAt(uri.length() - 1) != '/') {
- uri += "/";
- }
- uri += a.getRelativeLocation(r);
+ final String uri = "app://" + a.getRelativeLocation(r);
addAttribute(name, uri);
} else if (value instanceof ThemeResource) {