Examples of Relation


Examples of org.structr.core.entity.Relation

      return result;

    } else {

      final App app                         = StructrApp.getInstance(securityContext);
      final Relation template               = getRelationshipTemplate();
      final ErrorBuffer errorBuffer         = new ErrorBuffer();

      if (template != null) {

        final NodeInterface sourceNode        = identifyStartNode(template, propertySet);
        final NodeInterface targetNode        = identifyEndNode(template, propertySet);
        final PropertyMap properties          = PropertyMap.inputTypeToJavaType(securityContext, entityClass, propertySet);
        RelationshipInterface newRelationship = null;

        if (sourceNode == null) {
          errorBuffer.add(entityClass.getSimpleName(), new EmptyPropertyToken(template.getSourceIdProperty()));
        }

        if (targetNode == null) {
          errorBuffer.add(entityClass.getSimpleName(), new EmptyPropertyToken(template.getTargetIdProperty()));
        }

        if (errorBuffer.hasError()) {
          throw new FrameworkException(422, errorBuffer);
        }
View Full Code Here

Examples of org.tinyuml.model.Relation

      factory.createNode(ElementType.PACKAGE);
   
    Dependency conn = (Dependency) factory.createConnection(
      RelationType.DEPENDENCY, source, target);
    assertStdConnectionConditions(conn, source, target);
    Relation relation = (Relation) conn.getModelElement();
    assertFalse(relation.canSetElement1Navigability());
    assertFalse(relation.canSetElement2Navigability());
  }
View Full Code Here

Examples of org.wymiwyg.knobot.relations.Relation

        subject);
    int effectiveTill = till;
    for (int i = (from - 1); i <= effectiveTill; i++) {
      try {
        // Relation relation = itemsList.getRelation(i);
        Relation relation = itemIterator.nextRelation();
        if ((!unOrdered) && (relation.getStrength() < minimalRelevance)) {
          break;
        }
        Resource targetResource = relation.getTarget();
        if (!isPermitted(targetResource)) {
          effectiveTill++;
          continue;
        }
        if (hideRead
            && targetResource.hasProperty(KNOBOT.isReadBy, subject)) {
          effectiveTill++;
          continue;
        }
        if (relation.isPath()) {
          effectiveTill++;
        }
        if (log.isDebugEnabled()) {
          log.debug("returning " + i + "nd relation with strenght"
              + relation.getCurrentStrength() + "(" + relation
              + ")");
        }

        boolean isItem = targetResource.hasProperty(RDF.type, RSS.item);
        if (isItem && !hasAcceptedLanguage(targetResource, ehRequest)) {
          effectiveTill++;
          continue;
        }
        Model itemModel = getEventInRangeAndArea(targetResource,
            startDate, endDate, area, relevantMonths, relevantAreas);
        if (itemModel == null) {
          continue;
        }
        /*
         * relation = itemsList.getRelation(i); log.info( "returning " +
         * i + "nd relation with strenght"
         */
        // resultModel.write(System.out);
        Model relationModel = JenaUtil.getExpandedResource(relation
            .getResource(), 3, true);
        Statement feedStmt = relation.getTarget().getProperty(
            AGGREGATOR.feed);
        if (feedStmt != null) {
          relationModel.add(feedStmt);
        }
        // relationModel.write(System.out);
        /*
         * Resource relationInResourceModel = (Resource) relation
         */
        Resource relationInResourceModel = JenaUtil
            .getRoots(relationModel)[0];
        relationInResourceModel.removeAll(KNOBOT.nextRelation);
        // we may still have nextRelation stmts in relationModel
        resultModel.add(JenaUtil.getExpandedResource(
            relationInResourceModel, 3, true));

        resultModel.add(itemModel);

        Resource item = (Resource) targetResource.inModel(resultModel);
        addMissingSummaries(item);
        addCommentCount(item);

        /*
         * Util.getExpandedResource(relation.getTarget(),
         */
        ResIterator aggregatorIter = model.listSubjectsWithProperty(
            AGGREGATOR.aggregated, relation.getTarget());
        if (aggregatorIter.hasNext()) {
          resultModel.add(JenaUtil.getExpandedResource(aggregatorIter
              .nextResource(), 2, true));
        }

View Full Code Here

Examples of org.xdoclet.plugin.ejb.Relation

                            }

                            // XXX: Todo, if we have a relation found by the RelationManager, then we must have
                            // it's treatment as such, or should be ignored
                            // Maybe just check if is a EjbUtils.METADATA_METHOD_RELATION_FIELD
                            Relation relation = getRelationManager().getRelationFor(method, javaClass);

                            if ((relation != null) ||
                                    ((vTag != null) && ((vTag.getAggregate() != null) || (vTag.getCompose() != null)))) {
                                // This is a value-object relation
                                // vTag must be non-null, because we need values from it
                                if ((vTag != null) && ((vTag.getAggregate() != null) ^ (vTag.getCompose() != null))) {
                                    JavaClass relationEjb = null;
                                    Type collectionType = null;

                                    if (relation != null) {
                                        if (!method.equals(relation.getLeftMethod())) {
                                            log.debug(
                                                "Current method doesn't match relations' left method. Reversing relation");
                                            relation = relation.reverse();

                                            if (log.isDebugEnabled()) {
                                                log.debug("Reversed relation is relation=" + relation);
                                            }
                                        }

                                        if (log.isDebugEnabled()) {
                                            log.debug("Using relation information. relation=" + relation);
                                            log.debug("1# Left bean=" +
                                                ((relation.getLeftBean() != null)
                                                ? relation.getLeftBean().getFullyQualifiedName() : null));
                                            log.debug("1# Rigth bean=" +
                                                ((relation.getRightBean() != null)
                                                ? relation.getRightBean().getFullyQualifiedName() : null));
                                        }

                                        String relationEjbName = relation.getRightEJBName();
                                        relationEjb = getBeanResolver().findEjbByName(relationEjbName);
                                        collectionType = relation.getLeftMethod().getReturns();
                                    } else {
                                        log.debug("We don't have relation information for this method");
                                        Type returnType = method.getReturns();
                                        Type relationType = null;
View Full Code Here

Examples of ptolemy.kernel.Relation

                // Create the appropriate links.
                MultiCompositeActor container = (MultiCompositeActor) getContainer();

                if (container != null) {
                    String relationName = name + "Relation";
                    Relation relation = container.getRelation(relationName);

                    if (relation == null) {
                        relation = container.newRelation(relationName);

                        Port containerPort = container.getPort(name);
View Full Code Here

Examples of siena.core.Relation

          ClassInfo.getClassInfo(this.getClass()).aggregator);
  }
 
  public Model aggregate(Object aggregator, String fieldName){
    return setRelation(
        new Relation(RelationMode.AGGREGATION, aggregator, Util.getField(aggregator.getClass(), fieldName)));
  }
View Full Code Here

Examples of siena.core.Relation

   
    Class<?> clazz = obj.getClass();
    ClassInfo info = ClassInfo.getClassInfo(clazz);
   
    if(info.hasAggregator){
      Relation rel = (Relation)Util.readField(obj, info.aggregator);
      if(rel != null && rel.mode == RelationMode.AGGREGATION){
        ClassInfo parentInfo = ClassInfo.getClassInfo(rel.target.getClass());
        Key parentKey = GaeMappingUtils.makeKey(parentInfo, rel.target);
        _deleteSingle(obj, keys, parentKey, parentInfo, (Field)rel.discriminator);
      }else {
View Full Code Here

Examples of siena.core.Relation

  private <T> void _insertSingle(T obj) {
    Class<?> clazz = obj.getClass();
    ClassInfo info = ClassInfo.getClassInfo(clazz);
   
    if(info.hasAggregator){
      Relation rel = (Relation)Util.readField(obj, info.aggregator);
      if(rel != null && rel.mode == RelationMode.AGGREGATION){
        ClassInfo parentInfo = ClassInfo.getClassInfo(rel.target.getClass());
        Key parentKey = GaeMappingUtils.makeKey(parentInfo, rel.target);
        _insertSingle(obj, parentKey, rel.target, parentInfo, (Field)rel.discriminator);
      }else {
View Full Code Here

Examples of siena.core.Relation

    for(Object obj:objects){
      Class<?> clazz = obj.getClass();
      ClassInfo info = ClassInfo.getClassInfo(clazz);
     
      if(info.hasAggregator){
        Relation rel = (Relation)Util.readField(obj, info.aggregator);
        if(rel != null && rel.mode == RelationMode.AGGREGATION){
          ClassInfo parentInfo = ClassInfo.getClassInfo(rel.target.getClass());
          Key parentKey = GaeMappingUtils.makeKey(parentInfo, rel.target);
          _insertAddEntity(entities, obj, info, parentKey, parentInfo, (Field)rel.discriminator);
        }else {
View Full Code Here

Examples of siena.core.Relation

  public void update(Object obj) {
    Class<?> clazz = obj.getClass();
    ClassInfo info = ClassInfo.getClassInfo(clazz);
   
    if(info.hasAggregator){
      Relation rel = (Relation)Util.readField(obj, info.aggregator);
      if(rel != null && rel.mode == RelationMode.AGGREGATION){
        ClassInfo parentInfo = ClassInfo.getClassInfo(rel.target.getClass());
        Key parentKey = GaeMappingUtils.makeKey(parentInfo, rel.target);
        if(!info.hasAggregatedFields && !info.hasOwnedFields){
          _updateSimple(obj, info, parentKey, parentInfo, (Field)rel.discriminator);
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.