org.eclipse.corona.repository.adapter.wp
Class WpCvsRepositoryAdapter

java.lang.Object
  extended by org.eclipse.corona.repository.adapter.wp.WpCvsRepositoryAdapter
All Implemented Interfaces:
IRepositoryAdapter, IUIRepositoryAdapter

public class WpCvsRepositoryAdapter
extends java.lang.Object
implements IUIRepositoryAdapter

The adapter class supplies methods open/close/import for repositories representing workbench projects. The class implements IUIRepositoryAdapter that supply additionally methods for determining if a repository can be opened/closed/imported. Methods of the adapter operate on workbench projects. The adapter uses CVS methods to fetch a remote resource. TODO: change project identification from name to PC-WP assignment.

Author:
cwpl-pkaczmar

Field Summary
static java.lang.String MODULE_PROPERTY
           
(package private)  RepositoryDescriptor repositoryDescriptor
           
static java.lang.String STATUS_CLOSED
           
static java.lang.String STATUS_OPENED
           
static java.lang.String STATUS_UNAVAILABLE
           
 
Fields inherited from interface org.eclipse.corona.repository.IRepositoryAdapter
ATTRIBUTE_ACCESS_TYPE, ATTRIBUTE_ADAPTER_CLASS, ATTRIBUTE_CONTENT_TYPE, ELEMENT_ADAPTER, ELEMENT_DESCRIPTOR, EXTENSION_POINT_ID
 
Constructor Summary
WpCvsRepositoryAdapter()
           
 
Method Summary
 void addResource(java.lang.Object resourceName)
          add a resource object to the repository
 void close()
          Closes a workbench project represented by a repository.
 java.lang.Object fetchResource(java.lang.Object resourceId)
          Fetches a workbench project into workbench from CVS remote repository.
 RepositoryDescriptor getDescriptor()
          get the RepositoryDescriptor Model for this repository adapter
 java.lang.String getModuleName()
          Method returns module name specified in the repository descriptor's configuration.
 java.lang.String getName()
          get the name of the repository
 java.util.Properties getProperties()
          retrieve the user or platform specific properties used by this repository adapter.
 java.lang.String getStatus()
           
 boolean isCloseActionEnabled()
          Returns true if a repository can be closed
 boolean isFetchResourceActionEnabled()
          Returns true if a repository can be fetched
 boolean isOpenActionEnabled()
          Returns true if a repository can be opened
 java.util.List listResourceIds()
          get a list of resource identifiers from the repository
 void open()
          Opens a workbench project represented by a repository.
 void removeResource(java.lang.Object resourceName)
          remove a resource object with the given resource identifier from the repository
 boolean resourceExists(java.lang.Object resourceName)
          determine whether a resource with resourceName is in Repository
 void setDescriptor(RepositoryDescriptor repoDescriptor)
          set the RepositoryDescriptor Model for this repository adapter
 void setProperties(java.util.Properties respositoryProperties)
          pass platform specific properties into a repository adapter.
 void showInView()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_OPENED

public static java.lang.String STATUS_OPENED

STATUS_UNAVAILABLE

public static java.lang.String STATUS_UNAVAILABLE

STATUS_CLOSED

public static java.lang.String STATUS_CLOSED

MODULE_PROPERTY

public static java.lang.String MODULE_PROPERTY

repositoryDescriptor

RepositoryDescriptor repositoryDescriptor
Constructor Detail

WpCvsRepositoryAdapter

public WpCvsRepositoryAdapter()
Method Detail

isCloseActionEnabled

public boolean isCloseActionEnabled()
Returns true if a repository can be closed

Specified by:
isCloseActionEnabled in interface IUIRepositoryAdapter

isFetchResourceActionEnabled

public boolean isFetchResourceActionEnabled()
Returns true if a repository can be fetched

Specified by:
isFetchResourceActionEnabled in interface IUIRepositoryAdapter

isOpenActionEnabled

public boolean isOpenActionEnabled()
Returns true if a repository can be opened

Specified by:
isOpenActionEnabled in interface IUIRepositoryAdapter

addResource

public void addResource(java.lang.Object resourceName)
Description copied from interface: IRepositoryAdapter
add a resource object to the repository

Specified by:
addResource in interface IRepositoryAdapter

close

public void close()
           throws java.lang.Exception
Closes a workbench project represented by a repository.

Specified by:
close in interface IRepositoryAdapter
Throws:
java.lang.Exception

getModuleName

public java.lang.String getModuleName()
Method returns module name specified in the repository descriptor's configuration.

Returns:
module name specified in the repository descriptor's configuration.

fetchResource

public java.lang.Object fetchResource(java.lang.Object resourceId)
Fetches a workbench project into workbench from CVS remote repository. CVS parameters are taken from connection parameters of the repository. TODO: find the correct repository configuration that corresponds to CVS

Specified by:
fetchResource in interface IRepositoryAdapter
Parameters:
resourceId - identifier of resource to be returned.
Returns:
object from the repository

getName

public java.lang.String getName()
Description copied from interface: IRepositoryAdapter
get the name of the repository

Specified by:
getName in interface IRepositoryAdapter
Returns:
name of the repository

getProperties

public java.util.Properties getProperties()
Description copied from interface: IRepositoryAdapter
retrieve the user or platform specific properties used by this repository adapter.

Specified by:
getProperties in interface IRepositoryAdapter
Returns:
properties object containing user or platform specific properties used by this repository adapter

open

public void open()
          throws java.lang.Exception
Opens a workbench project represented by a repository.

Specified by:
open in interface IRepositoryAdapter
Throws:
java.lang.Exception

removeResource

public void removeResource(java.lang.Object resourceName)
Description copied from interface: IRepositoryAdapter
remove a resource object with the given resource identifier from the repository

Specified by:
removeResource in interface IRepositoryAdapter
Parameters:
resourceName - identifier of resource to be removed from the repository.

resourceExists

public boolean resourceExists(java.lang.Object resourceName)
Description copied from interface: IRepositoryAdapter
determine whether a resource with resourceName is in Repository

Specified by:
resourceExists in interface IRepositoryAdapter
Returns:

setProperties

public void setProperties(java.util.Properties respositoryProperties)
Description copied from interface: IRepositoryAdapter
pass platform specific properties into a repository adapter. Some information need to connect to a repository may not make sense to be saved in the RepositoryDescriptor since it may be specific to a user or the platform the user is using. This method is a way to pass this type of information into a repository adater. Currently, nothing is using this method.

Specified by:
setProperties in interface IRepositoryAdapter
Parameters:
respositoryProperties - user or platform specific properties needed by a repository adapter

getDescriptor

public RepositoryDescriptor getDescriptor()
Description copied from interface: IRepositoryAdapter
get the RepositoryDescriptor Model for this repository adapter

Specified by:
getDescriptor in interface IRepositoryAdapter
Returns:
the RepositoryDescriptor Model object which holds information about connecting to the repository

setDescriptor

public void setDescriptor(RepositoryDescriptor repoDescriptor)
Description copied from interface: IRepositoryAdapter
set the RepositoryDescriptor Model for this repository adapter

Specified by:
setDescriptor in interface IRepositoryAdapter
Parameters:
repoDescriptor - the RepositoryDescriptor Model object which holds information about connecting to the repository

listResourceIds

public java.util.List listResourceIds()
Description copied from interface: IRepositoryAdapter
get a list of resource identifiers from the repository

Specified by:
listResourceIds in interface IRepositoryAdapter
Returns:
a List of Objects (must the objects inplement a specifiec interface ?)

showInView

public void showInView()
Specified by:
showInView in interface IUIRepositoryAdapter

getStatus

public java.lang.String getStatus()
Specified by:
getStatus in interface IUIRepositoryAdapter

Copyright 2006 IBM Corporation and others.
All Rights Reserved.