コード例 #1
0
 @Override
 public List<String> getAllTags() {
   List<String> tagList = new ArrayList<String>();
   for (Folder scriptFolder : repositoryFolder.getChildren(Folder.class)) {
     for (Item scriptDoc : scriptFolder.getChildren(Item.class)) {
       String[] categoryTags = scriptDoc.getProperty("Tags", "").split(",");
       for (String tag : categoryTags) {
         if (!tagList.contains(tag)) {
           tagList.add(tag);
         }
       }
     }
   }
   return tagList;
 }
コード例 #2
0
  @Override
  public List<RepositoryResource> getRepositoryResourcesByTag(String[] tagFilter) {
    List<RepositoryResource> repositoryResources = new ArrayList<RepositoryResource>();

    for (Folder scriptFolder : repositoryFolder.getChildren(Folder.class)) {
      for (Item scriptDoc : scriptFolder.getChildren(Item.class)) {
        RepositoryResource repoResource = new RepositoryResourceItemAdapter(scriptDoc);

        if ((tagFilter == null)
            || (java.util.Arrays.asList(repoResource.getTags()).contains(tagFilter))) {
          repositoryResources.add(repoResource);
        }
      }
    }
    return repositoryResources;
  }
コード例 #3
0
  @Override
  public UserDetails getDetails() {
    UserDetails userDetails = new UserDetails();
    userDetails.setEmail(userAsFolder.getProperty(EMAIL_PROPERTY, ""));
    userDetails.setName(userAsFolder.getProperty(NAME_PROPERTY, ""));
    userDetails.setSurname(userAsFolder.getProperty(SURNAME_PROPERTY, ""));

    Text userStatisticsText = (Text) userAsFolder.getChild(UserPersistencyOnJease.USER_STATISTICS);
    String userStatisticsXML = null;
    if (userStatisticsText != null) {
      userStatisticsXML = userStatisticsText.getContent();
    }
    userDetails.setUserStatistics(
        UserPersistencyOnJease.getUserStatisticsFromText(userStatisticsXML));
    return userDetails;
  }
コード例 #4
0
 @Override
 public Property[] getLibraryProperties(Item item) {
   Factory factory = (Factory) repositoryFolder.getChild("script-factory");
   return factory.getProperties(item);
 }
コード例 #5
0
 @Override
 public int getNextSequence() {
   Factory factory = (Factory) repositoryFolder.getChild("script-factory");
   int nextId = Sequences.getNext(factory.getSequence());
   return nextId;
 }
コード例 #6
0
 @Override
 public UserRole getRole() {
   return UserRole.valueOf(userAsFolder.getProperty(ROLE_PROPERTY, UserRole.DEFAULT.toString()));
 }
コード例 #7
0
 @Override
 public String getEncryptedPassword() {
   return userAsFolder.getProperty(ENCRYPTED_PASSWORD_PROPERTY, "");
 }
コード例 #8
0
 @Override
 public String getId() {
   return userAsFolder.getId();
 }