Hello Friends,
How to get the KM resource file Size and Document Relevance (%) by using webdynpro JAVA.
I got remaining all information from the KM Resource file (like filename, description, date& time and username), without these two field name.
I developed below code.
IUser serviceUser = (IUser)WPUMFactory.getServiceUserFactory().getServiceUser(Admin_Service_User);
resourceFactory = ResourceFactory.getInstance();
resourceContext = new ResourceContext(serviceUser);
IIndexService indexService = (IIndexService) resourceFactory.getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
IFederatedSearch federatedSearch = (IFederatedSearch) indexService.getObjectInstance(IWcmIndexConst.FEDERATED_SEARCH_INSTANCE);
List actIndexList = indexService.getActiveIndexes();
Hashtable searchParameters = new Hashtable();
searchParameters.put(SearchParamConst.PARAM_SEARCH_TERM, str_search_term);
searchParameters.put(SearchParamConst.PARAM_SEARCH_ACTION, SearchParamConst.ACTION_EXACT);
SearchQueryListBuilder sqlb = new SearchQueryListBuilder(searchParameters);
IQueryEntryList qel = sqlb.buildSearchQueryList();
ISearchSession session = federatedSearch.searchWithSession(qel, actIndexList,resourceContext);
ISearchResultList results = session.getSearchResults(1, session.getTotalNumberResultKeys());
ISearchResultListIterator iter = results.listIterator();
while (iter.hasNext()) {
ISearchResult result = iter.next();
IResource resource = result.getResource();
IPrivateKMsearchView.ISearchResultElement srcResults = wdContext.createSearchResultElement();
srcResults.setResName(resource.getDisplayName());
srcResults.setFileDiscription(resource.getDescription());
wdContext.nodeSearchResult().addElement(srcResults);
}
Please advise me, how to get these two fields data.
Please check attached screen shoot also for your reference for these two fields.
Regards
Vijay Kalluri