Importing Yiic-generated controller to existing NetBeans Project - netbeans

I created a controller in command prompt with 'yiic' and noticed it wasn't included in the NetBeans directory tree. So, I had to manually cut/paste the generated files and folders into the directory tree. Is there a better way of doing this?

I am using netbeans 7.0.1 and given that you generate controller in same directory it automatically adds to opened project in net beans

Related

Install IDE helper file for netbeans

I'm searching for auto complete way for Laravel 4 and found this
but i don't know how to use it , i have net beans 7.2 ,so how to install the file ?
Just put the IDE helper file somewhere in your project directory and open the project in NetBeans, it will index the file and you'll be good to go. I leave it in the root of my app directory.
I use this file: https://gist.github.com/barryvdh/5227822
I downloaded this helper (https://gist.github.com/barryvdh/5227822#) and placed it in the root directory of the laravel project folder. Restarted the netbeans. It is working for me.

"Sources directory is already netbeans project" error when opening a project from existing sources

I've installed NetBeans 6.9.1 and installed few updates for it.
Then I've created a new project from existing sources. After a few changes I've closed it. And now I am having an error, when trying to open a new project from existing sources (the same files):
Sources directory is already netbeans project (maybe only in memory).
After Googling it, I noticed it happened not only with me. But I didn't find the correct solution. I've tried to restart the IDE, I've tried to restart the PC, I've tried to reinstall NetBeans. Nothing helped.
Thank you!
I was having the same problem:
Sources directory is already NetBeans project (maybe only in memory).
Netbeans creates a folder in your project named "nbproject". Once you delete that, restart the IDE and you're good to go.
When you create a NetBeans project from existing sources, NetBeans uses the same directory to add its own files: a netbeans folder with .proj files.
Solution: delete the netbeans folder and restart the IDE. Opening a new project should now work.
Go to the folder containing your project
Delete the folder named nbproject
Restart Netbeans
Try creating your project again from the original folder
This means the project folder is already a netbeans project. So instead of adding it as a new project open it as
This happens(i believe) because netbeans tries to version control the files created or edited.
Under the project folder netbeans create a netbeans directory just delete it . This has been tested in Ubuntu. Then you can import your project if php then php using existing sources.
Click File >> Recent Projects > and you should be able to use edit it again. Hope it helps :)
On Windows at least none of these answers work (for me anyway!). I have found the only way is to copy an existing netbeans project folder in to your new project and manually edit the xml project name.
I also opened the private/private.xml and removed the open files xml just incase these caused problems.
Once I'd done this the project works as normal.
I checked the "Put NetBeans metadata in separate directory" tick and it works fine.
This is in 2. Name and Location after you choose PHP from existing source
In my case my project root directory consists ".project". This contain the XML reference of the project name.
By removing this, i am able to create a project.
Usually this happened when we copy source code of a already created project and copied in different folder and try to create a project from it. as netBeans create its folder nbproject in our project folder this folder also get copied with our source code and it give error "Sources directory is already NetBeans project (maybe only in memory)" remove this folder from you newly copied folder and voila you can create a new project.
If this is your own source code and you already have a Netbeans project folder with your source files you should just start with:
File | Open Project...
not
File | New Project ...
because the project is not new.
If it helps anyone else, I had the same problem and the solution was to reinstall NetBeans.
I had tried all sorts of fixes: Deleting the NetBeansProjects folders, checking/unchecking "Put Netbeans metadata in a separate directory", killing/restarting NetBeans, restarting the system, etc. Nothing cleared the message...except the reinstall.
The advice here about removing the nbproject directory is not quite the whole story.
What Netbeans seems to do (and we are guessing at reverse engineering here) is to look for an xml file which has opening and closing project tags in it. This it concludes is evidence of an already existing project. Now if your files have an nbproject directory there, that will contain a project.xml file which contains the said tags. So removing that will do what you want.
But, my files don't have a nbproject directory but still NetBeans tells me there is an existing project maybe in memory. The reason is: my files include a file called pom.xml and that contains the said project tags in the xml (it was created by an entirely different system). Once that xml file is removed, then NetBeans will create an html project for me importing my code.
In sum: look through any xml files in you existing code, and be wary of project tags.
This happened to me when I tried to import an Eclipse project in a brand new NetBeans 7.2.1 install on Ubuntu 12.04LTS.
I mistakenly selected the import projects from workspace (the first option in the import wizard's opening pane) on the first attempt, and it opened the project in the original Eclipse workspace path (which was on a usb stick).
From this, I then realized that I actually need the second option - import project ignoring project dependencies, which lets you specifically choose source and destination folders. After closing the project, I tried to import again with the proper option, but it didn't work.
From then on nothing I did helped - restart the IDE, move the source folder, nothing. There was no nbproject folder in the project or /var/cache in the user folder to delete (in-fact there was no nbproject folder in the whole file-system).
Since restart didn't work, I'm guessing that there is a garbage project entry somewhere which Nb reads (See Martin Frické answer above).
After googling along the lines of 'netbeans clear memory project cache' with no success, I opted to reinstall NetBeans -
sudo /usr/local/netbeans-7.2.1/uninstall
sudo ./netbeans-7.2.1-ml-javase-linux.sh
which solved it.
If you are on a Mac, press command shift G and in the box type /users and then go, next click on your user name and navigate to netbeansprojects and open it. Then delete the ones in there that are causing problems. You can then create your project.
Note: I had moved my wordpress folder to my desktop trying to figure this out, so I dropped it back into the origional location and it works fine. So if you did this, just replace the wordpress folder after deleting the problem projects from the netbeansprojects folder and its contents back to the original installation folder.
Hope this helps...:)
This is what I did to solve this error:
1) I copied a folder named "folder1" (and I called the new folder "folder2"). "folder1" was a Netbeans project so it had a folder called "nbproject" inside it.
2) When I tried to create a project out of the "folder2", Netbeans threw an error "Sources directory is already netbeans project (maybe only in memory)."
3) Inside Netbeans delete the project of "folder1". Then, delete the two folders named "nbproject" (one is inside "folder1" and the other is inside "folder2").
4) Inside Netbeans, create two new projects: one for "folder1" and another for "folder2". The error should not appear anymore.
copy an existing netbeans project folder in to your new project and manually edit the xml project name.
reinstall netbeans
copy/move all files/folders (except nbproject/ folder) to a new folder for your project, with a new name.
Try to create a new empty project; then you can copy the public_html to the new project folder and it will appear .
I faced the same issue:
Sources directory is already NetBeans project (maybe only in memory).
The solution is:
Netbeans creates a folder in your project named "nbproject". Once you
delete that, restart the IDE and you're good to go.

How to copy an eclipse dynamic web project?

I have a workspace with a dynamic web project in it. When I try to copy and paste the project into the same workspace, eclipse asks for the name of the new project, then it copies the files.
The problem I have is that when I deploy this project to the server it gets deployed with the original name and not the new name.
It looks like eclipse is not updating all the old name references when it makes the copy.
How do I make a good clean copy of an existing project?
After some more searching I found this in the eclipse bug site.
Steps To Reproduce:
create a Dynamic Web Project and call it "Project1"
copy and paste this project, in order to create another one which is a clone
of the first; in the "Paste" dialog, specifiy "Project2" as the name of the
target project (instead of "Copy of Project1")
OBSERVED BEHAVIOUR:
The context root of the target project is the same as the source project. This
could be a problem, but it can be easily updated in the project settings and/or
in the server editor (module tab).
However, even the module name is the same, while it's usually equal to the
project name. So, in Project2/.settings/org.eclipse.wst.common.component I find
the following:
This causes problems when deploying modules to the server. Moreover, the module
name can't be easily changed through the GUI from anywhere.
EXPECTED BEHAVIOUR:
The copy&paste operation should update the web module name to "Project2", just
like it happens when you rename a project.
WORKAROUND:
Make sure the module corresponding to the target project has not been added to
the server. Then, manually edit
Project2/.settings/org.eclipse.wst.common.component and change the deploy-name
attribute value of the wb-module element. Close and restart Eclipse (!!!) and
the new name will be taken. If you don't restart Eclipse, even if you edit
org.eclipse.wst.common.component from within Eclipse, WTP does not take the
change (it seems it's caching it somewhere in memory...).

How do I associate my custom ANT builder with the project instead of the Eclipse workspace?

I'd like to associate some ANT targets with my project's build in Eclipse.
No problem, I create a custom ANT builder, specify targets to run, all is well.
But then I realize that the builder information is saved in the workspace instead of the project! Why is that, and how do I fix it?
The goal is that anyone who imports the project in a new Eclipse workspace can build it without adding the builder manually. This means that I should have the builder configuration under source control, which means it should belong to the project, not the per-user workspace.
Maybe I'm just missing something?
There is a bit of confusion, it seems, because builders look like launchers, but they are stored in a different directory. Simply creating the .settings dir and copying the xml doesn't help...
When I create the .externalToolBuilders directory under .settings and copy the launcher/builder there, I get this:
Solution:
I restarted from scratch, deleted the project-specific data in the workspace directory, but left the .settings dir in the project dir. Re-created the builder/launcher, and Eclipse automatically created it in the correct place, and also added it to source control.
Indeed, your launcher (Run/Debug launchers or External Builders launchers) are saved by default in the workspace.
<workspace>\myProject\.externalToolsBuilder)
You can move that directory (.externalToolsBuilder) manually in the .settings directory of your project.
And uncheck the option "Delete configurations when associated resource is deleted" as mentioned in this SO answer.
With a full refresh of the project (or even a delete, followed by a reimport), your local version of .externalToolsBuilder should be taken into account.
For the Debug/Run launchers (not your case), you also can (since Eclipse3.4) use one of the Import wizards:
File > Import
type launch configuration, and you can import said configuration directly within your project.

ColdFusion Builder throwing an error about my open project

I am trying to open Adobe ColdFusion Builder, and it is throwing the following error:
"open project has encountered a problem"
Problems occurred opening the selected resources.
The project description file (.project) for 'dev - work' is missing.
This file contains important information about the project.
The project will not function properly until this file is restored.
How do I solve this issue?
What about ovbious steps? It looks like you accidentally deleted the Eclipse project configuration file.
Check if ''.project'' file exists in project directory. If it is missing, re-creating the project and copying the source files from the old is the way to fix it.
Also you can try to create project with same name and copy the ''.project'' file to the old one. Bu you'll need to remove this invalid project first (without deleting the source files) and import it later, because Eclipse (FBuilder) wont allow you to have two projects with same name in workspace.
if you are using developing on windows 7 platform, go to you workspace folder(not where you project is located) right click go to restore select an earlier version. it worked for me