Importing a existing Web Application , into Eclipse - eclipse

I need to import a existing Web Application , into Eclipse .
Please see the Structure of my Web Application as shown in the below figure .
http://imageshack.us/f/220/structurek.jpg/
From Eclipse IDE , while using import What option i need to select that is should i use
Existing projects into Eclipse
Archive File
File System
please see this image
http://imageshack.us/f/850/eclipseo.jpg/

Import existing projects into Eclipse works only for projects that were created in Eclipse.
And you're definitely not dealing with an Archive File here.
Import from the File System just copies the resources but does not actually create an Eclipse project for you.
What I would advise you, is to create a new Dynamic Web Project, configuring all the required facets, and then just copy all the contents of your existing app to the WebContent folder, either by drag'n'dropping it into the Project Explorer or by using Import from the File System, overwriting all the contents.
So far, there seems to be no other way to do it in Eclipse. However you may check out the similar post. The user #RC recommends using ant task for this process, but I'm more than sure that it won't configure all the required facets for you. It may work for some simple Java projects, but surely not enough for Java EE projects.

Related

How to import ATG CRS module in eclipse and customize

I am new to ATG and i installed ATG CRS 11.2 using CIM and it is installed properly and i am able to access the site but i want to import the CRS module in eclipse and customize the existing code for my learning purpose.
I tried the ways given on net, install atg plugin and trying to import but it is not importing.
Please explain the steps to do same.
Thanks
The Oracle A-Team have an article Building Oracle ATG Commerce With Maven. They have created a sample github project which uses CRS 11.2 as the basis for the project. You should be able to import this as a Maven project within Eclipse.
Create a new Java Project in Eclipse
Using windows browser, go to the location where your Java Project is created.
Open the Java Project folder, you will find .classpath and .project files there.
Now, go to your ATG_ROOT folder, and find the folder CommerceReferenceStore/Store
Copy-paste your .project and .classpath files here.
Edit the .project file and replace the project name by CommerceReferenceStore.Store.
CRS also has some other (nested) modules. Do the same for the nested modules you want to import in eclipse.
Re-open eclipse, Go to File -> Import -> Other -> Existing Projects into your workspace.
Browse to your ATG_ROOT directory and select the Store folder
Check on "Search for Nested Projects"
It will populate a list of all the projects, which you can now import.
For customizing CRS, it is not recommended to modify the existing CRS
code. You can create a new module, and layer it on top of CRS to
customize it. For more details on creating a new module above CRS, and
doing an assemble-deploy via CIM, you can follow this article provided
below. It has 3 small parts which can get your task done!
Here is the article:
http://learnoracleatg.blogspot.in/2016/12/create-and-deploy-new-atg-module-on-local-from-scratch-part-1.html

Getting imported files from sample java program to new program

I'm trying to make a small java program revolving around Google Calendars. I've never worked with java before but I was able to get Google's sample code working. In Eclipse, I simply used Import -> Maven, and then made some small changes to the code so that it worked on my Calendar.
Ok, great, now I want to write my own code. I started a new project and imported the Google Calendar API. At the very beginning, there are several import actions:
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp;
import com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
.
.
.
It turns out that I'm missing the second and third files. How do I find these files and how to do import them to the new project?
Please note: I ultimately don't want to rely on importing the Google Calendar API or anything similar, as I will be using another non-java program to run and control this one.
Here's what I tried:
I go back to the sample code, expand Maven Dependencies and find:
google-oauth-client-jetty-1.19.0.jar
google-oauth-client-java6-1.19.0.jar
I see that these files are in:
C:\******\.m2\repository\com\google\oauth-client\google-oauth-client-jetty\1.19.0
C:\******\.m2\repository\com\google\oauth-client\google-oauth-client-java6\1.19.0
I tried to add these with Import -> Java EE -> App Client JAR file
Didn't work, do I need to change the file name or import name? Maybe these aren't the correct files anyway.
I also tried to add these by creating a lib folder in my project folder and add the JAR files directly there.
I guess from your question your project is just an Eclipse project rather than a Maven project. Obviously Maven automatically add the required jars of the dependencies stated in pom.xml for example google-oauth-client-java6-1.19.0.jar is a dependency of google-oauth-client-jetty-1.19.0.jar.
To add external jar to your project in Eclipse you need to select the project then from the Project menu select Properties. On the properties popup click on the Java Build Path, you have two options depending where the jars are stored, if you are referring to the maven .m2 directory then choose 'Add External Jars' otherwise if you added them to a lib folder in the project choose Add Jars

Importing existing JSP project to Eclipse or Net Beans

I am trying to import project from some server on my localhost.
I would prefer to import it in NetBeans, but Eclipse is also fine. I set up Tomcat server in NetBeans for now. Then I tried to create new Java Web project with existing source and then I go through the wizard, and when I should select Web pages folder, Web-inf content it says: "Web Pages folder overlaps Project folder."
But I am not sure what kind of setup should I have there. If you maybe have some advice or video tutorial, that would be awesome..
Thanks!
you can directly import it through eclipse , there is a option of importing some project , don't create a new project

Generalized Steps for configuring imported jsf project's libraries in eclipse

i have checked similar posts and have googled but could not find an eligible answer to this. When ever i import a jsf project from some other system (where its working fine) OR delete the tomcat server in eclipse and add new server back again...there are lots of tag libs and imports that go "unresolved". Such applications are often not created by me and i dont exactly know which libraries are to be added to configure and fix project in eclipse.
I want to ask, is there any general way to find out all the required libraries for any imported jsf project and then add them.
Thanks in advance.
Download the javax.faces.jar file and drop it in project's /WEB-INF/lib folder.
That's all.

How do I deploy/import war package into Netbeans

I have looked through the help documentation in netbeans 6.5.1 but cannot find anything explicit explaining how to deploy/import a war package.
I know in Eclipse, it's as easy as right clicking in the Project Explorer >> select IMPORT >> WAR FILE.
However, I still am unable to find a solution for Netbeans.
Thankyou,
Jordan
posted elsewhere, thought i might post here too.
after some googling I've found the solution and here are the steps:
(tested using apache's ode.war in NetBeans 8.0)
unzip the war file
in the unzipped folder, you will see WEB-INF/, META-INF/, etc., create a sub-folder named web in the unzipped folder.
put everything else into web (now they will be web/WEB-INF/, web/js/, ...)
go to netbeans, new project -> java web -> web application with existing sources
pretty much just press next all the way through. voilà, it's done.
I assume you don't already have an ant or maven project for your web project? If you did, you would just import a maven project or create a Web Free-Form Application and wire it up to your ant script.
I would unzip the war file, create a new web application with existing sources in netbeans and wire everything up using the wizard.
Import the war project to eclipse.
Then import the eclipse project to netbeans
If you don't have eclipse handy, just place the war file into the webapps folder of Tomcat, go to the bin folder of Tomcat and run startup. Tomcat will automatically extract the war file for you. Now go to the webapps folder and you'll find another folder there, with the same name as your war.
I couldn't find an option to import a war directly into Netbeans (strange. Perhaps someone could create this feature and submit it as a patch to Netbeans). The folder which gets extracted into the Tomcat folder can be used as the Netbeans project. It's advisable to copy it to some other folder first. Import by File > New Project > Web application with existing sources.
Eclipse has an option to export a war and include the sources with it too, so there's a chance that the source files are in the war too.