Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.perspective.model.util
Class ISeriesNativeMemberUtil

java.lang.Object
  extended by com.ibm.etools.iseries.perspective.internal.model.util.AbstractDownloadUtil
      extended by com.ibm.etools.iseries.perspective.model.util.ISeriesNativeMemberUtil

public class ISeriesNativeMemberUtil
extends com.ibm.etools.iseries.perspective.internal.model.util.AbstractDownloadUtil

This is a utility class for creating and populating source members from remote objects. Two object models are supported, ISeriesMember objects that are RSE based objects, and AbstractISeriesNativeMember objects that are the iSeries Project based objects.


Field Summary
static String copyright
           
 
Fields inherited from class com.ibm.etools.iseries.perspective.internal.model.util.AbstractDownloadUtil
COPYRIGHT
 
Constructor Summary
ISeriesNativeMemberUtil()
           
 
Method Summary
static IFolder createMember(AbstractISeriesNativeMember iseriesNativeMember, IProgressMonitor monitor, Shell shell)
          Deprecated. method appears to be unused. Use ISeriesNativeMemberUtil#createMembers(ISeriesMember[], IProject, IProgressMonitor, Shell) instead.
static IFile createMember(String fileName, IFolder parentFolder, Properties memberProperties, IProgressMonitor monitor, Shell shell)
          Creates a new source member under the passed IFolder.
Note: This method must be run as a WorkspaceModifyOperation, so that all resource modifications are reported as one delta when operation succeeds.
static IFile createMembers(IQSYSMember[] members, IProject project, IProgressMonitor monitor, Shell shell, com.ibm.etools.iseries.perspective.internal.ui.OracleDialog conflictOracle, List errorReceiverList, com.ibm.etools.iseries.projects.internal.snapshots.Snapshot snapshot)
          Downloads an array of members from a particular source file to a given project.
 
Methods inherited from class com.ibm.etools.iseries.perspective.internal.model.util.AbstractDownloadUtil
checkMemberName, checkMemberType, checkSourceFileName, createMember, downloadMember, generateProperties, getDialogTitle, getStandardPath, getStandardPath, getStandardPath, hasStandardPath, hasStandardPath, makeSourceFileFolder, makeSourceFileFolder, queryDownload, queryDownload, queryDownload, setSourceProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values
Constructor Detail

ISeriesNativeMemberUtil

public ISeriesNativeMemberUtil()
Method Detail

createMember

public static final IFolder createMember(AbstractISeriesNativeMember iseriesNativeMember,
                                         IProgressMonitor monitor,
                                         Shell shell)
                                  throws SystemMessageException
Deprecated. method appears to be unused. Use ISeriesNativeMemberUtil#createMembers(ISeriesMember[], IProject, IProgressMonitor, Shell) instead.

Download method based on iSeries Project object model.

Downloads a member to the local project it is associated with. If the parent source physical file does not exist, one is created, and the metadata file is generated accordingly. If the source file already exists the source file properties are verified against the downloaded member. If the members exists, a pop-up asks for download confirmation.

Returns the SRCPF IFolder that is the parent of the Member being downloaded, or null if problems where encountered creating the folder.

Note: This method must be run as a WorkspaceModifyOperation, so that all resource modifications are reported as one delta when operation finishes.

Parameters:
iseriesMember - the AbstractISeriesNativeMember that needs to be downloaded.
monitor - a progress monitor, or null if progress reporting and cancellation are not desired. Since this is downloading a single member the progress monitor is ignored. It is not begun, ended, ticked, or tested for cancellation. All of these activities should be handled by the caller.
shell - parent shell for error messages. Pass null to use active shell.
Returns:
the IFolder the represents the parent source physical file of the downloaded member. Returns null if method fails to download for any reason.
Throws:
SystemMessageException - if the operation was not able to complete because of a problem.
OperationCanceledException - if the operation was canceled using the progress monitor. This is a RuntimeException.

createMembers

public static final IFile createMembers(IQSYSMember[] members,
                                        IProject project,
                                        IProgressMonitor monitor,
                                        Shell shell,
                                        com.ibm.etools.iseries.perspective.internal.ui.OracleDialog conflictOracle,
                                        List errorReceiverList,
                                        com.ibm.etools.iseries.projects.internal.snapshots.Snapshot snapshot)
                                 throws SystemMessageException
Downloads an array of members from a particular source file to a given project. If the parent folder representing source files does not exist, it is created with its metadata. If the folder exists, its properties are left as is. If the members exists, a popup asks for download confirmation and retains that information with the oracle. Returns the IFolder that is the parent of the last member being downloaded, or null if problems where encountered during the operation. This should be run as a WorkspaceModifyOperation, since it modifies the workspace.

Parameters:
members - an array of ISeriesMembers
project - the project to where the members will be placed.
monitor - a progress monitor, or null if progress reporting and cancellation are not desired. The monitor is begun and ended and for each file the monitor is incremented by one unit of work. The monitor subtask is changed for each member.
shell - the parent shell for error messages. Pass null to use active shell.
conflictOracle - the oracle dialog to pop-up if a member conflict arises and also retain user response for that dialog. Pass null to create a new oracle.
Returns:
IResource the last successful downloaded member. Returns null if nothing was downloaded.
Throws:
SystemMessageException - if errors occur during operation.
OperationCanceledException - if the operation is canceled.

createMember

public static final IFile createMember(String fileName,
                                       IFolder parentFolder,
                                       Properties memberProperties,
                                       IProgressMonitor monitor,
                                       Shell shell)
                                throws SystemMessageException
Creates a new source member under the passed IFolder.
Note: This method must be run as a WorkspaceModifyOperation, so that all resource modifications are reported as one delta when operation succeeds.

Parameters:
memberName - the name of the new source member. It is assumed that the name follows iSeries naming conventions. Also note that the extension of the member will be used a the "member type". And so for example passing Test.rpg as a member name will create a new member with name "Test" and source type "rpg".
parentFolder - the IFolder handle that represents the source physical file that will contains the new member.
memberProperties - the properties of the new source member. Call getSourceMemberProperties(int , String description) to get the properties object. Note: this Properties object is used to retrieve the source member properties. If any property is missing, default values in that properties object will be used. If that too fails, getDefaultSourceMemberProperties() is called internally to retrieve default values of missing properties. The default values of the properties are the same as the ones used on an iSeries machine. i.e. Text description is empty. For the "last remote edit time property", it is simply not set to signal an unknown value. The properties object can also have ISV properties that are defined using the properties extension point.
monitor - a progress monitor, or null if progress reporting and cancellation are not desired.
shell - parent shell for error messages. Pass null to use active shell.
Returns:
IFile the IFile that represents the newly created source member. Returns null if method fails.
Throws:
CoreException - if errors occur during operation.
SystemMessageException
See Also:
Use ISeriesNativeMemberUtil#createMembers(ISeriesMember[], IProject, IProgressMonitor, Shell) instead.

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.