String namedClass = null;
if(fromItem instanceof NamedTable) {
// Here we use slightly different logic than in
// getContextNameFromFromItem so it is easier to get
// the group name later if needed
Table mdIDGroup = ((NamedTable)fromItem).getMetadataObject();
nameInSource = mdIDGroup.getNameInSource();
// groupName = mdIDGroup.getName();
// if NameInSource is null set it to an empty
// string instead so we can safely call split on it
if(nameInSource == null) {
nameInSource = ""; //$NON-NLS-1$
}
// now split it on ? to find the part of it that specifies the objectClass we should restrict on
String nameInSourceArray[] = nameInSource.split("\\?"); //$NON-NLS-1$
if(nameInSourceArray.length >= 3) {
namedClass = nameInSourceArray[2];
}
// if there is no specification in the Name In Source,
// see if the connector property is set to true. If
// it is, use the Name of the class for the restriction.
if(namedClass == null || namedClass.equals("")) { //$NON-NLS-1$
if (!this.executionFactory.isRestrictToObjectClass()) {
namedClass = ""; //$NON-NLS-1$
} else {
namedClass = mdIDGroup.getName();
}
}
} else {
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.groupCountExceededError"); //$NON-NLS-1$
throw new TranslatorException(msg);