List of usage examples for com.liferay.portal.kernel.search Field COMPANY_ID
String COMPANY_ID
To view the source code for com.liferay.portal.kernel.search Field COMPANY_ID.
Click Source Link
From source file:com.liferay.bookmarks.search.BookmarksFolderIndexer.java
License:Open Source License
public BookmarksFolderIndexer() { setDefaultSelectedFieldNames(Field.COMPANY_ID, Field.ENTRY_CLASS_NAME, Field.ENTRY_CLASS_PK, Field.TITLE, Field.UID);/* w w w.j a va 2 s . co m*/ setFilterSearch(true); setPermissionAware(true); }
From source file:com.liferay.bookmarks.service.test.BookmarksFolderServiceTest.java
License:Open Source License
@Test public void testSearchAndVerifyDocs() throws Exception { ServiceContext serviceContext = ServiceContextTestUtil.getServiceContext(_group.getGroupId()); BookmarksFolder folder = BookmarksTestUtil.addFolder(_group.getGroupId(), RandomTestUtil.randomString()); BookmarksEntry entry = BookmarksTestUtil.addEntry(folder.getFolderId(), true, serviceContext); SearchContext searchContext = BookmarksTestUtil.getSearchContext(entry.getCompanyId(), entry.getGroupId(), entry.getFolderId(), "test"); Indexer<BookmarksEntry> indexer = IndexerRegistryUtil.getIndexer(BookmarksEntry.class); Hits hits = indexer.search(searchContext); Assert.assertEquals(1, hits.getLength()); List<Document> results = hits.toList(); for (Document doc : results) { Assert.assertEquals(entry.getCompanyId(), GetterUtil.getLong(doc.get(Field.COMPANY_ID))); Assert.assertEquals(BookmarksEntry.class.getName(), doc.get(Field.ENTRY_CLASS_NAME)); Assert.assertEquals(entry.getEntryId(), GetterUtil.getLong(doc.get(Field.ENTRY_CLASS_PK))); AssertUtils.assertEqualsIgnoreCase(entry.getName(), doc.get(Field.TITLE)); Assert.assertEquals(entry.getUrl(), doc.get(Field.URL)); }//from w ww .j a v a 2s . com }
From source file:com.liferay.calendar.search.CalendarBookingIndexer.java
License:Open Source License
public CalendarBookingIndexer() { setDefaultSelectedFieldNames(Field.COMPANY_ID, Field.ENTRY_CLASS_NAME, Field.ENTRY_CLASS_PK, Field.UID); setDefaultSelectedLocalizedFieldNames(Field.DESCRIPTION, Field.TITLE); setPermissionAware(true);/*from w ww . j a v a2 s .co m*/ }
From source file:com.liferay.calendar.search.CalendarIndexer.java
License:Open Source License
public CalendarIndexer() { setDefaultSelectedFieldNames(Field.COMPANY_ID, Field.ENTRY_CLASS_NAME, Field.ENTRY_CLASS_PK, Field.UID); setDefaultSelectedLocalizedFieldNames(Field.DESCRIPTION, Field.NAME, "resourceName"); setFilterSearch(true);//w ww . j ava2s . c o m setPermissionAware(true); setSelectAllLocales(true); }
From source file:com.liferay.calendar.search.CalendarSearcher.java
License:Open Source License
public CalendarSearcher() { setDefaultSelectedFieldNames(Field.COMPANY_ID, Field.ENTRY_CLASS_NAME, Field.ENTRY_CLASS_PK, Field.UID); setDefaultSelectedLocalizedFieldNames(Field.DESCRIPTION, Field.NAME, "resourceName"); setFilterSearch(true);// www . j a va 2s . co m setPermissionAware(true); setSelectAllLocales(true); }
From source file:com.liferay.calendar.search.test.CalendarBookingIndexerIndexedFieldsTest.java
License:Open Source License
protected void populateCalendarResource(CalendarResource calendarResource, Map<String, String> map) { map.put(Field.COMPANY_ID, String.valueOf(calendarResource.getCompanyId())); map.put(Field.GROUP_ID, String.valueOf(calendarResource.getGroupId())); map.put(Field.SCOPE_GROUP_ID, String.valueOf(calendarResource.getGroupId())); }
From source file:com.liferay.calendar.search.test.CalendarIndexerIndexedFieldsTest.java
License:Open Source License
protected void populateExpectedFieldValues(Calendar calendar, Map<String, String> map) throws Exception { map.put(Field.COMPANY_ID, String.valueOf(calendar.getCompanyId())); map.put(Field.DEFAULT_LANGUAGE_ID, calendar.getDefaultLanguageId()); map.put(Field.ENTRY_CLASS_NAME, calendar.getModelClassName()); map.put(Field.ENTRY_CLASS_PK, String.valueOf(calendar.getCalendarId())); map.put(Field.GROUP_ID, String.valueOf(calendar.getGroupId())); map.put(Field.SCOPE_GROUP_ID, String.valueOf(calendar.getGroupId())); map.put(Field.STAGING_GROUP, "false"); map.put(Field.USER_ID, String.valueOf(calendar.getUserId())); map.put(Field.USER_NAME, StringUtil.toLowerCase(calendar.getUserName())); map.put("calendarId", String.valueOf(calendar.getCalendarId())); DateFormat dateFormat = DateFormatFactoryUtil.getSimpleDateFormat("yyyyMMddHHmmss"); populateCalendarDate(Field.CREATE_DATE, calendar.getCreateDate(), map, dateFormat); populateCalendarDate(Field.MODIFIED_DATE, calendar.getModifiedDate(), map, dateFormat); populateCalendarResource(calendar.getCalendarResource(), calendar, map); calendarFieldsFixture.populateGroupRoleId(map); calendarFieldsFixture.populateRoleId("Guest", map); calendarFieldsFixture.populateUID(calendar, map); }
From source file:com.liferay.calendar.util.CalendarBookingIndexer.java
License:Open Source License
public CalendarBookingIndexer() { setDefaultSelectedFieldNames(Field.COMPANY_ID, Field.ENTRY_CLASS_NAME, Field.ENTRY_CLASS_PK, Field.UID); setDefaultSelectedLocalizedFieldNames(Field.DESCRIPTION, Field.TITLE); }
From source file:com.liferay.configuration.admin.web.internal.search.ConfigurationModelIndexer.java
License:Open Source License
@Activate protected void activate(BundleContext bundleContext) { setCommitImmediately(false);//from w w w . j a v a2 s . co m setDefaultSelectedFieldNames(Field.COMPANY_ID, Field.DESCRIPTION, Field.ENTRY_CLASS_NAME, Field.TITLE, Field.UID, FieldNames.CONFIGURATION_MODEL_ATTRIBUTE_DESCRIPTION, FieldNames.CONFIGURATION_MODEL_ATTRIBUTE_NAME, FieldNames.CONFIGURATION_MODEL_FACTORY_PID, FieldNames.CONFIGURATION_MODEL_ID); setFilterSearch(false); setPermissionAware(false); setSelectAllLocales(false); setStagingAware(false); }
From source file:com.liferay.configuration.admin.web.internal.search.ConfigurationModelIndexer.java
License:Open Source License
@Override protected Document doGetDocument(ConfigurationModel configurationModel) throws Exception { Document document = newDocument(); document.addUID(ConfigurationAdminPortletKeys.SYSTEM_SETTINGS, configurationModel.getID()); document.addKeyword(FieldNames.CONFIGURATION_MODEL_FACTORY_PID, configurationModel.getFactoryPid()); document.addKeyword(FieldNames.CONFIGURATION_MODEL_ID, configurationModel.getID()); document.addKeyword(Field.COMPANY_ID, CompanyConstants.SYSTEM); ResourceBundleLoader resourceBundleLoader = _resourceBundleLoaderProvider .getResourceBundleLoader(configurationModel.getBundleSymbolicName()); document.addLocalizedText(Field.DESCRIPTION, _translate(resourceBundleLoader, GetterUtil.getString(configurationModel.getDescription()))); document.addKeyword(Field.ENTRY_CLASS_NAME, getClassName()); AttributeDefinition[] requiredAttributeDefinitions = configurationModel .getAttributeDefinitions(ObjectClassDefinition.ALL); List<String> attributeNames = new ArrayList<>(requiredAttributeDefinitions.length); List<String> attributeDescriptions = new ArrayList<>(requiredAttributeDefinitions.length); for (AttributeDefinition attributeDefinition : requiredAttributeDefinitions) { attributeNames.add(attributeDefinition.getName()); attributeDescriptions.add(attributeDefinition.getDescription()); }/*from www.j a v a 2 s . com*/ document.addKeyword(FieldNames.CONFIGURATION_MODEL_ATTRIBUTE_NAME, attributeNames.toArray(new String[attributeNames.size()])); document.addText(FieldNames.CONFIGURATION_MODEL_ATTRIBUTE_DESCRIPTION, attributeDescriptions.toArray(new String[attributeDescriptions.size()])); document.addLocalizedText(Field.TITLE, _translate(resourceBundleLoader, GetterUtil.getString(configurationModel.getName()))); return document; }