<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 02/10/2014 01:28 AM, Thomas Fr&uuml;hbeck
      wrote:<br>
    </div>
    <blockquote cite="mid:52F81D3C.20106@aon.at" type="cite">
      <pre wrap="">Hi,
I wanted to work with AngularJS scaffold in Forge and ask for your help.

With Forge2, I did not find the way to install the angularjs-scaffold-x 
as addon/plugin.
Is there some guidance available on how to use oldstyle plugins as addons?

Stepping back to Forge 1.4 I successfully created a simple parent/child 
application.
On deployment on Wildfly 8.0.0 CR1 I found following issues:

Setup: I created a parent and then a child, the child referencing the 
parent.

Issue 1:
  - w/o any modifications I got a StackOverflowError in 
org.codehaus.jackson.map.ser.BeanSerializer because infinite loop 
between parent/child</pre>
    </blockquote>
    Hey ! Vineet will certainly give you the right answer but&nbsp; which
    strategy option did you use to generate your REST endpoint ? You
    have to make sure to use "--strategy ROOT_AND_NESTED_DTO" this way
    your relations will be managed well.<br>
    i.e : "
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 13px; margin: 15px 0px; background-color: rgb(248, 248, 248); border: 1px solid rgb(221, 221, 221); line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; color: rgb(51, 51, 51); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre!
 ; word-wra
p: normal; background-position: initial initial; background-repeat: initial initial;">rest endpoint-from-entity --contentType application/json org.jboss.aerogear.judconcricket.model.* --strategy ROOT_AND_NESTED_DTO 

</code></pre>
    <blockquote cite="mid:52F81D3C.20106@aon.at" type="cite">
      <pre wrap="">

My solution was to:
    - import org.codehaus.jackson/jackson-jaxrs maven dependency 
(because this is, what Wildfly seems to use per default)
    - add @JsonManagedReference/@JsonBackReference on the 
parent.children and child.parent properties resp.

Is there some simpler/more obvious fix for the problem?

In Fasterxml Jackson 2.x there is a @JsonIdentityInfo, could this be a 
way to solve the issue?
I seem to be unable to activate Fasterxml.Jackson on Wildfly :-/

Issue 2:
  - by above @JsonBackReference the child.parent property was not 
serialized and so the reference did not show up as selected in the 
parents &lt;select&gt; options

My solution was to rewrite the EditChildController to check for 
parent.id from the parents side (because child.parent is empty):

                     for (var idx=0; idx &lt; item.children.length; idx++) {
                         if (item.children[idx].id === $scope.child.id) {
                             $scope.parentSelection = labelObject;
                             $scope.child.parent = wrappedObject;
                         }
                     }

Original code:
                     if($scope.child.parent &amp;&amp; item.id == 
$scope.child.parent.id) {
                         $scope.parentSelection = labelObject;
                         $scope.child.parent = wrappedObject;
                         self.original.parent = $scope.child.parent;
                     }

Again I ask for your expertise, if this is a problem I introduced by 
misusing @JsonBackReference or if this needs a fix in the scaffold.

Thank you for your great work on Forge and this incredible AngularJS 
plugin :-)

Thomas
_______________________________________________
forge-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/forge-dev">https://lists.jboss.org/mailman/listinfo/forge-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>