PDA

View Full Version : What is the role of the metadata directory?



Mr_Rainbow
8 Nov 2011, 7:57 AM
What is the role for the .metadata directory? I moved a project to a new location on my disk and opened it but there was nothing in the Designer canvas or Project Inspector. I moved it back and reopened and the project was restored. Then I moved the .metadata directory and had the same experience.
Is the .metadata a critical resource? If so, that arrangement is a major drawback to maintainability and portability.
I will need portability of the project files, and would hope that they have all the data necessary to describe the design.

Phil.Strong
8 Nov 2011, 3:03 PM
Really good question.

Typically I'd suggest that each project sit in it's own unique folder and move this entire folder if you plan to 'move' it. This way all resources including .metadata/ comes along. I believe the save as functionality should also do the trick.

The .metadata/ directory is highly critical. This is what Designer uses to recreate your views and stores.
The app/ directory (which you can rename in application config) is where all of your implementation code goes. You should be able to run the application from here. In fact the new preview (not done yet) will simply open your favorite browser and point to the designer.html file that's created here.

As we continue to build out things like controllers, models, etc ... you'll see the app/ directory grow as well and embody the true MVC conventions.

Hope this helps.

FPXdeveloper_4
17 Feb 2012, 12:37 PM
If a project is checked into source control (e.g. subversion) does the .metadata folder need to be checked in?

The reason I ask is that it seems to change a lot. If I expand or collapse a tree in the Project Inspector, it seems to save that state in the designer. Other devs on my project don't need updates every time such trivial things are changed. However, it seems like from the previous comments, I can't ignore it either. Perhaps it can be checked in once and then ignored except for new files?

aconran
17 Feb 2012, 3:17 PM
The metadata directory is required for a properly functioning project. This is where we store all the metadata about configuration changes etc.

You do make a valid point in regard to the tree node expanded/collapsed state. We should probably break that out into its own separate file to avoid this issue. All other changes are critical to checking into your source control.

Phil.Strong
21 Feb 2012, 7:45 AM
Perhaps we should be storing "trivial" settings in local storage or a separate file that can be ignored by source control?

FPXdeveloper_4
23 Feb 2012, 3:35 PM
Yeah, that sounds about right.

Another issue seems to be that sometimes deleting a class level component out of Designer does not delete the file under .metadata/view even though it does delete the file under app/view. Then when I re-open Designer, it recreates the class that had been deleted.

aconran
23 Feb 2012, 4:04 PM
Another issue seems to be that sometimes deleting a class level component out of Designer does not delete the file under .metadata/view even though it does delete the file under app/view. Then when I re-open Designer, it recreates the class that had been deleted.

Deleting the class via the designer or deleting it via the filesystem? if deleting via the designer and you know how to reproduce, please file a separate bug report

badgerb1
24 Feb 2012, 6:03 AM
I've actually noticed the deleting and reappearing components quite a few times as well. I cannot reproduce reliably as of yet, but basically I had just deleted a couple of views and every now and then they reappear when restarting designer. I've now deleted the metadata files for them so I don't think it will occur again.

Thanks
Bob

aconran
24 Feb 2012, 8:50 AM
Thanks for the report. If you can determine the conditions that make it occur, please let us know.

Phil.Strong
24 Feb 2012, 9:24 AM
Yes steps to reproduce would be greatly appreciated.

hotdp
24 Feb 2012, 11:36 AM
Hi,
Something similar happend to me today.
I had a model, I renamed the model. Pressed ctrl+z so the name was the old one. Wondered why the "new" model (name) was still selected by the stores? When it was not pressent in the Designer? Then submitted to SVN and saw that the Model file that was no longer present was comitted? I can still select the Model in the Designer but it is not visible anymore..

CaliLuke
25 Feb 2012, 9:11 AM
Something similar happened to me too, I think we might have introduced a bug somewhere but we are not able to reproduce it reliably.

If you figure out what caused it, please file a bug report.