本文整理匯總了Java中com.liferay.document.library.kernel.model.DLFileEntryType類的典型用法代碼示例。如果您正苦於以下問題:Java DLFileEntryType類的具體用法?Java DLFileEntryType怎麽用?Java DLFileEntryType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DLFileEntryType類屬於com.liferay.document.library.kernel.model包,在下文中一共展示了DLFileEntryType類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getFileEntryTypes
import com.liferay.document.library.kernel.model.DLFileEntryType; //導入依賴的package包/類
@Override
public Map<DLFileEntryType, List<DDMTemplate>> getFileEntryTypes(PermissionChecker permissionChecker, long groupId) throws PortalException {
List<DLFileEntryType> fileEntryTypes = this.dlFileEntryTypeService.getFileEntryTypes(this.portal.getCurrentAndAncestorSiteGroupIds(groupId));
HashMap<DLFileEntryType, List<DDMTemplate>> fileEntryTypeTemplateMapping = new HashMap<>(fileEntryTypes.size());
Map<Group, List<DDMTemplate>> templatesByGroup = this.getDLFileEntryTypeTemplates(permissionChecker, groupId);
List<DDMTemplate> templates = new ArrayList<>();
for(List<DDMTemplate> groupTemplates : templatesByGroup.values()) {
templates.addAll(groupTemplates);
}
// Put the default file entry type in there (because getFileEntryTypes won't do it)
fileEntryTypeTemplateMapping.put(this.dlFileEntryTypeService.getDLFileEntryType(DLFileEntryTypeConstants.FILE_ENTRY_TYPE_ID_BASIC_DOCUMENT), templates);
for(DLFileEntryType fileEntryType : fileEntryTypes) {
fileEntryTypeTemplateMapping.put(fileEntryType, templates);
}
return fileEntryTypeTemplateMapping;
}
示例2: parseDocumentTypeData
import com.liferay.document.library.kernel.model.DLFileEntryType; //導入依賴的package包/類
/**
* Parse document type data.
*
* @param fileEntryTypeId
* @return JSON object
* @throws PortalException
*/
protected JSONObject parseDocumentTypeData(TermCollector tc, Locale locale) throws PortalException {
long fileEntryTypeId = Long.valueOf(tc.getTerm());
if (fileEntryTypeId == 0) {
return null;
}
DLFileEntryType type = _dLFileEntryTypeService.getFileEntryType(fileEntryTypeId);
JSONObject item = JSONFactoryUtil.createJSONObject();
item.put("frequency", tc.getFrequency());
item.put("groupName", _groupLocalService.getGroup(type.getGroupId()).getName(
locale, true));
item.put("name", type.getName(locale, true));
item.put("term", fileEntryTypeId);
return item;
}
示例3: getFacets
import com.liferay.document.library.kernel.model.DLFileEntryType; //導入依賴的package包/類
@Override
public Collection<Facet> getFacets(SearchContext searchContext, FlashlightSearchConfiguration configuration, FlashlightSearchConfigurationTab tab) {
DLFileEntryTypeFacet facet = new DLFileEntryTypeFacet(searchContext);
Map<String, String> fileEntryTypes = tab.getDLFileEntryTypeTemplates();
long companyId = searchContext.getCompanyId();
ArrayList<Long> fileEntryTypeIds = new ArrayList<>(fileEntryTypes.size());
// Again, special case for the default file entry type, which has pretty much all fields set to zero except the
// UUID.
try {
DLFileEntryType basicDocument = this.dlFileEntryTypeService.getFileEntryType(DLFileEntryTypeConstants.FILE_ENTRY_TYPE_ID_BASIC_DOCUMENT);
if(fileEntryTypes.containsKey(basicDocument.getUuid())) {
fileEntryTypeIds.add(DLFileEntryTypeConstants.FILE_ENTRY_TYPE_ID_BASIC_DOCUMENT);
}
} catch(PortalException e) {
LOG.warn("Cannot obtain basic document UUID", e);
}
for(String fileEntryTypeUuid : fileEntryTypes.keySet()) {
List<DLFileEntryType> companyFileEntryTypes = this.dlFileEntryTypeService.getDLFileEntryTypesByUuidAndCompanyId(fileEntryTypeUuid, companyId);
if(companyFileEntryTypes.size() == 1) {
fileEntryTypeIds.add(companyFileEntryTypes.get(0).getFileEntryTypeId());
}
}
int idsLength = fileEntryTypeIds.size();
long[] ids = new long[idsLength];
for(int i = 0; i < idsLength; i++) {
ids[i] = fileEntryTypeIds.get(i);
}
facet.setValues(ids);
return Collections.singletonList(facet);
}
示例4: indexDlFileEntryTypeTemplatesByUuid
import com.liferay.document.library.kernel.model.DLFileEntryType; //導入依賴的package包/類
/**
* Indexes the ddm templates by file entry type UUID
* @param fileEntryTemplates The ddm templates
* @return The re-indexed ddm templates, by UUID
*/
private static final Map<String, List<DDMTemplate>> indexDlFileEntryTypeTemplatesByUuid(Map<DLFileEntryType, List<DDMTemplate>> fileEntryTemplates) {
HashMap<String, List<DDMTemplate>> index = new HashMap<>(fileEntryTemplates.size());
for(Entry<DLFileEntryType, List<DDMTemplate>> entry : fileEntryTemplates.entrySet()) {
index.put(entry.getKey().getUuid(), entry.getValue());
}
return index;
}
示例5: getDLEditFileEntryDisplayContext
import com.liferay.document.library.kernel.model.DLFileEntryType; //導入依賴的package包/類
public DLEditFileEntryDisplayContext getDLEditFileEntryDisplayContext(
DLEditFileEntryDisplayContext parentDLEditFileEntryDisplayContext,
HttpServletRequest request, HttpServletResponse response,
DLFileEntryType dlFileEntryType) {
return parentDLEditFileEntryDisplayContext;
}
示例6: getFileEntryTypes
import com.liferay.document.library.kernel.model.DLFileEntryType; //導入依賴的package包/類
/**
* Returns the list of file entry type templates that are visible to the given site and its parents
*
* @param permissionChecker The current context's permission checker
* @param groupId The site from which to start the search for file entry templates
* @return A list of file entry templates, accessible from the given context. They are indexed by DLFileEntryType.
*
* @throws PortalException If an error occurs while fetching the data
*/
public Map<DLFileEntryType, List<DDMTemplate>> getFileEntryTypes(PermissionChecker permissionChecker, long groupId) throws PortalException;