Package org.emrys.webosgi.core.resource.extension

Examples of org.emrys.webosgi.core.resource.extension.DefinesRoot


        // Content root be the first be search.
        WebComActivator hostBundleActivator = FwkRuntime.getInstance()
            .getHostBundleActivator();
        if (hostBundleActivator != null) {
          for (int i = 0; i < reps.size(); i++) {
            DefinesRoot root = reps.get(i);
            if (hostBundleActivator.getBundle().equals(
                root.getSourceBundle())) {
              if (root.getResources().size() == 1) {
                if (root.getResources().get(0).getPath()
                    .equals(
                        hostBundleActivator
                            .getWebContextPath())) {
                  DefinesRoot tmp = reps.get(0);
                  reps.set(0, root);
                  reps.set(i, tmp);
                  break;
                }
              }
            }
          }
        }

        boolean hostWebRootProecessed = false;
        Iterator<DefinesRoot> it = reps.iterator();
        while (it.hasNext()) {
          DefinesRoot curResRoot = it.next();

          // Buffer the context bundle to thread local variant map.
          Bundle contextBundle = curResRoot.getSourceBundle();
          threadScope.get().put(RESPONSE_CUR_BUNDLE, contextBundle);

          // Get the resource visit controller and judge the
          // authority.
          IResourceVisitController controller = curResRoot
              .getVisitControler();

          // Buffer the current Resource Define Root to thread local
          // variant map. Do not
          // need to judge null.
View Full Code Here


          && webContentRoot.exists()) {
        IPath webContentPath = new Path(webContentRoot
            .getAbsolutePath());

        if (webContentPath != null) {
          DefinesRoot publishedResRoot = WebResCore.getInstance()
              .registerWebContextRoot(
                  wabundle,
                  WebBundleUtil
                      .getWabContextPathHeader(wabundle),
                  webContentPath.toPortableString());
View Full Code Here

   * @param rootPath
   * @return
   */
  public DefinesRoot registerWebContextRoot(Bundle bundle, String wabCtxPath,
      String rootPath) {
    DefinesRoot root = new DefinesRoot();
    ResFolder webContentFoler = new ResFolder();
    webContentFoler.setPath(wabCtxPath);
    webContentFoler.setAlias(wabCtxPath);
    IPublishedFileResolver resolver = new BundleWebContentFileResolver(
        bundle, rootPath);
    webContentFoler.setResolverID(resolver.getClass().getName());
    webContentFoler.setResolver(resolver);
    root.getResResolvers().put(resolver.getClass().getName(), resolver);
    root.getResources().add(webContentFoler);
    root.setSourceBundle(bundle);
    root.setName(wabCtxPath);
    root.setId(bundle.getSymbolicName());
    root.setVisitControler(new DefaultResourceVisitController() {
      @Override
      public boolean canRead(HttpServletRequest requestUrl) {
        return true;
      }

View Full Code Here

TOP

Related Classes of org.emrys.webosgi.core.resource.extension.DefinesRoot

Copyright © 2018 www.massapicom. 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.