| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en"> |
| <HEAD> |
| |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
| |
| <LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css"> |
| <TITLE> |
| Resources and the workspace |
| </TITLE> |
| |
| <link rel="stylesheet" type="text/css" HREF="../book.css"> |
| </HEAD> |
| <BODY BGCOLOR="#ffffff"> |
| <H2> |
| Resources and the workspace</H2> |
| <P > |
| The central hub for your user's data files is called a <b>workspace</b>. You can think of the platform |
| workbench as a tool that allows the user to navigate and manipulate the workspace. The resources |
| plug-in provides APIs for creating, navigating, and manipulating resources in a workspace. The workbench |
| uses these APIs to provide this functionality to the user. Your plug-in can also use these APIs.</P> |
| <P > |
| From the standpoint of a resource-based plug-in, there is exactly one workspace, and it is always open for |
| business as long as the plug-in is running. The workspace gets opened automatically when the resources |
| plug-in is activated, and closed when the platform is shut down. If your plug-in requires the resources |
| plug-in, then the resources plug-in will be started before your plug-in, and the workspace will be available to you.</P> |
| <P > |
| The workspace contains a collection of resources. From the user's perspective, there are three different types |
| of resources: <b>projects</b>, <b>folders</b>, and <b>files</b>. A project is a collection of any number of |
| files and folders. It is a container for organizing other resources that relate to a specific area. Files and |
| folders are just like files and directories in the file system. A folder contains other folders or files. |
| A file contains an arbitrary sequence of bytes. Its content is not interpreted by the platform.</P> |
| <P > |
| A workspace's resources are organized into a tree structure, with projects at the top, and folders and files |
| underneath. A special resource, the workspace root resource, serves as the root of the resource tree. |
| The workspace root is created internally when a workspace is created and exists as long as the workspace exists.</P> |
| <P > |
| A workspace can have any number of projects, each of which can be stored in |
| a different location in some file system.</P> |
| <P> |
| The workspace resource namespace is always case-sensitive and case-preserving. |
| Thus the workspace allows multiple sibling resources to exist with names that |
| differ only in case. The workspace also doesn't put any restrictions on valid characters |
| in resource names, the length of resource names, or the size of resources on disk. |
| Of course, if you store resources in a file system that is not case-sensitive, or that does |
| have restrictions on resource names, then those restrictions will show through |
| when you actually try to create and modify resources. |
| </P> |
| <H3> |
| A sample resource tree</H3> |
| <P > |
| The tree below (represented in the workbench navigator view) illustrates a typical hierarchy of resources in a |
| workspace. The (implied) root of the tree is the workspace root. The projects are immediate children of the |
| workspace root. Each node (other than the root) is one of the three kinds of resources, and each has a name that |
| is different from its siblings. </P> |
| <P > |
| <img src="images/navigator.png" alt="Navigator view with sample workspace" border="0"> |
| </P> |
| |
| <P > |
| Resource names are arbitrary strings (almost -- they must be legal file names). |
| The platform itself does not dictate resource names, nor does it specify any names with special |
| significance. (One exception is that you cannot name a project "<b>.metadata</b>" |
| since this name is used internally.) </P> |
| <P > |
| Projects contain files and folders, but not other projects. Projects and folders |
| are like directories in a file system. When you delete a project, you will |
| be asked whether you want to delete all of the files and folders that it |
| contains. Deleting a folder from a project will delete |
| the folder and all of its children. Deleting a file is analogous to deleting a file in the file system. </P> |
| |
| </BODY> |
| </HTML> |