Package org.olat.repository

Examples of org.olat.repository.RepositoryEntry


   *      org.olat.course.run.userview.NodeEvaluation, java.lang.String)
   */
  @Override
  public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl,
      UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    RepositoryEntry entry = getReferencedRepositoryEntry();
    // create business path courseID:nodeID
    // userCourseEnv.getCourseEnvironment().getCourseResourceableId();
    // getIdent();
    Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
    String nodeId = this.getIdent();
    boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
    boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
    FeedSecurityCallback callback = new FeedNodeSecurityCallback(ne, isAdmin, isGuest);
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(this));
    FeedMainController blogCtr = BlogUIFactory.getInstance(ureq.getLocale()).createMainController(entry.getOlatResource(), ureq, wControl, callback,
        courseId, nodeId);
    blogCtr.activate(ureq, nodecmd);
    Controller wrapperCtrl = TitledWrapperHelper.getWrapper(ureq, wControl, blogCtr, this, "o_blog_icon");
    NodeRunConstructionResult result = new NodeRunConstructionResult(wrapperCtrl);
    return result;
View Full Code Here


  @Override
  public Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv,
      NodeEvaluation ne) {
    if (ne.isAtLeastOneAccessible()) {
      // Create a feed peekview controller that shows the latest two entries
      RepositoryEntry entry = getReferencedRepositoryEntry();
      Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
      String nodeId = this.getIdent();
      boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
      boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
      FeedSecurityCallback callback = new FeedNodeSecurityCallback(ne, isAdmin, isGuest);
      FeedUIFactory uiFactory = BlogUIFactory.getInstance(ureq.getLocale());
      Controller peekViewController = new FeedPeekviewController(entry.getOlatResource(), ureq, wControl, callback, courseId, nodeId, uiFactory, 2, "o_blog_peekview");
      return peekViewController;
    } else {
      // use standard peekview
      return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
    }
View Full Code Here

    displaySearchResults(ureq);
  }

  private void doSearchById(int id) {
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryEntry entry = rm.lookupRepositoryEntry(new Long(id));
    List<RepositoryEntry> entries = new ArrayList<RepositoryEntry>(1);
    if (entry != null) entries.add(entry);
    repoTableModel.setEntries(entries);
    tableCtr.modelChanged();
    displaySearchResults(null);
View Full Code Here

    else if (event instanceof EntryChangedEvent) { // remove deleted entry
      EntryChangedEvent ecv = (EntryChangedEvent)event;
      if (ecv.getChange() == EntryChangedEvent.DELETED) {
        List<RepositoryEntry> newEntries = new ArrayList<RepositoryEntry>();
        for (int i = 0; i < repoTableModel.getRowCount(); i++) {
          RepositoryEntry foo = (RepositoryEntry)repoTableModel.getObject(i);
          if (!foo.getKey().equals(ecv.getChangedEntryKey()))
            newEntries.add(foo);
        }
        repoTableModel.setEntries(newEntries);
        tableCtr.modelChanged();
      } else if (ecv.getChange() == EntryChangedEvent.ADDED) {
View Full Code Here

      if (group.getGroupContext() != null) {
        BGContextManager contextManager = BGContextManagerImpl.getInstance();
        List repoEntries = contextManager.findRepositoryEntriesForBGContext(group.getGroupContext());
        Iterator iter = repoEntries.iterator();
        while (iter.hasNext()) {
          RepositoryEntry entry = (RepositoryEntry) iter.next();
          CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, entry);
        }
      }
    }
  }
View Full Code Here

      Translator trans = new PackageTranslator(PACKAGE, ureq.getLocale());
      String title = trans.translate("guestnoaccess.title");
      String message = trans.translate("guestnoaccess.message");
      controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
      RepositoryEntry repositoryEntry = ne.getCourseNode().getReferencedRepositoryEntry();
      OLATResourceable ores = repositoryEntry.getOlatResource();
      Long resId = ores.getResourceableId();
      SurveyFileResource fr = new SurveyFileResource();
      fr.overrideResourceableId(resId);
      if(!CoordinatorManager.getCoordinator().getLocker().isLocked(fr, null)) {
        AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
View Full Code Here

   * @see org.olat.course.nodes.CourseNode#getReferencedRepositoryEntry()
   */
  public RepositoryEntry getReferencedRepositoryEntry() {
    // ",false" because we do not want to be strict, but just indicate whether
    // the reference still exists or not
    RepositoryEntry re = IQEditController.getIQReference(getModuleConfiguration(), false);
    return re;
  }
View Full Code Here

   */
  public void exportNode(File exportDirectory, ICourse course) {
    String repositorySoftKey = (String) getModuleConfiguration().get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
    if (repositorySoftKey == null) return; // nothing to export
    // self healing
    RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey, false);
    if (re == null) {
      // nothing to export, but correct the module configuration
      IQEditController.removeIQReference(getModuleConfiguration());
      return;
    }
View Full Code Here

      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        String actionid = te.getActionId();
        if (actionid.equals(CMD_LAUNCH)) {
          int rowId = te.getRowId();
          RepositoryEntry repoEntry = repoEntryListModel.getRepositoryEntry(rowId);
          // refresh repo entry, attach to hibernate session
          repoEntry = (RepositoryEntry) DBFactory.getInstance().loadObject(repoEntry);
          // get run controller fro this repo entry and launch it in new tab
          DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
          //was brasato:: DTabs dts = wControl.getDTabs();
          DTab dt = dts.getDTab(repoEntry.getOlatResource());
          if (dt == null) {
            // does not yet exist -> create and add
            dt = dts.createDTab(repoEntry.getOlatResource(), repoEntry.getDisplayname());
            // tabs full
            if (dt != null) {
              Controller runCtr = RepositoyUIFactory.createLaunchController(repoEntry, null, ureq, getWindowControl());         
              dt.setController(runCtr);
              dts.addDTab(dt);
View Full Code Here

   * @return a Comparator for the input sortingCriteria
   */
  protected Comparator getComparator(final SortingCriteria sortingCriteria) {
    return new Comparator(){     
      public int compare(final Object o1, final Object o2) {
        RepositoryEntry repoEntry1= ((RepositoryPortletEntry)o1).getValue();
        RepositoryEntry repoEntry2 = ((RepositoryPortletEntry)o2).getValue();   
        int comparisonResult = 0;
        if(sortingCriteria.getSortingTerm()==SortingCriteria.ALPHABETICAL_SORTING) {         
          comparisonResult = collator.compare(repoEntry1.getDisplayname(), repoEntry2.getDisplayname());               
        }
        if(!sortingCriteria.isAscending()) {
          //if not isAscending return (-comparisonResult)         
          return -comparisonResult;
        }
View Full Code Here

TOP

Related Classes of org.olat.repository.RepositoryEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.