// TODO: Move this to the client factory.
if (SPType.SP2003 == spType) {
LOGGER.log(Level.INFO, "Getting the initial list of MySites/Personal "
+ "sites for SharePoint type SP2003. Context URL [ "
+ sharepointClientContext.getSiteURL() + " ]");
final UserProfile2003Helper userProfile =
new UserProfile2003Helper(sharepointClientContext);
if (userProfile.isSPS()) {// Check if SPS2003 or WSS 2.0
try {
final Set<String> personalSites = userProfile.getPersonalSiteList();
allSites.addAll(personalSites);
} catch (final Exception e) {
LOGGER.log(Level.WARNING, "Unable to get MySites for the Context URL [ "
+ sharepointClientContext.getSiteURL() + " ]", e);
}
}
} else if (SPType.SP2007 == spType) {
final String strMySiteURL = sharepointClientContext.getMySiteBaseURL();
if ((strMySiteURL != null) && (!strMySiteURL.trim().equals(""))) {
LOGGER.log(Level.INFO, "Getting the initial list of MySites for SharePoint type SP2007 from MySiteBaseURL [ "
+ strMySiteURL + " ]");
final UserProfile2007Helper userProfile =
new UserProfile2007Helper(sharepointClientContext);
if (userProfile.isSPS()) {
try {
final Set<String> lstMyLinks = userProfile.getMyLinks();
allSites.addAll(lstMyLinks);// remove duplicates
} catch (final Exception e) {
LOGGER.log(Level.WARNING, "Unable to get MySites from MySiteBaseURL [ "
+ strMySiteURL + " ]", e);
}
try {
final Set<String> personalSites = userProfile.getPersonalSiteList();
allSites.addAll(personalSites);
} catch (final Exception e) {
LOGGER.log(Level.WARNING, "Unable to get Personal Sites for Context URL [ "
+ sharepointClientContext.getSiteURL() + " ]", e);
}