Examples of RelationInfo


Examples of com.tll.model.schema.RelationInfo

      IModelProperty prop = createValueProperty(ptype, pname, obj, pdata);

      if(prop == null) {
        // related one
        if(IEntity.class.isAssignableFrom(ptype)) {
          final RelationInfo ri = schemaInfo.getRelationInfo(entityClass, pname);
          final boolean reference = ri.isReference();
          if(shouldMarshalRelation(reference, depth, options)) {
            final IEntity e = (IEntity) obj;
            final Model m = e == null ? null : marshalEntity(e, options, visited, depth + 1);
            final IEntityType etype =
              ri.getRelatedType() == null ? null : etResolver.resolveEntityType(e == null ? ri.getRelatedType() : e
                  .entityClass());
            prop = new RelatedOneProperty(etype, m, pname, reference);
          }
        }

        // related many collection
        else if(Collection.class.isAssignableFrom(ptype)) {
          final RelationInfo ri = schemaInfo.getRelationInfo(entityClass, pname);
          final boolean reference = ri.isReference();
          if(shouldMarshalRelation(reference, depth, options)) {
            List<Model> list = null;
            if(obj != null) {
              list = new ArrayList<Model>();
              final Collection<IEntity> set = (Collection<IEntity>) obj;
              for(final IEntity e : set) {
                final Model nested = marshalEntity(e, options, visited, depth + 1);
                list.add(nested);
              }
            }
            prop = new RelatedManyProperty(etResolver.resolveEntityType(ri.getRelatedType()), pname, reference, list);
          }
        }

        // map (assume <String, String> type)
        else if(Map.class.isAssignableFrom(ptype)) {
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.vine.RelationInfo

    if ( newMappings == null ) {
      return;
    }

    for ( Mapping mapping : newMappings ) {
      RelationInfo relInfo = relInfoMap.get(mapping.getRelation());

      String codedLeft = VineMain.getCodedTerm(mapping.getLeft());
      String codedRight = VineMain.getCodedTerm(mapping.getRight());

      _addMapping(codedLeft, relInfo, codedRight, mapping.getMetadata());
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.vine.RelationInfo

  /** creates the SKOS-based relationInfos */
  private static List<RelationInfo>  _createSkosRelationInfos() {
 
    List<RelationInfo> relInfos = new ArrayList<RelationInfo>();
   
    relInfos.add(new RelationInfo(
        "exactMatch28.png",
        "exactMatch",
        EXACT_MATCH_DESCRIPTION + "\n\n" + Skos.exactMatch.getURI(),
        Skos.exactMatch.getURI()
    ));
   
    relInfos.add(new RelationInfo(
        "closeMatch28.png",
        "closeMatch",
        CLOSE_MATCH_DESCRIPTION + "\n\n" + Skos.closeMatch.getURI(),
        Skos.closeMatch.getURI()
    ));
   
    relInfos.add(new RelationInfo(
        "broadMatch28.png",
        "broadMatch",
        BROAD_MATCH_DESCRIPTION + "\n\n" + Skos.broadMatch.getURI(),
        Skos.broadMatch.getURI()
    ));

    relInfos.add(new RelationInfo(
        "narrowMatch28.png",
        "narrowMatch",
        NARROW_MATCH_DESCRIPTION + "\n\n" + Skos.narrowMatch.getURI(),
        Skos.narrowMatch.getURI()
    ));

    relInfos.add(new RelationInfo(
        "relatedMatch28.png",
        "relatedMatch",
        RELATED_MATCH_DESCRIPTION + "\n\n" + Skos.relatedMatch.getURI(),
        Skos.relatedMatch.getURI()
    ));
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.vine.RelationInfo

  /** creates the SKOS2-based relationInfos */
  private static List<RelationInfo>  _createSkos2RelationInfos() {
   
    List<RelationInfo> relInfos = new ArrayList<RelationInfo>();
   
    relInfos.add(new RelationInfo(
        "exactMatch28.png",
        "exactMatch",
        EXACT_MATCH_DESCRIPTION + "\n\n" + Skos2.exactMatch.getURI(),
        Skos2.exactMatch.getURI()
    ));
   
    relInfos.add(new RelationInfo(
        "closeMatch28.png",
        "closeMatch",
        CLOSE_MATCH_DESCRIPTION + "\n\n" + Skos2.closeMatch.getURI(),
        Skos2.closeMatch.getURI()
    ));
   
    relInfos.add(new RelationInfo(
        "broadMatch28.png",
        "broadMatch",
        BROAD_MATCH_DESCRIPTION + "\n\n" + Skos2.broadMatch.getURI(),
        Skos2.broadMatch.getURI()
    ));
   
    relInfos.add(new RelationInfo(
        "narrowMatch28.png",
        "narrowMatch",
        NARROW_MATCH_DESCRIPTION + "\n\n" + Skos2.narrowMatch.getURI(),
        Skos2.narrowMatch.getURI()
    ));
   
    relInfos.add(new RelationInfo(
        "relatedMatch28.png",
        "relatedMatch",
        RELATED_MATCH_DESCRIPTION + "\n\n" + Skos2.relatedMatch.getURI(),
        Skos2.relatedMatch.getURI()
    ));
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.