PDA

View Full Version : [FIXED] Allow create Sencha App in WebContent



ssamayoa
3 Nov 2015, 12:11 PM
A good feature would be that you can create Sencha App in WebContent folder, instead of blocking because the folder is not empty show a warning and ask to the developer if continue or not.

Regards.

firefoxSafari
3 Nov 2015, 1:50 PM
I couldn't get create new Ext JS App into an existing dynamic web project to work well, either. I had a slightly different problem, though. I entered these settings.

53543

I expected a new folder called MyApp under WebContent, but what I got instead was a new folder called WebContentMyApp. I tried a few other variations, but couldn't get it to work as expected. Never got an error message, but kept getting oddly named folders.

It would also be good if the docs covered this specific scenario - generating a new Ext JS app into an existing project - so we would know the expected behavior.

Chris.OBrien
3 Nov 2015, 9:54 PM
A good feature would be that you can create Sencha App in WebContent folder, instead of blocking because the folder is not empty show a warning and ask to the developer if continue or not.

It sounds like you are potentially trying to create a "New Ext JS App Project" in an existing folder. You should use the "New Ext JS App". Unfortunately, you'll also run into the problem that firefoxSafari has below:



I expected a new folder called MyApp under WebContent, but what I got instead was a new folder called WebContentMyApp. I tried a few other variations, but couldn't get it to work as expected. Never got an error message, but kept getting oddly named folders.

This is unfortunately a defect that we recently discovered as well, and is already fixed for our next release. It should create it as "MyApp" under the WebContent folder, but it ends up merging the folder and app name together.

As a workaround, I would recommend you create a folder under WebContent, such as "app". Then create your apps inside this folder. The app's classes will be named properly, but they won't have the appropriate parent folder.

I would recommend adding your new application's Ext JS SDK folders to the project's JavaScript exclusion path, otherwise Eclipse will attempt to validate all of the Ext JS SDK and churn for a while.

You can do this by:

Open your project's properties
Expand JavaScript, select "Include Path"
Select the "Source" tab
Double click on the "Excluded" section and click "Add..." next to Exclusion patterns
Click Browse, and find the ext folder in your recently generated app.
This is something I'll create a ticket for to see if we can automatically add the Sencha SDKs to the excluded path when we generate the apps to prevent this extra work. Thanks again for your input.

ssamayoa
4 Nov 2015, 4:47 AM
It sounds like you are potentially trying to create a "New Ext JS App Project"

Nope, app.

As you may know eclipse web project puts web assets in WebContent folder so the Sencha app should be there but you cannot create there.

Me bad, I tried several ways to fool the plugin and one of them told me that the folder wasn't empty.

The bottom line is that the feature is to allow the creation of the app in that folder and share it with java's web application artifacts (WEB-INF, other htlm files, etc).

Regards.

Chris.OBrien
4 Nov 2015, 4:59 AM
Nope, app.

As you may know eclipse web project puts web assets in WebContent folder so the Sencha app should be there but you cannot create there.

Me bad, I tried several ways to fool the plugin and one of them told me that the folder wasn't empty.

The bottom line is that the feature is to allow the creation of the app in that folder and share it with java's web application artifacts (WEB-INF, other htlm files, etc).[/FONT][/COLOR]

I was able to create an app in the WebContent folder last night without any issues.

Can you give the exact steps used to recreate the instance when it says "folder isn't empty"?
Can you take a screenshot of the dialog when it says folder not empty?
What type of project is the parent project?

Thanks

ssamayoa
4 Nov 2015, 5:02 AM
I mean DIRECTLY in WebContent not in sub directory inside so when you run the app the container run ExtJS's index page.

Regards.

Chris.OBrien
4 Nov 2015, 5:08 AM
I mean DIRECTLY in WebContent not in sub directory inside so when you run the app the container run ExtJS's index page.

Regards.

Ah ok, you mean you want the app to be created inside WebContent with no subfolder for the application itself. Thanks for clarifying.

We could potentially have a checkbox option in the future which is "Create folder for app" and if that is not checked, it would just put the app in the folder you have selected without creating a new folder.

I'll create a ticket for this for future consideration.

In the meantime, you can manually create your project with Sencha Cmd:


sencha -sdk /path/to/sdk generate app --theme-name theme-name --name appName --path /path/to/your/WebContent

plunavat
14 Nov 2015, 3:03 AM
Hello,

I want to create a dynamic web project and integrate EXTJS. What is the right way to do it
1. create sencha workspace, then create dynamic web project inside workspace and then create app inside WebContent OR
2. Create dynamic web project and create app inside WebContent OR
3. create dynamic web project and app separately and then merge (I am not clear how do we do this)

Web project would run using tomcat. How can we test extjs in tomcat.
also while building final war, how we would include the minified js file..

There is no help on right way to integrating EXTJS with java web project.. If someone can guide me, it would be great

Thanks & Regards,
Pranav C Lunavat

Chris.OBrien
24 Nov 2015, 11:42 AM
Hello,

I want to create a dynamic web project and integrate EXTJS. What is the right way to do it
1. create sencha workspace, then create dynamic web project inside workspace and then create app inside WebContent OR
2. Create dynamic web project and create app inside WebContent OR
3. create dynamic web project and app separately and then merge (I am not clear how do we do this)

Web project would run using tomcat. How can we test extjs in tomcat.
also while building final war, how we would include the minified js file..

There is no help on right way to integrating EXTJS with java web project.. If someone can guide me, it would be great

Dynamic web projects can be tricky, since there isn't just one specific solution. I do believe you could do it any of the 3 ways you mention above.

I tried experimenting to see if I could get a dynamic web application going, and these are the steps I tried. This is your 2nd method from above:
Create a new Dynamic Web Project
Disable build automatically from the Project menu.
This is to stop Eclipse's JSDT from attempting to validate the Ext JS SDKs we're going to add soon. Eclipse's built in validation chokes on some of our large files and can slow down Eclipse.

Select the WebContent folder, and create a new Ext JS App.
In the current EA release, you have to create an app within a subfolder, which is what this thread was originally about.
With our upcoming GA release, you can create an app directly in the WebContent folder itself (just uncheck "Create folder for app name")

Once the project is created and indexed, right click on your Dynamic Web Project and select Properties from the bottom
Expand JavaScript on the left, and select Include Path.
Select the Source tab.
Double click on the Excluded path under your WebContent listing
Click Add... on the bottom next to the Exclusion patterns: view
Click Browse... in the new dialog
Expand your newly create app, and select the /ext/ folder within it.
Click OK, click Finish
You can now re-enable build automatically if you wish.
Right click on project, and select Run as... Run on Server and select your tomcat instance.
Go to http://localhost:8080/DynamicProjectName/AppName and use as needed
This doesn't mean this is the right way, just one potential way. This doesn't help you with including the minified js file, but you'd have to manage that with whatever build tool you might be using. Obviously, you'd want to exclude the ext SDK from being copied, and copy in what you need. There's currently nothing in our Eclipse Plugin to help manage that.

Chris.OBrien
24 Nov 2015, 12:04 PM
I mean DIRECTLY in WebContent not in sub directory inside so when you run the app the container run ExtJS's index page.

FYI, this is something we added in our upcoming GA release. There is a new checkbox, enabled by default, for "Create folder for app name".

If you uncheck that checkbox when creating a new App, it will create the app in whatever directory you have chosen, which would be the WebContent directory in this case.