Examples of ResourceURI


Examples of ch.entwine.weblounge.common.content.ResourceURI

    // Get the renderer id that has been registered with the url. For this,
    // we first have to load the page data, then get the associated renderer
    // bundle.
    try {
      Page page = null;
      ResourceURI pageURI = null;
      Site site = request.getSite();

      // Check if a page was passed as an attribute
      if (request.getAttribute(WebloungeRequest.PAGE) != null) {
        page = (Page) request.getAttribute(WebloungeRequest.PAGE);
        pageURI = page.getURI();
      }

      // Load the page from the content repository
      else {
        ContentRepository contentRepository = site.getContentRepository();
        if (contentRepository == null) {
          logger.debug("No content repository found for site '{}'", site);
          return false;
        } else if (contentRepository.isIndexing()) {
          logger.debug("Content repository of site '{}' is currently being indexed", site);
          DispatchUtils.sendServiceUnavailable(request, response);
          return true;
        }

        ResourceURI requestURI = null;
        ResourceURI requestedURI = null;

        // Load the page. Note that we are taking care of the special case where
        // a user may have created a page with a url that matches a valid
        // language identifier, in which case it would have been stripped from
        // request.getUrl().
        try {
          if (action != null) {
            pageURI = getPageURIForAction(action, request);
            requestURI = pageURI;
          } else if (path.startsWith(URI_PREFIX)) {
            String uriSuffix = StringUtils.substringBefore(path.substring(URI_PREFIX.length()), "/");
            uriSuffix = URLDecoder.decode(uriSuffix, "utf-8");
            ResourceURI uri = new PageURIImpl(site, null, uriSuffix, request.getVersion());
            requestURI = uri;
            WebUrl requestedUrl = request.getRequestedUrl();
            if (requestedUrl.hasLanguagePathSegment()) {
              String requestedPath = UrlUtils.concat(path, request.getLanguage().getIdentifier());
              String requestedUriSuffix = StringUtils.substringBefore(requestedPath.substring(URI_PREFIX.length()), "/");
              requestedUriSuffix = URLDecoder.decode(requestedUriSuffix, "utf-8");
              requestedURI = new PageURIImpl(site, requestedUriSuffix, null, request.getVersion());
            }
          } else {
            long version = isEditing ? Resource.WORK : Resource.LIVE;
            ResourceURI uri = new PageURIImpl(request);
            uri.setVersion(version);
            requestURI = uri;
            WebUrl requestedUrl = request.getRequestedUrl();
            if (requestedUrl.hasLanguagePathSegment()) {
              String requestedPath = UrlUtils.concat(path, request.getLanguage().getIdentifier());
              requestedPath = URLDecoder.decode(requestedPath, "utf-8");
View Full Code Here

Examples of ch.entwine.weblounge.common.content.ResourceURI

   *          the weblounge request
   * @return the target page
   */
  protected ResourceURI getPageURIForAction(Action action,
      WebloungeRequest request) {
    ResourceURI target = null;
    Site site = request.getSite();

    // Check if a target-page parameter was passed
    if (request.getParameter(HTMLAction.TARGET_PAGE) != null) {
      String targetUrl = request.getParameter(HTMLAction.TARGET_PAGE);
View Full Code Here

Examples of ch.entwine.weblounge.common.content.ResourceURI

    }

    // Check if the request uri matches the special uri for files. If so, try
    // to extract the id from the last part of the path. If not, check if there
    // is a file with the current path.
    ResourceURI fileURI = null;
    Resource<? extends FileContent> fileResource = null;
    try {
      String id = null;
      String filePath = null;
View Full Code Here

Examples of com.alibaba.antx.config.resource.ResourceURI

    private final String      user;
    private final String      host;
    private final int         port;

    public ResourceKey(String uri) {
        this(new ResourceURI(URI.create(uri)));
    }
View Full Code Here

Examples of com.alibaba.antx.config.resource.ResourceURI

                    }

                    channels.put(key, channel);

                    // �ɹ���������Ա����ظ���ʾ��������
                    ResourceContext.get().getVisitedURIs().remove(new ResourceKey(new ResourceURI(uri.getURI())));
                } catch (RuntimeException e) {
                    throw e;
                } catch (Exception e) {
                    throw new ConfigException(e);
                } finally {
View Full Code Here

Examples of com.alibaba.antx.config.resource.ResourceURI

        File[] subfiles = file.listFiles();
        List files = new ArrayList(subfiles.length);

        for (int i = 0; i < subfiles.length; i++) {
            File subfile = subfiles[i];
            FileResource resource = new FileResource(getSession(), new ResourceURI(subfile.toURI(), getSession()));

            files.add(resource);
        }

        Collections.sort(files);
View Full Code Here

Examples of com.alibaba.antx.config.resource.ResourceURI

            String sharedPropertiesFile = sharedPropertiesFiles[i];

            // ������װfile�����ʧ�ܣ�������URI
            URI uri = ResourceURI.guessURI(sharedPropertiesFile);

            if (new ResourceURI(uri).guessDirectory()) {
                files[i] = new PropertiesFileSet(manager, uri);
            } else {
                files[i] = new PropertiesFile(manager, uri);
            }
        }
View Full Code Here

Examples of com.alibaba.antx.config.resource.ResourceURI

            if (httpget.getStatusCode() != 200) {
                throw new ResourceNotFoundException(HttpStatus.getStatusText(httpget.getStatusCode()));
            }

            // �ɹ���������Ա����ظ���ʾ��������
            ResourceContext.get().getVisitedURIs().remove(new ResourceKey(new ResourceURI(getURI().getURI())));

            content = httpget.getResponseBody();
            charset = httpget.getResponseCharSet();

            Header contentTypeHeader = httpget.getResponseHeader("Content-Type");
View Full Code Here

Examples of com.alibaba.antx.config.resource.ResourceURI

            public Credentials getCredentials(AuthScheme scheme, String host, int port, boolean proxy)
                    throws CredentialsNotAvailableException {
                URI uri = ResourceContext.get().getCurrentURI();
                String username = ResourceContext.get().getCurrentUsername();
                Set visitedURIs = ResourceContext.get().getVisitedURIs();
                ResourceKey key = new ResourceKey(new ResourceURI(uri));
                String message;

                message = "\n";
                message += "Authentication required.\n";
                message += "realm: " + scheme.getRealm() + "\n";
View Full Code Here

Examples of com.alibaba.antx.config.resource.ResourceURI

            public Credentials getCredentials(AuthScheme scheme, String host, int port, boolean proxy)
                    throws CredentialsNotAvailableException {
                URI uri = ResourceContext.get().getCurrentURI();
                String username = ResourceContext.get().getCurrentUsername();
                Set visitedURIs = ResourceContext.get().getVisitedURIs();
                ResourceKey key = new ResourceKey(new ResourceURI(uri));
                String message;

                message = "\n";
                message += "Authentication required.\n";
                message += "realm: " + scheme.getRealm() + "\n";
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.