Package org.openxri.store

Examples of org.openxri.store.SubSegment


  public boolean equals(Object object) {

    if (object == this) return(true);
    if (object == null || ! (object instanceof SubSegment)) return(false);

    SubSegment other = (SubSegment) object;

    Long id1 = this.getId();
    Long id2 = other.getId();
   
    if (id1 == null || id2 == null) return(false);
   
    return(id1.equals(id2));
  }
View Full Code Here


    return(list);
  }

  public Object getDisplayValue(Object object) {

    SubSegment rootSubSegment = (SubSegment) object;
   
    return(rootSubSegment.getName());
  }
View Full Code Here

    return(rootSubSegment.getName());
  }

  public String getIdValue(Object object, int index) {

    SubSegment rootSubSegment = (SubSegment) object;
   
    return(rootSubSegment.getName());
  }
View Full Code Here

      private static final long serialVersionUID = 5612635419131499932L;

      @Override
      protected void populateItem(ListItem item) {

        final SubSegment subSegment = (SubSegment) item.getModelObject();

        PageLink link = new PageLink("link", new IPageLink() {

          private static final long serialVersionUID = -465660455825345856L;

          public Page getPage() {
           
            return(new SubSegmentDetails(subSegment));
          }

          public Class<?> getPageIdentity() {
           
            return(SubSegmentDetails.class);
          }
         
        });
       
        link.add(new Label("id", subSegment.getId().toString()));
        link.add(new Label("name", subSegment.getName()));
        item.add(link);
      }
    });
  }
View Full Code Here

        // using the parent authority and subsegment name, find the subsegment and the authority we are describing now
        // we must be prepared to have null values here, since not all pipeline configurations
        // may use objects from the store

        SubSegment subSegment = null;
        Authority authority = null;

        if (parentAuthority != null) subSegment = this.store.findSubSegment(parentAuthority, subSegmentName);
        if (subSegment != null) authority = this.store.getSubSegmentAuthority(subSegment);

        // give subclasses a chance to init the XRD

        ret = this.initXRD(
            xrd,
            parentAuthority,
            subSegmentName,
            signed);

        // if a subclass returned true, it doesn't want us to do any more work

        if (ret == true) {

          log.debug("Subclass handled XRD completely. Returning it without any more work.");
          xrds.add(xrd);
          continue;
        }

        // check if the parent authority overrides the LOOKUP pipeline. if not, use the default.

        PipelineRegistry pipelineRegistry = (this.serverConfig == null) ? null : this.serverConfig.getPipelineRegistry();
        Pipeline lookupPipeline = null;

        if (this.store instanceof StoreAttributable) {

          StoreAttributable storeAttributable = (StoreAttributable) this.store;

          String pipelineName = storeAttributable.getAuthorityAttributes(parentAuthority).get(Pipeline.ATTRIBUTE_OVERRIDE_LOOKUP_PIPELINE);
          if (pipelineRegistry != null && pipelineName != null) lookupPipeline = pipelineRegistry.getPipelineByName(pipelineName);
        }

        if (pipelineRegistry != null && lookupPipeline == null) lookupPipeline = pipelineRegistry.getDefaultLookupPipeline();

        // execute LOOKUP pipeline

        xrd = lookupPipeline.execute(
            this.store,
            xrd,
            segment,
            parentAuthority,
            subSegmentName,
            authority,
            false);

        // let our subclasses finish the XRD before we append it to the XRDS

        if (xrd != null) {

          this.finishXRD(
            xrd,
            parentAuthority,
            subSegment,
            authority,
            signed);
        }

        // if we were not able to get a XRD, that's ok if we found at least one before
        // (we are not necessarily authoritative for the whole query)

        if (xrd == null) {

          if (i > 0) {

            break;
          } else {

            xrds.add(makeNotFoundXrd(subSegmentName));
            break;
          }
        }

        // authority becomes the parent authority for the next subsegment

        parentAuthority = authority;
        if (subSegment != null) setParentQueryName(subSegment.getName());

        // append XRD to the XRDS

        xrds.add(xrd);
      } catch (Exception ex) {
View Full Code Here

    Store store = (Store) this.serverConfig.getComponentRegistry().getComponent(Store.class);

    try {

      SubSegment rootSubSegment1 = store.createRootSubSegment("=example", new XRD());
      Authority rootAuthority1 = store.getSubSegmentAuthority(rootSubSegment1);
      SubSegment subSegment1 = store.registerSubsegment(rootAuthority1, "*name1", makeSampleXRD());
      SubSegment subSegment2 = store.registerSubsegment(rootAuthority1, "*name2", makeSampleXRD());

      SubSegment rootSubSegment2 = store.createRootSubSegment("@example", new XRD());
      Authority rootAuthority2 = store.getSubSegmentAuthority(rootSubSegment2);
      SubSegment subSegment3 = store.registerSubsegment(rootAuthority2, "*name3", makeSampleXRD());
      Authority authority3 = store.getSubSegmentAuthority(subSegment3);
      SubSegment subSegment4 = store.registerSubsegment(authority3, "*name4", makeSampleXRD());
    } catch (StoreException ex) {

      ex.printStackTrace();
    }

View Full Code Here

      private static final long serialVersionUID = 8793019471745319174L;

      @Override
      protected void populateItem(ListItem item) {

        final SubSegment subSegment = (SubSegment) item.getModelObject();

        PageLink link = new PageLink("link", new IPageLink() {

          private static final long serialVersionUID = 4182879013901656829L;

          public Page getPage() {

            return(new SubSegmentDetails(subSegment));
          }

          public Class<?> getPageIdentity() {

            return(SubSegmentDetails.class);
          }
        });
        link.add(new Label("name", subSegment.getName()));
        item.add(link);
      }
    });
    this.add(new ListView("childSubSegments") {

      private static final long serialVersionUID = 1273612869821409740L;

      @Override
      protected void populateItem(ListItem item) {

        final SubSegment subSegment = (SubSegment) item.getModelObject();

        PageLink link = new PageLink("link", new IPageLink() {

          private static final long serialVersionUID = -1232152334705755201L;

          public Page getPage() {

            return(new SubSegmentDetails(subSegment));
          }

          public Class<?> getPageIdentity() {

            return(SubSegmentDetails.class);
          }
        });
        link.add(new Label("name", subSegment.getName()));
        item.add(link);
      }
    });
    this.add(new XrdForm("xrdForm"));
    this.add(new TemplateForm("templateForm"));
View Full Code Here

        // using the parent authority and subsegment name, find the subsegment and the authority we are describing now
        // we must be prepared to have null values here, since not all pipeline configurations
        // may use objects from the store

        SubSegment subSegment = null;
        Authority authority = null;

        if (parentAuthority != null) subSegment = this.store.findSubSegment(parentAuthority, subSegmentName);
        if (subSegment != null) authority = this.store.getSubSegmentAuthority(subSegment);

        // give subclasses a chance to init the XRD

        ret = this.initXRD(
            xrd,
            parentAuthority,
            subSegmentName,
            signed);

        // if a subclass returned true, it doesn't want us to do any more work

        if (ret == true) {

          log.debug("Subclass handled XRD completely. Returning it without any more work.");
          xrds.add(xrd);
          continue;
        }

        // check if the parent authority overrides the LOOKUP pipeline. if not, use the default.

        ServerConfig serverConfig = ServerConfigFactory.getSingleton();
        PipelineRegistry pipelineRegistry = (serverConfig == null) ? null : serverConfig.getPipelineRegistry();
        Pipeline lookupPipeline = null;

        if (this.store instanceof StoreAttributable) {

          StoreAttributable storeAttributable = (StoreAttributable) this.store;

          String pipelineName = storeAttributable.getAuthorityAttributes(parentAuthority).get(Pipeline.ATTRIBUTE_OVERRIDE_LOOKUP_PIPELINE);
          if (pipelineRegistry != null && pipelineName != null) lookupPipeline = pipelineRegistry.getPipelineByName(pipelineName);
        }

        if (pipelineRegistry != null && lookupPipeline == null) lookupPipeline = pipelineRegistry.getDefaultLookupPipeline();

        // execute LOOKUP pipeline

        xrd = lookupPipeline.execute(
            this.store,
            xrd,
            segment,
            parentAuthority,
            subSegmentName,
            authority,
            false);

        // let our subclasses finish the XRD before we append it to the XRDS

        if (xrd != null) {

          this.finishXRD(
            xrd,
            parentAuthority,
            subSegment,
            authority,
            signed);
        }

        // if we were not able to get a XRD, that's ok if we found at least one before
        // (we are not necessarily authoritative for the whole query)

        if (xrd == null) {

          if (i > 0) {

            break;
          } else {

            xrds.add(makeNotFoundXrd(subSegmentName));
            break;
          }
        }

        // authority becomes the parent authority for the next subsegment

        parentAuthority = authority;
        if (subSegment != null) setParentQueryName(subSegment.getName());

        // append XRD to the XRDS

        xrds.add(xrd);
      } catch (Exception ex) {
View Full Code Here

  public boolean equals(Object object) {

    if (object == this) return(true);
    if (object == null || ! (object instanceof SubSegment)) return(false);

    SubSegment other = (SubSegment) object;

    Long id1 = this.getId();
    Long id2 = other.getId();
   
    if (id1 == null || id2 == null) return(false);
   
    return(id1.equals(id2));
  }
View Full Code Here

    Store store = (Store) ServerConfigFactory.getSingleton().getComponentRegistry().getComponent(Store.class);

    try {

      SubSegment rootSubSegment1 = store.createRootSubSegment("=example", new XRD());
      Authority rootAuthority1 = store.getSubSegmentAuthority(rootSubSegment1);
      SubSegment subSegment1 = store.registerSubsegment(rootAuthority1, "*name1", makeSampleXRD());
      SubSegment subSegment2 = store.registerSubsegment(rootAuthority1, "*name2", makeSampleXRD());

      SubSegment rootSubSegment2 = store.createRootSubSegment("@example", new XRD());
      Authority rootAuthority2 = store.getSubSegmentAuthority(rootSubSegment2);
      SubSegment subSegment3 = store.registerSubsegment(rootAuthority2, "*name3", makeSampleXRD());
      Authority authority3 = store.getSubSegmentAuthority(subSegment3);
      SubSegment subSegment4 = store.registerSubsegment(authority3, "*name4", makeSampleXRD());
    } catch (StoreException ex) {

      ex.printStackTrace();
    }

View Full Code Here

TOP

Related Classes of org.openxri.store.SubSegment

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.