Examples of Relationship


Examples of org.apache.tuscany.das.rdb.config.Relationship

    if (metadata.hasMappingModel()) {
      MappingWrapper wrapper = new MappingWrapper(metadata.getMapping());
      Iterator i = metadata.getRelationships().iterator();
      while (i.hasNext()) {
        Relationship r = (Relationship) i.next();

        Type parent = rootType.getProperty(
            wrapper.getTablePropertyName(r.getPrimaryKeyTable())).getType();
        Type child = rootType.getProperty(
            wrapper.getTablePropertyName(r.getForeignKeyTable())).getType();
        if (parent == null) {
          throw new RuntimeException("The parent table ("
              + r.getPrimaryKeyTable() + ") in relationship "
              + r.getName()
              + " was not found in the mapping information.");
        } else if (child == null) {
          throw new RuntimeException("The child table ("
              + r.getForeignKeyTable() + ") in relationship "
              + r.getName()
              + " was not found in the mapping information.");
        }

      //  ReferenceImpl ref = refMaker.createReference(r, parent, child); 
       
        Property parentProp = SDOUtil.createProperty(parent, r.getName(), child)
        Property childProp = SDOUtil.createProperty(child, r.getName() + "_opposite", parent);
        SDOUtil.setOpposite(parentProp, childProp);
        SDOUtil.setOpposite(childProp, parentProp);
        SDOUtil.setMany(parentProp, r.isMany());
       
               

      }
View Full Code Here

Examples of org.boco.seamwebappgen.info.Relationship

    }

    // Inserisce gli attributi provenienti da relazioni
    for (int i = 0; i < bean.getRelationships().size(); i++)
    {
      Relationship rel = bean.getRelationships().get(i);

      if (rel.isUsed() && !rel.isMasterDetail())
      {
        CodeChunk codeChunk = null;

        //if ( infoReader.BeanCrudInPopUp(rel.getToBeanName()) )
        if (!rel.isListBox() && rel.isCRUD())
        {
          dynamicMenus += "<a4j:region>\r\n";
          dynamicMenus += "<rich:contextMenu attached=\"false\" id=\"menu" + rel.getName() + "\" submitMode=\"ajax\" >\r\n";

          dynamicMenus += "\t<rich:menuItem ajaxSingle=\"true\" value=\"#{msgs.list_" + rel.getToBeanName() + "_display}\" actionListener=\"#{" + rel.getToBeanName() + "Manager.popupMenuSelectItem}\" requestDelay=\"0\" oncomplete=\"openCrudPopUp_" + rel.getName() + "('Display');\">\r\n";
          dynamicMenus += "\t\t<a4j:actionparam name=\"selectedId\" value=\"{selectedBean}\" />\r\n";
          dynamicMenus += "\t</rich:menuItem>\r\n\r\n";

          if (rel.getPopUpEdit())
          {
            dynamicMenus += "\t<rich:menuItem ajaxSingle=\"true\" value=\"#{msgs.list_" + rel.getToBeanName() + "_edit}\" actionListener=\"#{" + rel.getToBeanName() + "Manager.popupMenuSelectItem}\" requestDelay=\"0\" oncomplete=\"openCrudPopUp_" + rel.getName() + "('Edit');\" rendered=\"#{(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='CREATE') or (" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT')}\" >\r\n";
            dynamicMenus += "\t\t<a4j:actionparam name=\"selectedId\" value=\"{selectedBean}\" />\r\n";
            dynamicMenus += "\t</rich:menuItem>\r\n\r\n";
          }

          if (rel.getPopUpDelete())
          {
            dynamicMenus += "\t<rich:menuItem ajaxSingle=\"true\" value=\"#{msgs.list_" + rel.getToBeanName() + "_delete}\" actionListener=\"#{" + rel.getToBeanName() + "Manager.popupMenuSelectItem}\" requestDelay=\"0\" oncomplete=\"openCrudPopUp_" + rel.getName() + "('Delete');\" rendered=\"#{(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='CREATE') or (" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT')}\" >\r\n";
            dynamicMenus += "\t\t<a4j:actionparam name=\"selectedId\" value=\"{selectedBean}\" />\r\n";
            dynamicMenus += "\t</rich:menuItem>\r\n\r\n";
          }

          dynamicMenus += "</rich:contextMenu>\r\n";
          dynamicMenus += "</a4j:region>\r\n";
        }

        if (!rel.isToMany())
        {
          // Relazione :1
          if (rel.isListBox())
          {
            // Relazione :1 implementata come ListBox
            codeChunk = insertSingleSelectionListBox2Form(sourceDir, bean, rel, true, false);
          }
          else
          {
            // Relazione :1 implementata come PopUp
            codeChunk = insertSingleSelectionPopUp2Form(sourceDir, bean, rel, inPopUp);
            if (rel.isRequired())
              updatePopUpRelationships += "\tupdatePopUpRelationships(\"" + Utils.makeFirstLetterLowerCase(bean.getName()) + "_" + rel.getName() + "\");\r\n";
            else
              updatePopUpRelationships += "";
          }
        }
        else
        {
          // Relazione :N
          if (rel.isListBox())
          {
            // Relazione :N implementata come ListBox
            codeChunk = insertMultipleSelectionListBox2Form(bean, rel, true, false);
          }
          else
          {
            // Relazione :N implementata come PopUp
            codeChunk = insertMultipleSelectionPopUp2Form(sourceDir, bean, rel, inPopUp);
            if (rel.isRequired())
              updatePopUpRelationships += "\tupdatePopUpRelationships(\"" + Utils.makeFirstLetterLowerCase(bean.getName()) + "_" + rel.getName() + "\");\r\n";
            else
              updatePopUpRelationships += "";
          }
        }

        codeChunk.setOrder(rel.getOrderInForm());
        codeChunks.add(codeChunk);
      }

      /** Relazioni master-detail in cui nel detail viene inserito anche una popup per la gestione del master **/
      if (rel.isUsed() && rel.isMasterDetail() && rel.getOrderInForm() != 0)
      {
        CodeChunk codeChunk = null;

        if (!rel.isToMany())
        {
          // Relazione :1 implementata come PopUp
          codeChunk = insertSingleSelectionPopUp2Form(sourceDir, bean, rel, inPopUp);
          if (rel.isRequired())
            updatePopUpRelationships += "\tupdatePopUpRelationships(\"" + Utils.makeFirstLetterLowerCase(bean.getName()) + "_" + rel.getName() + "\");\r\n";
          else
            updatePopUpRelationships += "";
        }
        else
        {
          // Relazione :N implementata come PopUp
          codeChunk = insertMultipleSelectionPopUp2Form(sourceDir, bean, rel, inPopUp);
          if (rel.isRequired())
            updatePopUpRelationships += "\tupdatePopUpRelationships(\"" + Utils.makeFirstLetterLowerCase(bean.getName()) + "_" + rel.getName() + "\");\r\n";
          else
            updatePopUpRelationships += "";
        }

        codeChunk.setOrder(rel.getOrderInForm());
        codeChunks.add(codeChunk);
      }

    }

    /** Predispone i Manager necessari per le chiamate remoting * */
    relatedManagers += bean.getName() + "Manager";

    for (int i = 0; i < bean.getRelationships().size(); i++)
    {
      Relationship rel = bean.getRelationships().get(i);

      if (rel.isUsed())
      {
        relatedManagers += "&" + rel.getToBeanName() + "Manager";
      }
    }

    /** Ordinamento dei chunck  **/

    CodeChunk chunks[] = codeChunks.toArray(new CodeChunk[0]);

    Arrays.sort(chunks, new CodeChunkComparator());

    //    for (int i = 0; i < chunks.length; i++)
    //    {
    //      javaScript += chunks[i].getJavascriptCode();
    //      rows += chunks[i].getHtmlCode();
    //    }

    Vector<CodeChunk> chunkVector = new Vector<CodeChunk>(java.util.Arrays.asList(chunks));

    /** Generazione dei grouppi di attributi **/
    for (int i = 0; i < bean.getFormFieldsGroups().size(); i++)
    {
      FormFieldsGroup group = bean.getFormFieldsGroups().get(i);

      CodeChunk start = new CodeChunk(group.getFromFieldOrder());
      start.addHtmlCode("\r\n\r\n<!-- START GROUP: " + group.getTitle() + "  -->\r\n");
      start.addHtmlCode("<rich:panel header=\"" + group.getTitle() + "\" rendered=\"#{");

      start.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='CREATE'");
      if (!group.getShowOnCreateIf().equals(""))
        start.addHtmlCode(" and " + group.getShowOnCreateIf());
      start.addHtmlCode(")");

      start.addHtmlCode(" or ");

      start.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT'");
      if (!group.getShowOnEditIf().equals(""))
        start.addHtmlCode(" and " + group.getShowOnEditIf());
      start.addHtmlCode(")");

      start.addHtmlCode(" or ");

      start.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY'");
      if (!group.getShowOnDisplayIf().equals(""))
        start.addHtmlCode(" and " + group.getShowOnDisplayIf());
      start.addHtmlCode(")");

      start.addHtmlCode(" or ");

      start.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'");
      if (!group.getShowOnDeleteIf().equals(""))
        start.addHtmlCode(" and " + group.getShowOnDeleteIf());
      start.addHtmlCode(")");

      start.addHtmlCode("}\" >\r\n\r\n");
      start.addHtmlCode("<table width=\"100%\">\r\n");

      int idx = getChunkIndex(chunkVector, start);

      chunkVector.add(idx, start);

      CodeChunk end = new CodeChunk(group.getToFieldOrder());

      end.addHtmlCode("</table>\r\n");
      end.addHtmlCode("\r\n\r\n</rich:panel>\r\n");
      //end.addHtmlCode("<tr:spacer height=\"25\" />\r\n");
      end.addHtmlCode("<!-- END GROUP: " + group.getTitle() + "  -->\r\n\r\n");

      idx = getChunkIndex(chunkVector, end);

      chunkVector.add(idx + 1, end);
    }

    /** Finalmente scrive i chunk nel tag che viene sostituito nel template **/

    for (int i = 0; i < chunkVector.size(); i++)
    {
      javaScript += chunkVector.get(i).getJavascriptCode();
      rows += chunkVector.get(i).getHtmlCode();
    }

    /** Gestione dei campi FORMATTEDTEXTAREA **/

    if (!textAreaIds.equals(""))
    {
      String HtmlEditorJavascriptTemplate = "." + File.separator + "templates" + File.separator + "HtmlEditorJavascript.js";

      HashMap<String, String> tags = new HashMap<String, String>();

      tags.put("@TextAreaIds", textAreaIds);

      javascriptHtmlEditor = Utils.SeamReplaceTag2String(tags, null, null, HtmlEditorJavascriptTemplate);
    }

    if (bean.getPrintMenuConditionInForm().equals(""))
      printButton = "\t\t<h:commandLink immediate=\"true\" value=\"#{msgs.Application_print}\" action=\"/" + bean.getName() + "Print.seam\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation!='CREATE'}\" style=\"text-decoration: none; color: black\" />";
    else
      printButton = "\t\t<h:commandLink immediate=\"true\" value=\"#{msgs.Application_print}\" action=\"/" + bean.getName() + "Print.seam\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation!='CREATE' and " + bean.getPrintMenuConditionInForm() + "}\" style=\"text-decoration: none; color: black\" />";

    /** Gestione campi nascosti per CRUDInSeparatePopup **/
    if (inPopUp)
    {
      Vector<Relationship> relationships2ThisBean = infoReader.getAllRelationship2ThisBean(bean.getName());

      for (int r = 0; r < relationships2ThisBean.size(); r++)
      {
        Relationship rel = relationships2ThisBean.get(r);

        Bean fromBean = infoReader.getBean(rel.getFromBeanName());

        String tmp = generatePopUpJavascriptFunctionsInPopup(fromBean).replace("startup", "loadHiddenFields").replace("\tdocument.forms[\"form\"].elements[\"form:", "\tdocument.forms[\"form\"].elements[\"form:" + rel.getFromBeanName());
        //        tmp += "\r\n"+generatePopUpJavascriptFunctionsInPopup(fromBean).replace("startup", "loadHiddenFields");

        if (javaScript.contains("loadHiddenFields"))
        {
          tmp = tmp.replace("function loadHiddenFields()", "");
          tmp = tmp.replace("{", "");

          javaScript = javaScript.replace("}", "\r\n" + tmp);
        }
        else
        {
          javaScript += tmp;
        }

        for (int i = 0; i < fromBean.getAttributes().size(); i++)
        {
          Attribute attr = fromBean.getAttributes().get(i);

          if (!attr.isKey() && (attr.getImplementationType() != AttributeImplementationType.HIDEINFORM) && (attr.getImplementationType() != AttributeImplementationType.READONLY))
          {
            String tmp1 = insertAttribute2Form(attr, fromBean.getName(), false).replace("id=\"", "id=\"" + rel.getFromBeanName()) + "\r\n";

            if (!hiddenAttributes.contains(tmp1))
              hiddenAttributes += tmp1;
          }
        }

        for (int i = 0; i < fromBean.getRelationships().size(); i++)
        {
          Relationship relationship = fromBean.getRelationships().get(i);

          if (relationship.isUsed() && relationship.isListBox())
          {
            if (relationship.isToMany())
            {
              String tmp1 = insertMultipleSelectionListBox2Form(fromBean, relationship, false, false).getHtmlCode().replace("id=\"", "id=\"" + rel.getFromBeanName());

              tmp1 = tmp1.replace(fromBean.getName() + "Manager.getCallingBeanName()", bean.getName() + "Manager.getCallingBeanName()");

View Full Code Here

Examples of org.codehaus.enunciate.samples.genealogy.data.Relationship

      throw new OutsideException("outside message");
    }
   
    ArrayList<Relationship> list = new ArrayList<Relationship>();
    for (int i = 0; i < 3; i++) {
      Relationship relationship = new Relationship();
      relationship.setId(String.valueOf(i));
      list.add(relationship);
    }
    return list;
  }
View Full Code Here

Examples of org.codehaus.enunciate.samples.genealogy.jaxws_client.data.Relationship

    }

    RelationshipService relationshipService = new RelationshipServiceImpl("http://localhost:" + port + "/" + context + "/soap-services/RelationshipServiceService");
    List list = relationshipService.getRelationships("someid");
    for (int i = 0; i < list.size(); i++) {
      Relationship relationship = (Relationship) list.get(i);
      Assert.assertEquals(String.valueOf(i), relationship.getId());
    }

    try {
      relationshipService.getRelationships("throw");
      fail("Should have thrown the relationship service exception, even though it wasn't annotated with @WebFault.");
View Full Code Here

Examples of org.docx4j.relationships.Relationship

      afiPart.setBinaryData(r.getBytes("UTF-8"));
 
      afiPart.setAltChunkType(AltChunkType.Xml); // Flat OPC XML
     
     
      Relationship altChunkRel =sourcePart.addTargetPart(afiPart);
     
      // now that its attached to the package ..
      afiPart.registerInContentTypeManager();
     
 
      CTAltChunk ac = Context.getWmlObjectFactory()
          .createCTAltChunk();
      ac.setId(altChunkRel.getId());

      // This setting makes no difference in that the altChunk
      // still won't use the style from the containing docx
      // if it isn't in the styles part in the altChunk!
     
View Full Code Here

Examples of org.eclipse.bpmn2.Relationship

    }
   
    private Scenario getDefaultScenario(Definitions def) {
      if(def.getRelationships() != null && def.getRelationships().size() > 0) {
          // current support for single relationship
          Relationship relationship = def.getRelationships().get(0);
          for(ExtensionAttributeValue extattrval : relationship.getExtensionValues()) {
                FeatureMap extensionElements = extattrval.getValue();
                @SuppressWarnings("unchecked")
                List<BPSimDataType> bpsimExtension = (List<BPSimDataType>) extensionElements.get(BpsimPackage.Literals.DOCUMENT_ROOT__BP_SIM_DATA, true);
                if(bpsimExtension != null && bpsimExtension.size() > 0) {
                    BPSimDataType bpmsim = bpsimExtension.get(0);
View Full Code Here

Examples of org.formulacompiler.spreadsheet.internal.excel.xlsx.Relationship

  {
    writeStartElement( XMLConstants.PackageRelationships.RELATIONSHIPS );

    final int size = _relationships.size();
    for (int i = 0; i != size; i++) {
      final Relationship relationship = _relationships.get( i );
      writeStartElement( XMLConstants.PackageRelationships.RELATIONSHIP );
      writeAttribute( XMLConstants.PackageRelationships.ID, "rId" + String.valueOf( i + 1 ) );
      writeAttribute( XMLConstants.PackageRelationships.TYPE, relationship.getType() );
      writeAttribute( XMLConstants.PackageRelationships.TARGET, relationship.getTarget( this.root ) );
      writeEndElement( XMLConstants.PackageRelationships.RELATIONSHIP );
    }

    writeEndElement( XMLConstants.PackageRelationships.RELATIONSHIPS );
  }
View Full Code Here

Examples of org.gedcomx.conclusion.Relationship

    Family dqFamily = gedcom.getFamilies().get(0);

    mapper.toRelationship(dqFamily, gedcom, result);
    assertEquals(result.getRelationships().size(), 5);

    Relationship relCouple = testRelationship(0, RelationshipType.Couple, "I1", "I11", 1);
    assertSize(relCouple.getSources(), 1);
    assertSize(relCouple.getNotes(), 0);

    testRelationship(1, RelationshipType.ParentChild, "I1", "I2", 0);
    testRelationship(2, RelationshipType.ParentChild, "I11", "I2", 0);
    testRelationship(3, RelationshipType.ParentChild, "I1", "I8", 0);
    testRelationship(4, RelationshipType.ParentChild, "I11", "I8", 0);
View Full Code Here

Examples of org.kite9.diagram.builders.krmodel.Relationship

          }

          if (fromEl == null)
            return;

          Relationship activeVerb = verb.getActiveRelationship();
          boolean arrowPreExists = ii.returnExisting(sr) instanceof Arrow;
         
          DiagramElement arrowEl = ii.returnConnectionBody(cont, sr,
              (String) activeVerb.getObjectForAlias());
          String fromLabel = getLabel(subject, from, ii);
          TextLine fromLabelTL = fromLabel.length() == 0 ? null
              : new TextLine(fromLabel);
          String toLabel = getLabel(object, to, ii);
          TextLine toLabelTL = toLabel.length() == 0 ? null
              : new TextLine(toLabel);

          Direction direction = d == null ? activeVerb.getDirection()
              : d;
          if (verb.getType() == RelationshipType.PASSIVE) {
            ii.returnConnection(toEl, arrowEl, or, toLabelTL, null, false, direction);
            if (!arrowPreExists) {
              ii.returnConnection(arrowEl, fromEl, null, null, fromLabelTL, true, direction);
View Full Code Here

Examples of org.mortbay.component.Container.Relationship

            {
                Log.debug("Unregister {}", r);
                Iterator iter = new ArrayList(r).iterator();
                while (iter.hasNext())
                {
                    Relationship rel = (Relationship)iter.next();
                    rel.getContainer().update(rel.getParent(),rel.getChild(),null,rel.getRelationship(),true);
                }
            }
           
            try
            {
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.