|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ISiteResource
A Site resource is a resource specific to a site context.
Thus, it belongs to a site and is locally identified by a relative path in the site.
Site resources are the nodes of a tree that forms the site tree,
so every resource have a parent resource.
There are two fundamental types of site resources: container resources and leaf resources corresponding to node types in a tree.
The site resources ensure only that underlying objects are organized in a tree structure but they are not constraining in any way the type of these objects. These objects may be of any type: folder or files in a file system, users or groups in a permission system or any other type of objects that make sense in a tree structure
Underlying objects are described by an IResourceMetadata object
Any site resource may support having contents even folders and sites.
Operations on resources available through the ISiteResource API are allways synchronous operations
even if you use the ISiteOperation.ASYNCHRONOUS flag.
This flag is cleared before executing the operation to ensure synchornous execution.
IResourceMetadata| Field Summary | |
|---|---|
static int |
FILE
|
static int |
FOLDER
|
static int |
SITE
|
| Method Summary | |
|---|---|
boolean |
accept(ISiteResourceVisitor visitor,
java.lang.Object context)
Accept a visitor on this node of the resource tree |
void |
create(IResourceMetadata metadata,
IContentSource content,
org.eclipse.core.runtime.IProgressMonitor monitor,
int flags)
Create the resource underlying object using the given metadata and content. |
void |
delete(org.eclipse.core.runtime.IProgressMonitor monitor,
int flags)
Delete the underlying object if any from its store |
void |
edit(IResourceMetadata metadata,
IContentSource content,
org.eclipse.core.runtime.IProgressMonitor monitor,
int flags)
Create or modify the resource by replacing it's metadata with the given one and optionally setting its content. |
boolean |
exists()
Check whether the object underlying this handle is existing or not |
IContentSource |
getContents(org.eclipse.core.runtime.IProgressMonitor monitor,
int flags)
Get the contents under this resource. |
IResourceMetadata |
getMetadata()
Get the resource metadata. |
java.lang.String |
getName()
Get the local name of the resource in its parent. |
ISiteFolder |
getParent()
Get the parent resource. |
java.lang.String |
getPath()
The path of the resource relative to the owner site |
ISite |
getSite()
Get the owner site. |
int |
getType()
Get the resource type. |
java.lang.String |
getURI()
Get the Unique resource identifier |
void |
modify(IResourceMetadata metadata,
IContentSource content,
org.eclipse.core.runtime.IProgressMonitor monitor,
int flags)
Modify an existing resource. |
| Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
|---|
getAdapter |
| Field Detail |
|---|
static final int SITE
static final int FILE
static final int FOLDER
| Method Detail |
|---|
java.lang.String getURI()
java.lang.String getName()
ISiteFolder getParent()
ISite getSite()
java.lang.String getPath()
int getType()
boolean accept(ISiteResourceVisitor visitor,
java.lang.Object context)
visitor - the visitorcontext - a context object to be used by the visitor or null
boolean exists()
throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException - if an error occurs
IResourceMetadata getMetadata()
throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException - if an error occurs
IContentSource getContents(org.eclipse.core.runtime.IProgressMonitor monitor,
int flags)
throws org.eclipse.core.runtime.CoreException
monitor - the progress monitor to use or null if no monitoring is requiredflags - the ISiteOperation flags to use.
org.eclipse.core.runtime.CoreException - if an exception occurs
void delete(org.eclipse.core.runtime.IProgressMonitor monitor,
int flags)
throws org.eclipse.core.runtime.CoreException
monitor - the progress monitor to use or null if no ptogress monitoring is requiredflags - the ISiteOperation flags to use.
org.eclipse.core.runtime.CoreException - if the underling object is not existing or other error occured
void create(IResourceMetadata metadata,
IContentSource content,
org.eclipse.core.runtime.IProgressMonitor monitor,
int flags)
throws org.eclipse.core.runtime.CoreException
metadata - the resource metadata.content - the content to set if any or null otherwisemonitor - a progress monitor if progress monitoring is required or null otherwiseflags - the ISiteOperation flags to use.
org.eclipse.core.runtime.CoreException - if an error occurs or the resource is already existing
void modify(IResourceMetadata metadata,
IContentSource content,
org.eclipse.core.runtime.IProgressMonitor monitor,
int flags)
throws org.eclipse.core.runtime.CoreException
Be warned that doing a modify operation may change the resource type (for ex. from file to folder) so be carefull to recreate the resource instance if needed
metadata - the resource metadata. If null metadata is not changedcontent - the content to set if any or null otherwisemonitor - a progress monitor if progress monitoring is required or null otherwiseflags - the ISiteOperation flags to use.
org.eclipse.core.runtime.CoreException - if an exception occurs or if the resource is not existing
void edit(IResourceMetadata metadata,
IContentSource content,
org.eclipse.core.runtime.IProgressMonitor monitor,
int flags)
throws org.eclipse.core.runtime.CoreException
If the resource is not existing the resource will be created - in this case the
function is behaving exactly like
create(IResourceMetadata, IContentSource, IProgressMonitor, int)
so any restricitons applying to this functions applies here too.
If the resource is existing the function will modify it - in
this case the fucntion behaves exactly like the
modify(IResourceMetadata, IContentSource, IProgressMonitor, int)
so any restriction applying to this function applies here too.
metadata - the metadata to setcontent - the content to set if any or null otherwisemonitor - the progress monitor or null if no progress monitoring is requiredflags - the ISiteOperation flags to use.
org.eclipse.core.runtime.CoreException - if an exception occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||