/** * Creates the full URL to an entity using the sakai {@link ServerConfigurationService}, * (e.g. http://server:8080/direct/entity/123/)<br/> * <br/> * <b>Note:</b> the webapp name (relative URL path) of the direct servlet, of "/direct" * is hardcoded into this method, and the * {@link org.sakaiproject.entitybroker.util.servlet.DirectServlet} must be deployed there on this * server. * * @param reference a globally unique reference to an entity, * consists of the entity prefix and optionally the local id * @param viewKey the specific view type to get the URL for, * can be null to determine the key automatically * @param extension the optional extension to add to the end, * can be null to use no extension * @return the full URL to a specific entity or space */ public String getEntityURL(String reference, String viewKey, String extension) { // ensure this is a valid reference first EntityReference ref = parseReference(reference); EntityView view = makeEntityView(ref, viewKey, extension); String url = makeFullURL(view.toString()); return url; }
ev.setExtension(format); String URL = ev.toString();
ev.setExtension(format); String URL = ev.toString();
throw new EntityException("Unable to save entity ("+view.getEntityReference()+") with format (" +format+"), translated entity object was null", view.toString(), HttpServletResponse.SC_BAD_REQUEST); } else { + ") and view ("+view.getViewKey()+") when there is no " + "access provider to handle the request for prefix (" + view.getEntityReference().getPrefix() + ")"; throw new EntityException( message, view.toString(), HttpServletResponse.SC_METHOD_NOT_ALLOWED );
throw new EntityException("Unable to save entity ("+view.getEntityReference()+") with format (" +format+"), translated entity object was null", view.toString(), HttpServletResponse.SC_BAD_REQUEST); } else { + ") and view ("+view.getViewKey()+") when there is no " + "access provider to handle the request for prefix (" + view.getEntityReference().getPrefix() + ")"; throw new EntityException( message, view.toString(), HttpServletResponse.SC_METHOD_NOT_ALLOWED );