|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.infoengine.util.LDAPImport
This class will perform an LDAP Import from a valid LDIF file. The LDAP
instance is determined by the installed Windchill properties. During import,
the string "<base>" is replaced with the fully qualified base dn of the import
point.
By default existing entries will be overwritten,
and any non existing entries will be added. Existing entries
can be skipped by setting the overwrite option to false (only available if used
in java code as a bean).
Parameters required are:
[dir] The home of Windchill installation (ex. c:\ptc\Windchill )
The value is not used if "ldapurl" is specified.
[ldiffile] A path relative to codebase or and absolute path of a list
of LDIF files to import
[ldapurl] An ldap provider url speifying where to import the ldif file.
This parameter is optional, if not specified, ie.properties
in "dir" is be used. Example:
ldap://cn=Manager:admin@jdmeyer03d.ptcnet.ptc.com/cn=myhost,cn=Application Services,o=ptc
The elements defined by the dn "cn=myhost,cn=Application Services,o=ptc" must exist.
Dependancies: Additional dependant jar files
ie.jar
servlet.jar
The command line calling sequence is:
java -cp v:\Windchill\codebase;v:\Windchill\codebase\WEB-INF\lib\ie.jar;v:\Windchill\lib\servlet.jar
com.infoengine.util.LDAPImport -dir (windchill install dir) -ldiffile file
Field Summary | |
private static String |
IEPROPS
|
private Vector |
ivImportList
list of import files |
private String |
ivInstallDir
Installation directory |
private String |
ivLdapUrl
LDAP url |
private boolean |
ivOverwrite
Overrwrite flag |
Constructor Summary | |
LDAPImport()
|
Method Summary | |
private int |
doEntriesExist(DirectoryService service,
Group entries,
Url u)
Give an LDAP service and a group of entries check whether they exist In the file. |
private String |
getIEProperties(String wcHome)
Helper method to get the provider url from the Info*Engine install. |
Vector |
getImportList()
Get the current ldif import list. |
String |
getInstallDir()
Get the file path to current installation directory. |
String |
getLdapUrl()
Return the current ldap url |
private String |
getProvider(String wcHome)
Helper method to get the provider url from the Info*Engine install. |
boolean |
isOverwrite()
Test the current setting of the overwrite option. |
static void |
main(String[] args)
Main entry point. |
private void |
process(String[] args)
Process the arguments. |
void |
runAction()
May be called by java code to execute this action in a stand alone java environment. |
void |
setImportList(Vector vals)
Set the relative or absolute paths to the ldif files to import. |
void |
setInstallDir(String val)
Set the file path to the installation directory. |
void |
setLdapUrl(String val)
Set the LDAP url |
void |
setOverwrite(boolean val)
Set an option to overwrite any existing entries. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String IEPROPS
private String ivInstallDir
private Vector ivImportList
private boolean ivOverwrite
private String ivLdapUrl
Constructor Detail |
public LDAPImport()
Method Detail |
public void setInstallDir(String val)
val
- Fully qualified path of a valid Windchill installation
directory.public String getInstallDir()
public void setImportList(Vector vals)
vals
- An array of relative or absolute path strings.public Vector getImportList()
public void setOverwrite(boolean val)
val
- Specifies if existing entries are to be overwritten. Default
is false.public boolean isOverwrite()
public void setLdapUrl(String val)
val
- Specifies a valid string form of an LDAP url.public String getLdapUrl()
private void process(String[] args) throws IEException, IOException
Exception
- If an unexpected exception occurs.
IEException
IOException
public void runAction() throws IEException, IOException
IEException
- If a variable setting is unacceptable
IOException
- If an IO error occurs when reading the ldif files.private int doEntriesExist(DirectoryService service, Group entries, Url u) throws Exception
service
- The directory serviceentries
- The LDAP entries to checku
- The Url for to check against.
Exception
- If an unexpected exception occurs when adding the LDAP entries.private String getProvider(String wcHome) throws IOException
wcHome
- Install path to the Windchill installation.
IOException
- If an unexpected exception occurs.private String getIEProperties(String wcHome)
wcHome
- Install path to the Windchill installation.
IOException
- If an unexpected exception occurs.public static void main(String[] args)
IOException
- If an unexpected exception occurs.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |