+ requestData;
VConsole.log("Making UIDL Request with params: " + payload);
String uri = translateVaadinUri(ApplicationConstants.APP_PROTOCOL_PREFIX
- + ApplicationConstants.UIDL_REQUEST_PATH);
+ + ApplicationConstants.UIDL_PATH + '/');
if (extraParams != null && extraParams.length() > 0) {
uri = addGetParameters(uri, extraParams);
protected void sendHeartbeat() {
final String uri = addGetParameters(
translateVaadinUri(ApplicationConstants.APP_PROTOCOL_PREFIX
- + ApplicationConstants.HEARTBEAT_REQUEST_PATH),
+ + ApplicationConstants.HEARTBEAT_PATH + '/'),
UIConstants.UI_ID_PARAMETER + "="
+ getConfiguration().getUIId());
VaadinRequest request = context.getRequest();
final String staticFilePath = request.getService()
.getStaticFileLocation(request);
- return staticFilePath + "/" + VaadinServlet.THEME_DIRECTORY_PATH
+ return staticFilePath + "/" + VaadinServlet.THEME_DIR_PATH + '/'
+ themeName;
}
ServletContext servletContext = service.getServlet()
.getServletContext();
return servletContext.getResourceAsStream("/"
- + VaadinServlet.THEME_DIRECTORY_PATH + themeName + "/"
+ + VaadinServlet.THEME_DIR_PATH + '/' + themeName + "/"
+ resource);
}
}
* @since 7.0.0
*/
public interface ConnectorResource extends Resource {
- public static final String CONNECTOR_REQUEST_PATH = "connector/";
+ public static final String CONNECTOR_PATH = "connector";
/**
* Gets resource as stream.
public class ConnectorResourceHandler implements RequestHandler {
// APP/connector/[uiid]/[cid]/[filename.xyz]
private static final Pattern CONNECTOR_RESOURCE_PATTERN = Pattern
- .compile("^/?" + ApplicationConstants.APP_REQUEST_PATH + '/'
- + ConnectorResource.CONNECTOR_REQUEST_PATH
+ .compile("^/?" + ApplicationConstants.APP_PATH + '/'
+ + ConnectorResource.CONNECTOR_PATH + '/'
+ "(\\d+)/(\\d+)/(.*)");
private static Logger getLogger() {
return true;
} else if (requestPath.matches('/'
- + ApplicationConstants.APP_REQUEST_PATH + "(/.*)?")) {
+ + ApplicationConstants.APP_PATH + "(/.*)?")) {
/*
* This should be the last request handler before we get to
* bootstrap logic. Prevent /APP requests from reaching bootstrap
static final int MAX_BUFFER_SIZE = 64 * 1024;
- final String THEME_DIRECTORY_PATH = "VAADIN/themes/";
+ final String THEME_DIR_PATH = "VAADIN/themes";
static final int DEFAULT_THEME_CACHETIME = 1000 * 60 * 60 * 24;
- static final String WIDGETSET_DIRECTORY_PATH = "VAADIN/widgetsets/";
+ static final String WIDGETSET_DIR_PATH = "VAADIN/widgetsets";
// Name of the default widget set, used if not specified in web.xml
static final String DEFAULT_WIDGETSET = "com.vaadin.DefaultWidgetSet";
// APP/global/[uiid]/[type]/[id]
private static final Matcher matcher = Pattern.compile(
- "^/?" + ApplicationConstants.APP_REQUEST_PATH + '/'
+ "^/?" + ApplicationConstants.APP_PATH + '/'
+ RESOURCE_REQUEST_PATH + "(\\d+)/(([^/]+)(/.*))").matcher(
"");
String uri = legacyResourceKeys.get(resource);
if (uri != null && !uri.isEmpty()) {
return ApplicationConstants.APP_PROTOCOL_PREFIX
- + ApplicationConstants.APP_REQUEST_PATH + '/'
+ + ApplicationConstants.APP_PATH + '/'
+ RESOURCE_REQUEST_PATH + connector.getUI().getUIId() + '/'
+ uri;
} else {
PortletContext portletContext = session.getPortletSession()
.getPortletContext();
return portletContext.getResourceAsStream("/"
- + VaadinPortlet.THEME_DIRECTORY_PATH + themeName + "/"
+ + VaadinPortlet.THEME_DIR_PATH + '/' + themeName + "/"
+ resource);
}
private static String getConnectorResourceBase(String filename,
ClientConnector connector) {
String uri = ApplicationConstants.APP_PROTOCOL_PREFIX
- + ApplicationConstants.APP_REQUEST_PATH + '/'
- + ConnectorResource.CONNECTOR_REQUEST_PATH
+ + ApplicationConstants.APP_PATH + '/'
+ + ConnectorResource.CONNECTOR_PATH + '/'
+ connector.getUI().getUIId() + '/'
+ connector.getConnectorId() + '/' + encodeFileName(filename);
return uri;
}
public static boolean isUIDLRequest(VaadinRequest request) {
- return hasPathPrefix(request, ApplicationConstants.UIDL_REQUEST_PATH);
+ return hasPathPrefix(request,
+ ApplicationConstants.UIDL_PATH + '/');
}
public static boolean isAppRequest(VaadinRequest request) {
return hasPathPrefix(request,
- ApplicationConstants.APP_REQUEST_PATH + '/');
+ ApplicationConstants.APP_PATH + '/');
}
public static boolean isHeartbeatRequest(VaadinRequest request) {
return hasPathPrefix(request,
- ApplicationConstants.HEARTBEAT_REQUEST_PATH);
+ ApplicationConstants.HEARTBEAT_PATH + '/');
}
public static void initDefaultUIProvider(VaadinSession session,
// Generate magic URL now when UI id and connectorId are known
iframe.setSource(new ExternalResource(
ApplicationConstants.APP_PROTOCOL_PREFIX
- + ApplicationConstants.APP_REQUEST_PATH + '/'
- + ConnectorResource.CONNECTOR_REQUEST_PATH
+ + ApplicationConstants.APP_PATH + '/'
+ + ConnectorResource.CONNECTOR_PATH + '/'
+ getUI().getUIId() + '/' + getConnectorId() + "/login"));
super.beforeClientResponse(initial);
}
// This indicates the whole page is generated by us (not embedded)
public static final String GENERATED_BODY_CLASSNAME = "v-generated-body";
- public static final String APP_REQUEST_PATH = "APP";
+ public static final String APP_PATH = "APP";
- public static final String UIDL_REQUEST_PATH = "UIDL/";
+ public static final String UIDL_PATH = "UIDL";
- public static final String HEARTBEAT_REQUEST_PATH = "HEARTBEAT/";
+ public static final String HEARTBEAT_PATH = "HEARTBEAT";
- public static final String PUBLISHED_FILE_PATH = APP_REQUEST_PATH + '/'
+ public static final String PUBLISHED_FILE_PATH = APP_PATH + '/'
+ "PUBLISHED";
public static final String APP_PROTOCOL_PREFIX = "app://";