org.nuxeo.ecm.directory.Directory.getName()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中org.nuxeo.ecm.directory.Directory.getName()方法的一些代码示例,展示了Directory.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Directory.getName()方法的具体详情如下:
包路径:org.nuxeo.ecm.directory.Directory
类名称:Directory
方法名:getName

Directory.getName介绍

[英]Gets the unique name of the directory, used for registering.
[中]获取用于注册的目录的唯一名称。

代码示例

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-directory-sql

  1. @Override
  2. public String toString() {
  3. return "SQLSession [directory=" + directory.getName() + ", sid=" + sid + "]";
  4. }

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-directory-multi

  1. public String getName() {
  2. return directory.getName();
  3. }

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-directory-ldap

  1. @Override
  2. // useful for the log function
  3. public String toString() {
  4. return String.format("LDAPSession '%s' for directory %s", sid, directory.getName());
  5. }

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-directory-sql

  1. private void acquireConnection() {
  2. try {
  3. if (sqlConnection == null || sqlConnection.isClosed()) {
  4. sqlConnection = getDirectory().getConnection();
  5. }
  6. } catch (SQLException e) {
  7. throw new DirectoryException(
  8. "Cannot connect to SQL directory '" + directory.getName() + "': " + e.getMessage(), e);
  9. }
  10. }

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-rest-api-server

  1. @Override
  2. DirectoryEntry run(Session session) {
  3. DocumentModel docEntry = session.createEntry(entry.getDocumentModel());
  4. return new DirectoryEntry(directory.getName(), docEntry);
  5. }
  6. });

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-directory-api

  1. @Override
  2. public List<DirectoryEntry> getCurrentPage() {
  3. Object[] parameters = getParameters();
  4. if (parameters == null || parameters.length > 1) {
  5. throw new IllegalStateException("Invalid parameters: " + Arrays.toString(parameters));
  6. }
  7. if (!(parameters[0] instanceof Directory)) {
  8. throw new IllegalStateException("Provided parameter is not a Directory: " + parameters[0]);
  9. }
  10. Directory directory = (Directory) parameters[0];
  11. try (Session session = directory.getSession()) {
  12. return session.query(Collections.emptyMap(), Collections.emptySet(), Collections.emptyMap(), false,
  13. (int) getPageSize(), (int) getCurrentPageOffset())
  14. .stream()
  15. .map(dir -> new DirectoryEntry(directory.getName(), dir))
  16. .collect(Collectors.toList());
  17. }
  18. }
  19. }

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-rest-api-server

  1. void checkEditGuards() {
  2. NuxeoPrincipal currentUser = getContext().getCoreSession().getPrincipal();
  3. if (!(currentUser.isAdministrator() || currentUser.isMemberOf("powerusers"))) {
  4. throw new WebSecurityException("Not allowed to edit directory");
  5. }
  6. UserManager um = Framework.getService(UserManager.class);
  7. if (directory.getName().equals(um.getUserDirectoryName())
  8. || directory.getName().equals(um.getGroupDirectoryName())) {
  9. throw new NuxeoException("Not allowed to edit user/group directories, please use user/group endpoints",
  10. SC_BAD_REQUEST);
  11. }
  12. }

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-directory-ldap

  1. Session dirSession = dir.getSession();
  2. dirSession.close();
  3. dirName = dir.getName();
  4. } catch (DirectoryException e) {
  5. success = false;

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-directory-api

  1. @Override
  2. public DocumentModel adapt(Directory directory, DocumentModel entry) {
  3. if (fieldName == null || pattern == null) {
  4. log.warn(getClass().getName() + " is missing configuration parameters");
  5. return entry;
  6. }
  7. if (BaseSession.isReadOnlyEntry(entry)) {
  8. // keep already existing flag
  9. return entry;
  10. }
  11. try {
  12. Object fieldValue = entry.getProperty(directory.getSchema(), fieldName);
  13. String value = fieldValue != null ? fieldValue.toString() : "";
  14. if (pattern.matcher(value).matches()) {
  15. BaseSession.setReadWriteEntry(entry);
  16. } else {
  17. BaseSession.setReadOnlyEntry(entry);
  18. }
  19. } catch (PropertyException e) {
  20. throw new DirectoryException(
  21. String.format(
  22. "The field '%s' of entry '%s' could not be adapt and map on directory '%s', check that the field exist in the schema",
  23. fieldName, entry.getId(), directory.getName()), e);
  24. }
  25. return entry;
  26. }

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-rest-api-server

  1. @Override
  2. Object run(Session session) {
  3. DocumentModel entry = session.getEntry(entryId);
  4. if (entry == null) {
  5. throw new WebResourceNotFoundException("Entry not found");
  6. }
  7. return newObject("directoryEntry", new DirectoryEntry(directory.getName(), entry), entryId);
  8. }
  9. });

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-directory-api

  1. protected BaseSession(Directory directory, Class<? extends Reference> referenceClass) {
  2. this.directory = directory;
  3. schemaName = directory.getSchema();
  4. directoryName = directory.getName();
  5. BaseDirectoryDescriptor desc = directory.getDescriptor();
  6. substringMatchType = desc.getSubstringMatchType();
  7. autoincrementId = desc.isAutoincrementIdField();
  8. permissions = desc.permissions;
  9. passwordHashAlgorithm = desc.passwordHashAlgorithm;
  10. this.referenceClass = referenceClass;
  11. computeMultiTenantId = desc.isComputeMultiTenantId();
  12. }

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-directory-ldap

  1. if (field == null) {
  2. String message = String.format("Invalid field name '%s' for directory '%s' with schema '%s'", fieldName,
  3. directory.getName(), directory.getSchema());
  4. throw new DirectoryException(message);

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-rest-api-server

  1. @Override
  2. DirectoryEntry run(Session session) {
  3. try {
  4. DocumentModel docEntry = entry.getDocumentModel();
  5. session.updateEntry(docEntry);
  6. return new DirectoryEntry(directory.getName(), session.getEntry(docEntry.getId()));
  7. } catch (DirectoryException e) {
  8. throw new NuxeoException(e.getMessage(), SC_BAD_REQUEST);
  9. }
  10. }
  11. });

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-directory-api

  1. log.warn("Directory " + getDirectory().getName() + " cannot update field " + referenceFieldName
  2. + " for entry " + docModel.getId()
  3. + ": this field is associated with more than one reference");

相关文章