コード例 #1
0
  /**
   * Deletes a Story and all StoryFragments from local and online storage.
   *
   * @param storyId UUID of the story to delete
   */
  public void deleteStory(UUID storyId) {
    Story story = m_storyDirector.getStory(storyId);
    if (story == null) return;

    HashSet<UUID> fragments = story.getFragmentIds();

    for (UUID fragment : fragments) {
      deleteFragment(fragment);
    }

    m_storyDirector.deleteStory(storyId);
  }
コード例 #2
0
 /**
  * Checks the list of stories to see if the user didn't author them
  *
  * @param stories - list of stories to be checked
  * @return list of non-authored stories
  */
 public Collection<Story> checkIfNotAuthored(Collection<Story> stories) {
   Collection<Story> authoredStories = new HashSet<Story>();
   for (Story story : stories) {
     if (!m_storyDirector.isAuthored(story.getId())) authoredStories.add(story);
   }
   return authoredStories;
 }
コード例 #3
0
 /**
  * Gets a story from the director
  *
  * @param storyId UUID of the Story to get
  * @return The Story, if found. Null, otherwise.
  */
 public Story getStory(UUID storyId) {
   return m_storyDirector.getStory(storyId);
 }
コード例 #4
0
 /**
  * Saves a story to the local storage
  *
  * @return Whether or not the save was successful
  */
 public boolean saveStory() {
   return m_storyDirector.SaveStory();
 }
コード例 #5
0
 public StoryFragment CreateFragment() {
   return m_storyDirector.CreateNewStoryFragment();
 }
コード例 #6
0
 /**
  * Passes a new story created by the director to the view
  *
  * @return A new Story
  */
 public Story CreateStory() {
   return m_storyDirector.CreateNewStory();
 }
コード例 #7
0
 /**
  * Changes a downloaded story to author mode
  *
  * @param storyId
  * @param username The new author name
  */
 public void setStoryToAuthor(UUID storyId, String username) {
   m_storyDirector.setStoryToAuthor(storyId, username);
 }
コード例 #8
0
 /** Uploads a story to the server */
 public void upload() {
   m_storyDirector.uploadCurrentStory();
 }
コード例 #9
0
 /**
  * Selects a StoryFragment from the local or online storage
  *
  * @param fragmentId UUID of the fragment
  */
 public void selectFragment(UUID fragmentId) {
   m_storyDirector.selectFragment(fragmentId);
 }
コード例 #10
0
 /**
  * Selects a Story from the local or online storage.
  *
  * @param storyId UUID of the story
  */
 public void selectStory(UUID storyId) {
   m_storyDirector.selectStory(storyId);
 }
コード例 #11
0
 public void deleteImage(UUID imageId) {
   m_storyDirector.deleteImage(imageId);
 }
コード例 #12
0
 /**
  * Deletes a fragment from local or online storage
  *
  * @param fragmentId UUID of the fragment to delete
  */
 public void deleteFragment(UUID fragmentId) {
   m_storyDirector.deleteFragment(fragmentId);
 }