Skip to content

Commit 81607f7

Browse files
committed
Add getting started guide for Semantic File System
Migrated from https://wiki.eclipse.org/E4/Resources/Semantic_File_System/GettingStarted
1 parent cbe2947 commit 81607f7

12 files changed

+130
-0
lines changed
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
Semantic File System GettingStarted
2+
================================================
3+
4+
Contents
5+
--------
6+
7+
* [1 Prerequisites](#Prerequisites)
8+
* [2 Creating a Semantic project](#Creating-a-Semantic-project)
9+
* [3 A short walk-through: some places to know about when working with the Semantic File System](#A-short-walk-through:-some-places-to-know-about-when-working-with-the-Semantic-File-System)
10+
* [3.1 Semantic Properties Page](#Semantic-Properties-Page)
11+
* [3.2 Team Provider menu](#Team-Provider-menu)
12+
* [3.3 Semantic File System Preference Page](#Semantic-File-System-Preference-Page)
13+
* [3.4 Semantic Content View](#Semantic-Content-View)
14+
* [3.5 Team Synchronizer UI](#Team-Synchronizer-UI)
15+
* [3.6 Remote History Page](#Remote-History-Page)
16+
* [4 The DefaultContentProvider](#The-DefaultContentProvider)
17+
* [4.1 Local File handling](#Local-File-handling)
18+
* [4.2 REST resource handling—Internet URL](#REST-resource-handling.E2.80.94Internet-URL)
19+
* [5 Using Semantic Resources outside of Semantic Projects](#Using-Semantic-Resources-outside-of-Semantic-Projects)
20+
21+
Prerequisites
22+
-------------
23+
24+
You have an Eclipse IDE with the Semantic File System plug-ins running.
25+
The required plug-ins are:
26+
27+
* org.eclipse.core.resources.semantic
28+
* org.eclipse.ui.resources.semantic
29+
30+
The IDE used for the below examples was a Helios “Eclipse IDE for RCP and RAP Developers” downloaded from [https://www.eclipse.org/downloads](https://www.eclipse.org/downloads). Other Eclipse IDE 3.5 and 3.6 versions using a 5.0 or 6.0 Java runtime should also work.
31+
32+
Creating a Semantic project
33+
---------------------------
34+
35+
Before you can start, you need to create a project located in the Semantic File System (also referred to as "Semantic Project"). Since the "Generic Project" wizard offers to do this in the UI, it can be used to do so. The wizard can be started using New -> Project..., then General -> Project:
36+
37+
 ![NewSemanticProjectWizard.jpg](https://raw.githubusercontent.com/https://raw.githubusercontent.com/eclipse-platform/eclipse.platform/docs/master/docs/images/NewSemanticProjectWizard.jpg)
38+
39+
We use "SemanticProject" both for the project name and the location. Note that you have to unselect "Default Location" and select "Semantic File System" in the "Choose file system" dropdown. After the project has been created, it must be shared with the Semantic File System Team provider. Select Team -> Share Project..., then "Semantic File System" and "Finish".
40+
41+
 ![SFSShareProjectWizard.jpg](https://raw.githubusercontent.com/https://raw.githubusercontent.com/eclipse-platform/eclipse.platform/docs/master/docs/images/SFSShareProjectWizard.jpg)
42+
43+
A short walk-through: some places to know about when working with the Semantic File System
44+
------------------------------------------------------------------------------------------
45+
46+
#### Semantic Properties Page
47+
48+
This can be reached from any Semantic Resource by opening the context menu in the project explorer and selecting Properties. On the left hand side, there should be an entry “Semantic Resource”. If you select this, you can inspect some resource properties specific to Semantic Resources, for example for the new Semantic Project:
49+
50+
![SFSDemoSFSProperties.jpg](https://raw.githubusercontent.com/https://raw.githubusercontent.com/eclipse-platform/eclipse.platform/docs/master/docs/images/SFSDemoSFSProperties.jpg)
51+
52+
By right-clicking on any entry, you can copy either the value or the key and the value into the clipboard. If you have selected more than one entry, you can copy all selected entries into the clipboard (keys and values).
53+
54+
#### Team Provider menu
55+
56+
This can also be reached from any Semantic Resource by opening the context menu and then sub-menu “Team”. The available menu entries depend on the selected resource:
57+
58+
![SFSDemosTeamMenu.jpg](https://raw.githubusercontent.com/https://raw.githubusercontent.com/eclipse-platform/eclipse.platform/docs/master/docs/images/SFSDemosTeamMenu.jpg)
59+
60+
#### Semantic File System Preference Page
61+
62+
This shows the location of the database file and the cache root which may be useful if you want to have a look at the actual data in your workspace.
63+
64+
#### Semantic Content View
65+
66+
This is a low-level view of the data in the Semantic File System database:
67+
![SFSDemosSemanticResourcesView.jpg](https://raw.githubusercontent.com/https://raw.githubusercontent.com/eclipse-platform/eclipse.platform/docs/master/docs/images/SFSDemosSemanticResourcesView.jpg)
68+
It can be reached from any Semantic Resource using Team->Show in Semantic Content View.
69+
70+
The view is refreshed automatically to reflect chnages in the Semantic File System; auto-refresh can be disabled in the view menu.
71+
72+
By right-clicking on a node, you can perform the following actions:
73+
74+
* Delete the node and it's children (if any)
75+
* Forcefully delete the node and it's children
76+
* Open the node in the Properties View
77+
* Copy the node's path into the clipboard
78+
* Open the node in a text editor (file nodes only)
79+
80+
The second option can be helpful to cleanup a corrupt SFS database.
81+
82+
When a node is opened in the Properties View, the same information is shown as described above in the section "Semantic Properties Page".
83+
84+
#### Team Synchronizer UI
85+
86+
This is currently not fully supported. Please see the description of the RemoteStoreContentProvider in [http://wiki.eclipse.org/E4/Resources/Semantic\_File\_System/Demos/Running\_SFS\_Examples](http://wiki.eclipse.org/E4/Resources/Semantic_File_System/Demos/Running_SFS_Examples) for more details.
87+
88+
#### Remote History Page
89+
90+
The generic “History” view is found under category “Team”. Depending on whether a certain content provider implements history support, it will show the remote versions for a Semantic File.
91+
92+
The DefaultContentProvider
93+
--------------------------
94+
95+
The DefaultContentProvider is used for any resources for which no specific content provider is responsible. This is necessary, since the project itself is a Semantic Resource. In other words, the DefaultContentProvider bridges the Semantic File System world and the Local File System world.
96+
In addition, the DefaultContentProvider allows some basic REST-like Resource management.
97+
98+
#### Local File handling
99+
100+
Local files are handled by the DefaultContentProvider in a transparent manner. You can create a local file in the Semantic Project by simply selecting the context menu of the project and clicking New -> File. A dialog will be shown asking for a file name. Use "localFile.txt" and hit "Finish". The new file will be shown in an editor. You can edit the file content just like with any file. A blue decorator indicates that the file is local. Still the file is a Semantic Resource (try it and check the Semantic Properties page mentioned above):
101+
102+
![SFSDemosLocalResourceProperties.jpg](https://raw.githubusercontent.com/https://raw.githubusercontent.com/eclipse-platform/eclipse.platform/docs/master/docs/images/SFSDemosLocalResourceProperties.jpg)
103+
104+
#### REST resource handling—Internet URL
105+
106+
Select the project and open the context menu. Select New... -> Other, then Semantic File System -> REST Resource. A dialog will show up requesting a name and a URL for the new resource. Enter some arbitrary name, and an existing (and accessible) URL, for example “time.html” and “[http://www.time.org”](http://www.time.org”):
107+
![SFSDemosNewURLResource.jpg](https://raw.githubusercontent.com/https://raw.githubusercontent.com/eclipse-platform/eclipse.platform/docs/master/docs/images/SFSDemosNewURLResource.jpg)
108+
109+
Open the new file with the text editor. You will see some HTML code containing a line like
110+
<title>Welcome To The WWW Clock (beta) - Wednesday 16th of December 2009 9:25:39 AM GMT</title>
111+
If you close and re-open the editor, this line will not change. However, you can retrieve the new content using "Team" -> "Synchronize with Repository" on the context menu of the new file:
112+
![SFSDemosSyncUrlFromRemote.jpg](https://raw.githubusercontent.com/https://raw.githubusercontent.com/eclipse-platform/eclipse.platform/docs/master/docs/images/SFSDemosSyncUrlFromRemote.jpg)
113+
Afterwards, the line above should have changed.
114+
The default content provider does not support editing of non-local resources, so you cannot change the content of the file.
115+
116+
Using Semantic Resources outside of Semantic Projects
117+
-----------------------------------------------------
118+
119+
It is possible to create Semantic Resources outside of Semantic Projects. Technically, this is done by creating a link to a resource in the Semantic File System. A generic UI is provided to add a REST resource using the DefaultContentProvider. You can open this UI using File->New->Other... (or CTRL-N) and then Semantic File System->REST Resource. The action can also be called from the context menu of any resource. You will see a screen asking for a parent, a name, and a URL. Depending on the context, the parent may be pre-set. Let's assume we have a "General" project called "GeneralProject" and a folder f1 from which we create the resource:
120+
121+
 ![NewRestResource.jpg](https://raw.githubusercontent.com/https://raw.githubusercontent.com/eclipse-platform/eclipse.platform/docs/master/docs/images/NewRestResource.jpg)
122+
123+
After successful completion of the wizard, the new resource will be shown as linked file under the folder and can be used just like any linked file:
124+
125+
 ![NewLinkedResource.jpg](https://raw.githubusercontent.com/https://raw.githubusercontent.com/eclipse-platform/eclipse.platform/docs/master/docs/images/NewLinkedResource.jpg)
126+
127+
It will also appear in the Semantic Content View under the same path as the linked resource:
128+
129+
 ![NewLinkedInContentView.jpg](https://raw.githubusercontent.com/https://raw.githubusercontent.com/eclipse-platform/eclipse.platform/docs/master/docs/images/NewLinkedInContentView.jpg)
130+
9.31 KB
Loading

docs/images/NewLinkedResource.jpg

11.5 KB
Loading

docs/images/NewRestResource.jpg

50 KB
Loading
34.4 KB
Loading
75.2 KB
Loading
123 KB
Loading
27.7 KB
Loading
17.1 KB
Loading
127 KB
Loading

0 commit comments

Comments
 (0)