* @param wikiPage
* @return
*/
public static Document createDocument(SearchResourceContext searchResourceContext, Identity identity) {
UserManager userMgr = UserManager.getInstance();
User user = identity.getUser();
HomePageConfigManager homepageMgr = HomePageConfigManagerImpl.getInstance();
HomePageConfig publishConfig = homepageMgr.loadConfigFor(identity.getName());
IdentityDocument identityDocument = new IdentityDocument();
identityDocument.setTitle(identity.getName());
identityDocument.setCreatedDate(user.getCreationDate());
// loop through all user properties and collect the content string and the last modified
List<UserPropertyHandler> userPropertyHanders = userMgr.getUserPropertyHandlersFor(IdentityDocument.class.getName(), false);
StringBuilder content = new StringBuilder();
for (UserPropertyHandler userPropertyHandler : userPropertyHanders) {
String propertyName = userPropertyHandler.getName();
// only index fields the user has published!
if (publishConfig.isEnabled(propertyName)) {