<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/">
  <title>08 - Extending Skyway</title>
  <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_category?p_l_id=10822&amp;categoryId=10966" />
  <subtitle>Custom Steps - Configurable Generation - Code Generation Templates - Scaffolding</subtitle>
  <entry>
    <title>RE: begin-user-code</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=84794" />
    <author>
      <name>Dave Meurer</name>
    </author>
    <updated>2010-07-27T17:48:59Z</updated>
    <published>2010-07-27T17:48:59Z</published>
    <summary type="html">Ah, yes - thanks Cindy!

For others looking at this thread, the preference can be found in:

Windows &gt; Preferences &gt; Skyway &gt; Code Generation &gt; "When code errors would result from merging Java files"

=Dave</summary>
    <dc:creator>Dave Meurer</dc:creator>
    <dc:date>2010-07-27T17:48:59Z</dc:date>
  </entry>
  <entry>
    <title>RE: begin-user-code</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=84768" />
    <author>
      <name>Brian Schoenhofer</name>
    </author>
    <updated>2010-07-27T13:39:57Z</updated>
    <published>2010-07-27T13:39:57Z</published>
    <summary type="html">As Cindy said, the problem only occurs if there is a compilation error in either the custom code or the code of a java step. This may not be a problem for people with compiler-like minds but sadly I'm not one of them. 

With custom code you see any compile time problems right away but with the code of a java step you don't get the immediate feedback. Accidentally saving the file with a missing ; or a small typo will wipe out any custom code in all methods of the class.

I'll look for the preference you refer to that controls this behavior.

Thanks for you help.</summary>
    <dc:creator>Brian Schoenhofer</dc:creator>
    <dc:date>2010-07-27T13:39:57Z</dc:date>
  </entry>
  <entry>
    <title>RE: begin-user-code</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=84729" />
    <author>
      <name>Cindy Conway</name>
    </author>
    <updated>2010-07-26T19:38:59Z</updated>
    <published>2010-07-26T19:38:59Z</published>
    <summary type="html">One thing to note is that if there was a compile error on the file, the entire file may be overwritten or backed up and then re-generated.  The overwrite behavior is controlled by a workspace preference.</summary>
    <dc:creator>Cindy Conway</dc:creator>
    <dc:date>2010-07-26T19:38:59Z</dc:date>
  </entry>
  <entry>
    <title>RE: begin-user-code</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=84724" />
    <author>
      <name>Dave Meurer</name>
    </author>
    <updated>2010-07-26T18:49:50Z</updated>
    <published>2010-07-26T18:49:50Z</published>
    <summary type="html">Hi Brian,

Everything looks good in your example class.  Would you be able to reply with the reproducible steps when you see the code being overwritten?

I've just tried adding a variable to the service, enabling it as a web service, re-generating CRUD, and adding a logic step and all of those actions preserved the println I placed between those comments.

Appreciate the info!

Kind regards,
Dave</summary>
    <dc:creator>Dave Meurer</dc:creator>
    <dc:date>2010-07-26T18:49:50Z</dc:date>
  </entry>
  <entry>
    <title>begin-user-code</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=84682" />
    <author>
      <name>Brian Schoenhofer</name>
    </author>
    <updated>2010-07-23T14:32:09Z</updated>
    <published>2010-07-23T14:32:09Z</published>
    <summary type="html">The code I put in between the "begin-user-code" and "end-user-code" tags in a service class are being overwritten. I saw a previous thread mention that the Skyway-&gt;Code Generation preference Merge Generated Java should be checked and it is. What am I missing?

The class is roughly shown below.

package osms.service.webservice;

import javax.annotation.Resource;
...

/**
 * 
 * @ModelCoreReference [platform:/resource/osms/models/ca/osms/service/webservice/PasswordManagementService/.properties.srv]
 * @generated
 */
@Scope("session")
@Service("PasswordManagementService")
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
public class PasswordManagementServiceImpl implements
		PasswordManagementService, IPasswordManagementServiceServiceEndpoint {

	/**
	 * Execute 
	 * 
	 * @ModelReference [platform:/resource/osms/models/ca/osms/service/webservice/PasswordManagementService/ResetPassword/.properties.swoperation]
	 */

	@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
	public Boolean resetPassword(String userId, String password) throws java.lang.Exception {
		Boolean result = null;
		Integer rowCount = null;

		// begin-user-code
		[b]System.out.println("custom code");[/b]
		// end-user-code

		// @ModelReference [platform:/resource/osms/models/ca/osms/service/webservice/PasswordManagementService/ResetPassword/ResetPasswordAction.action]

		return result;
	}
}</summary>
    <dc:creator>Brian Schoenhofer</dc:creator>
    <dc:date>2010-07-23T14:32:09Z</dc:date>
  </entry>
  <entry>
    <title>RE: Scaffolding without Sitemesh Filter and WEB-INF\pages files...</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=83712" />
    <author>
      <name>Dave Meurer</name>
    </author>
    <updated>2010-06-15T13:44:31Z</updated>
    <published>2010-06-15T13:44:31Z</published>
    <summary type="html">Hi Sasha,

There are 2 ways to do this:

1. Double-click the Spring DSL &gt; Code Generation Tab &gt; uncheck the Web Deployment Descriptor Generate checkbox, and then scaffold, or..

2. For Professional Edition and above, create a new Template Project (New &gt; Project &gt; Skyway &gt; Template Project), and you can customize the web-xml.jet found in com.skyway.integration.java.spring.jee &gt; templates &gt; web. 

Your question does bring up a good feature request to make sitemesh an option. I'll add it to our JIRA.  Please feel free to reply with anything you would like to add to this feature request.

Kind regards,
Dave</summary>
    <dc:creator>Dave Meurer</dc:creator>
    <dc:date>2010-06-15T13:44:31Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom generation template in Skywaybuilder CE</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=83682" />
    <author>
      <name>Heflin Hogan</name>
    </author>
    <updated>2010-06-14T19:33:40Z</updated>
    <published>2010-06-14T19:33:40Z</published>
    <summary type="html">Customizing templates is not a supported feature in CE.</summary>
    <dc:creator>Heflin Hogan</dc:creator>
    <dc:date>2010-06-14T19:33:40Z</dc:date>
  </entry>
  <entry>
    <title>Scaffolding without Sitemesh Filter and WEB-INF\pages files...</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=83640" />
    <author>
      <name>Sasha Oros</name>
    </author>
    <updated>2010-06-13T00:37:06Z</updated>
    <published>2010-06-13T00:37:06Z</published>
    <summary type="html">Hi,

How can I disable automatic update of a web.xml with Sitemesh Filter info and automatic generation of jsp pages for domain objects when I do scaffolding? 
I do not need Sitemesh Filter and auto generated jsp pages in my applications as I use Ext JS. So now, each time I scaffold I need to modify web.xml.

Thanks</summary>
    <dc:creator>Sasha Oros</dc:creator>
    <dc:date>2010-06-13T00:37:06Z</dc:date>
  </entry>
  <entry>
    <title>Custom generation template in Skywaybuilder CE</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=83615" />
    <author>
      <name>szilard krucz</name>
    </author>
    <updated>2010-06-10T10:57:01Z</updated>
    <published>2010-06-10T10:57:01Z</published>
    <summary type="html">http://www.skywayperspectives.org/skywaytv/?p=93
hier is described how to change the generation templates in Skywaybuilder PE (Profesional edition). i would like to know if it is possible to change the templates in the Skywaybuilder CE (Community edition)? after all we only need to change the jet file, compile it and overwrite the old file. is there any way to change the templates in the CE?
thank you</summary>
    <dc:creator>szilard krucz</dc:creator>
    <dc:date>2010-06-10T10:57:01Z</dc:date>
  </entry>
  <entry>
    <title>RE: can not modify the generated java codes</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=79937" />
    <author>
      <name>Ade Brown</name>
    </author>
    <updated>2010-02-23T02:50:42Z</updated>
    <published>2010-02-23T02:50:42Z</published>
    <summary type="html">hi Dave
      I reboot the builder applicaiton today,now it works,I can modify the generted code.
      tks.</summary>
    <dc:creator>Ade Brown</dc:creator>
    <dc:date>2010-02-23T02:50:42Z</dc:date>
  </entry>
  <entry>
    <title>RE: can not modify the generated java codes</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=79861" />
    <author>
      <name>Dave Meurer</name>
    </author>
    <updated>2010-02-22T15:38:22Z</updated>
    <published>2010-02-22T15:38:22Z</published>
    <summary type="html">Hello,

Skyway Builder does mark the files it generates as derived.  However, you should be able to edit what's generated with no problem.  You will get warning upon the first time you try and edit this class saying:

"This file is derived. Do you really want to edit it?"

If you click No, then the file will be read-only, until you close the file and open it again.

If you click Yes, the file can be edited.

Does this help?

-Dave</summary>
    <dc:creator>Dave Meurer</dc:creator>
    <dc:date>2010-02-22T15:38:22Z</dc:date>
  </entry>
  <entry>
    <title>can not modify the generated java codes</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=79819" />
    <author>
      <name>Ade Brown</name>
    </author>
    <updated>2010-02-22T08:37:04Z</updated>
    <published>2010-02-22T08:37:04Z</published>
    <summary type="html">hi
   I am trying to change the charset of data from request,so I want to modify the controller class,but I can't.
   
   however ,The file's properties show than it is editable and derved. 

   could anyone help me?</summary>
    <dc:creator>Ade Brown</dc:creator>
    <dc:date>2010-02-22T08:37:04Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to include additional input parameters.</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=79026" />
    <author>
      <name>tony falco</name>
    </author>
    <updated>2010-02-11T15:08:13Z</updated>
    <published>2010-02-11T15:08:13Z</published>
    <summary type="html">Wow thank you very much for the thorough answer Jay.  I will try out what you suggest and report back, it certainly sounds like a proper solution.</summary>
    <dc:creator>tony falco</dc:creator>
    <dc:date>2010-02-11T15:08:13Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to include additional input parameters.</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=78977" />
    <author>
      <name>Jay Perkins</name>
    </author>
    <updated>2010-02-10T22:27:12Z</updated>
    <published>2010-02-10T22:27:12Z</published>
    <summary type="html">Hi Tony,

The behavior you are looking to implement has hit on a few limitations of the current scaffolding generation engine.  Below is a list of some of the limitations of the current scaffolding generation engine and how you can overcome them.

[b]Limitation:[/b]
The dataType attribute for inputs (and variables) does not currently handle arbitrary fully qualified java class names.  It is expecting a domain object.

[b]Solution:[/b]
Make the following changes to the org.skyway.core.generate.generator.model.AbstractVariableGenerator class:
1) Add the following constant:

public final static String JAVA_PREFIX = "java:";

2) Add the following methods:

public DataType convertToAdaptedJavaType(String projectName, String type){
	if (type == null)
		return null;
		
	if (type.startsWith(JAVA_PREFIX))
		type = type.substring(JAVA_PREFIX.length());
		
	return new DataTypeAdapter (projectName, type);
}
	
public boolean isJavaType (String typeName) {
	return typeName != null &amp;&amp; typeName.startsWith(JAVA_PREFIX);
}

3) Replace the existing getDataType(GenerationContext context) method with the following method:

protected Object getDataType(GenerationContext context){
	Object result = GroovyUtils.getObjectAttribute(context, getDescriptor().getAttribute("dataType"));
	PrimitiveType primitiveType;
	String typeText;
		
	if (result instanceof String){
		if (isJavaType((String)result))
			return convertToAdaptedJavaType(context.getProject().getName(),(String)result);
		else {
			typeText = (String)result;
			primitiveType = VariableUtils.convertToPrimitive(typeText);
			if (primitiveType == null){
				result = context.getCoreSafe(typeText);
			}else{
				result = primitiveType;
			}
		}
	}
		
	return result;
}

The functionality of the getDataType() method has been expanded to support a java type as a variable or input.  The java type must be fully qualified with a prefix of "java:" (without the surrounding quotes).

[b]Limitation:[/b]
Although the scaffolding generation engine is quite extendable, it does not currently support additions and deletions to a generation resource definition.  For example, there is no way to specify an additional input to an operation.

[b]Solution:[/b]
Although not something we would typically recommend, altering the plugin.xml in the org.skyway.core.generate plugin is probably the best course of action in your case.  Of course, you will need to merge the changes during any upgrade process in the future but at least all of the changes will be in the same plugin which will make it easier to diff and modify as needed.  That being said, go ahead and make the changes you already mentioned in previous posts.  Below is a list of changes I needed to make to get things to compile correctly.

1) Add the additional input to the save operation for the service.  Notice the specification of the fully qualified java class that you want your new input to have as its type.

&lt;input
	name="bindingresult"
	dataType="java:org.springframework.validation.BindingResult" /&gt;

2) Add the additional input to the save operation for the web controller.  Notice the specification of the fully qualified java class that you want your new input to have as its type.

&lt;input
	name="bindingresult"
	dataType="java:org.springframework.validation.BindingResult" /&gt;

3) Add the additional input in the call to the service save operation from the web controller save operation.  I included the entire invokeOperation step definition for context but I really only added the second operationInputMapping that will pass the bindingResult from the web controller save operation to the service save operation.

&lt;invokeOperation
		id="callSave"
		name="${'Call Save ' + dataType.name}"
		operation="${dataType.name + 'Service.Save' + dataType.name}"&gt;
		&lt;operationInputMapping
			inputName="${dataType.name.toLowerCase()}"
			invokeeVariable="${dataType.name.toLowerCase()}" /&gt;
		&lt;operationInputMapping
			inputName="bindingResult"
			invokeeVariable="bindingResult" /&gt;
&lt;/invokeOperation&gt;

Let me know if you have any questions or if this does not provide the result you are looking for.

Thanks,

Jay</summary>
    <dc:creator>Jay Perkins</dc:creator>
    <dc:date>2010-02-10T22:27:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to include additional input parameters.</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=78716" />
    <author>
      <name>tony falco</name>
    </author>
    <updated>2010-02-04T16:52:42Z</updated>
    <published>2010-02-04T16:52:42Z</published>
    <summary type="html">Yes I am attempting to change the plugin.xml inside the skyway project.  BUT if what you are referring to is true, that we can simply include the skyway generate project as a dependency inside my own project, how would I be able to manipulate the plugin.xml in MY project to produce the generation results I am looking for?  That does sound like a better course of action.</summary>
    <dc:creator>tony falco</dc:creator>
    <dc:date>2010-02-04T16:52:42Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to include additional input parameters.</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=78710" />
    <author>
      <name>Jay Perkins</name>
    </author>
    <updated>2010-02-04T13:23:25Z</updated>
    <published>2010-02-04T13:23:25Z</published>
    <summary type="html">Hi Tony,

Just so I am clear, is it true that you are making changes directly to the plugin.xml in the org.skyway.core.generate plugin?  You do not have a separate plugin that depends on the org.skyway.core.generate plugin where you would like to alter the scaffolding behavior, correct?

Thanks,

Jay</summary>
    <dc:creator>Jay Perkins</dc:creator>
    <dc:date>2010-02-04T13:23:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Service Model Generation</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=78687" />
    <author>
      <name>Heflin Hogan</name>
    </author>
    <updated>2010-02-03T18:34:06Z</updated>
    <published>2010-02-03T18:34:06Z</published>
    <summary type="html">Yep. Not I problem, I've moved it.</summary>
    <dc:creator>Heflin Hogan</dc:creator>
    <dc:date>2010-02-03T18:34:06Z</dc:date>
  </entry>
  <entry>
    <title>How to include additional input parameters.</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=78674" />
    <author>
      <name>tony falco</name>
    </author>
    <updated>2010-02-03T16:03:55Z</updated>
    <published>2010-02-03T16:03:55Z</published>
    <summary type="html">Hello, I am attempting to change my Service model generation by including a BindingResult (spring validation class) input with the save method. I have a plugin.xml inside the org.skyway.core.generate plugin where I think I can allow this change to occur when you trigger scaffolding. A code snippet is below. 

I know that this is where I am able to trigger the input generation. The real issue is with the "dataType" attribute, I believe my syntax is incorrect when I am trying to reach the BindingResult class. I have tried several versions but whenever the skyway instance is launched from my plugin and I trigger scaffolding, an error appears stating that it was unable to create the variable within the Service model/class.  I am also experimenting with adding a dependency with another project that contains the spring class, but I am not able to add it in that way (the project must not be a plugin project).

EDIT:  What I am attempting to add is this:  within the org.skyway.core.generate plugin project, there is an extension under the generationDefinitions that holds a save method for the service layer, and in that there is a datatype input for the save method.  I am attempting to add another input to this extension.  The name is not the problem, but the dataType has a syntax/import/include that I have not figured out.

Is there anyone who knows or has a way to reach the spring classes correctly?  Thanks.

&lt;input
name="bindingresult"
dataType="org.springframework.validation.BindingResult" /&gt;

or...

&lt;service
name="${dataType.name + 'Service'}"
parent="${dataType.parent}"&gt;
&lt;operation
	name="${'Save' + dataType.name}"&gt;
	&lt;input
		name="${dataType.name.toLowerCase()}"
		dataType="${dataType.name}" /&gt;
	&lt;input
		name="bindingresult"
		dataType="BindingResult" /&gt;</summary>
    <dc:creator>tony falco</dc:creator>
    <dc:date>2010-02-03T16:03:55Z</dc:date>
  </entry>
  <entry>
    <title>RE: Service Model Generation</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=78671" />
    <author>
      <name>tony falco</name>
    </author>
    <updated>2010-02-03T15:29:45Z</updated>
    <published>2010-02-03T15:29:45Z</published>
    <summary type="html">I think I am.  The plugin.xml I am attempting to change is inside the org.skyway.core.generate package. Should this be posted elsewhere?</summary>
    <dc:creator>tony falco</dc:creator>
    <dc:date>2010-02-03T15:29:45Z</dc:date>
  </entry>
  <entry>
    <title>RE: Service Model Generation</title>
    <link rel="alternate" href="http://www.skywayperspectives.org/portal/c/message_boards/find_message?p_l_id=10822&amp;messageId=78631" />
    <author>
      <name>Heflin Hogan</name>
    </author>
    <updated>2010-02-02T21:14:42Z</updated>
    <published>2010-02-02T21:14:42Z</published>
    <summary type="html">I'm not sure this is in the right category. Are you attempting to extend Builder?</summary>
    <dc:creator>Heflin Hogan</dc:creator>
    <dc:date>2010-02-02T21:14:42Z</dc:date>
  </entry>
</feed>

