Exemple #1
0
 public static String getPageHistoryToken(String page) {
   StringBuilder sb = new StringBuilder();
   Project project = Scope.get().getComponent(Project.class);
   if (project != null) sb.append("project=").append(project.getId()).append(SEPARATOR);
   sb.append("page=").append(page);
   return sb.toString();
 }
Exemple #2
0
 @Override
 public boolean isEditable() {
   if (getClosedInPastSprint() != null) return false;
   if (!isInCurrentSprint()) return false;
   if (!getProject().isTeamMember(Scope.get().getComponent(Auth.class).getUser())) return false;
   return true;
 }
Exemple #3
0
 public static String getEntityHref(AGwtEntity entity) {
   String page = null;
   ProjectWorkspaceWidgets workspace = Scope.get().getComponent(ProjectWorkspaceWidgets.class);
   if (workspace != null) page = workspace.getPageForEntity(entity);
   String id = entity.getId();
   return '#' + getEntityHistoryToken(page, id);
 }
Exemple #4
0
  private void showPageAndEntity(String page, String entityId) {
    new TouchLastActivityServiceCall().execute();
    ProjectWorkspaceWidgets workspace = Scope.get().getComponent(ProjectWorkspaceWidgets.class);

    if (historyToken.getPage() == null && page == null) page = HistoryToken.START_PAGE;

    if (page != null) workspace.showPage(page);

    if (entityId != null) {
      if (ScrumGwt.isEntityReferenceOrWikiPage(entityId)) {
        workspace.showEntityByReference(entityId);
      } else {
        if ("Forum".equals(historyToken.getPage())) {
          ForumSupport entity = (ForumSupport) AEntity.getById(entityId);
          workspace.showForum(entity);
        } else {
          workspace.showEntityById(entityId);
        }
      }
    }

    // if (search != null &&
    // !Page.getPageName(SearchResultsWidget.class).equals(historyToken.getPage()))
    // {
    // search.clear();
    // }
  }
Exemple #5
0
 @Override
 public boolean isEditable() {
   if (isClosed()) return false;
   if (isInCurrentSprint()) return false;
   if (!getProject().isProductOwner(Scope.get().getComponent(Auth.class).getUser())) return false;
   return true;
 }
 @Override
 protected void onExecute() {
   Scope.get()
       .getComponent(Ui.class)
       .getWorkspace()
       .getWorkarea()
       .show(new WidgetsTesterWidget());
 }
Exemple #7
0
  public static String getEntityHistoryToken(String page, String entityId) {
    StringBuilder sb = new StringBuilder();

    Project project = Scope.get().getComponent(Project.class);
    if (project != null) sb.append("project=").append(project.getId()).append(SEPARATOR);

    Navigator navigator = Scope.get().getComponent(Navigator.class);
    if (page == null) {
      ProjectWorkspaceWidgets workspace = Scope.get().getComponent(ProjectWorkspaceWidgets.class);
      if (workspace != null) page = workspace.getPageForEntity(entityId);
      if (page == null && navigator != null) page = navigator.historyToken.getPage();
    }
    if (page != null) sb.append("page=").append(page).append(SEPARATOR);

    sb.append("entity=").append(entityId);
    return sb.toString();
  }
Exemple #8
0
 public void setVote(Float estimatedWork) {
   RequirementEstimationVote vote =
       getEstimationVote(Scope.get().getComponent(Auth.class).getUser());
   if (vote == null) throw new IllegalStateException("vote == null");
   vote.setEstimatedWork(estimatedWork);
   if (estimatedWork != null && isWorkEstimationVotingComplete())
     activateWorkEstimationVotingShowoff();
   updateLocalModificationTime();
 }
Exemple #9
0
 public void claim() {
   User user = Scope.get().getComponent(Auth.class).getUser();
   boolean ownerchange = !isOwner(user);
   if (isClosed()) {
     setUnDone(user);
   } else {
     setOwner(user);
   }
 }
Exemple #10
0
  @Override
  protected Widget onInitialization() {
    calendar = Scope.get().getComponent(Calendar.class);

    selectionManager = new BlockListSelectionManager();
    lists = new HashMap<Date, BlockListWidget<SimpleEvent>>();

    wrapper = new SimplePanel();
    showDate(Date.today());
    return wrapper;
  }
Exemple #11
0
  private void showUserMode(String page) {
    if (currentMode == Mode.PROJECT) {
      ScrumScopeManager.destroyProjectScope();
    }

    log.info("Activating USER mode");
    UsersWorkspaceWidgets usersWorkspaceWidgets =
        Scope.get().getComponent(UsersWorkspaceWidgets.class);
    usersWorkspaceWidgets.activate(page);
    currentMode = Mode.USER;
  }
  @Override
  protected Widget onInitialization() {
    dao = Scope.get().getComponent(Dao.class);
    ScrumGwtApplication app = (ScrumGwtApplication) Scope.get().getComponent("app");
    serviceCaller = Scope.get().getComponent(ServiceCaller.class);

    entityCountWrapper = new SimplePanel();
    stateInformationWrapper = new SimplePanel();

    PagePanel page = new PagePanel();
    page.addHeader("Entities");
    page.addSection(entityCountWrapper);

    page.addHeader("State information");
    page.addSection(stateInformationWrapper);

    if (!app.getApplicationInfo().isProductionStage()) {
      page.addHeader("Generators");
      page.addSection(createGenerators());
    }

    return page;
  }
Exemple #13
0
  private void showProject(String projectId, String page, String entityId) {
    Project project = Scope.get().getComponent(Project.class);
    if (project != null && !projectId.equals(project.getId())) {
      // currently other project selected

      ScrumScopeManager.destroyProjectScope();
      showProject(projectId, page, entityId);
      // History.newItem(createToken(projectId, page, entityId), true);
      return;
    }

    if (project == null) {
      project = GProject.getById(projectId);
      if (project == null) throw new RuntimeException("Project does not exist: " + projectId);
      acitvateProjectMode(project, page, entityId);
      return;
    }

    showPageAndEntity(page, entityId);
  }
Exemple #14
0
  public void onServiceCallSuccess(DataTransferObject data) {
    lastSuccessfullServiceCallTime = Tm.getCurrentTimeMillis();

    if (data.conversationNumber != null) {
      conversationNumber = data.conversationNumber;
      log.info("conversatioNumber received:", conversationNumber);
    }
    Scope.get().getComponent(Dao.class).handleDataFromServer(data);

    ScrumGwtApplication app = ScrumGwtApplication.get();
    if (data.applicationInfo != null) {
      app.applicationInfo = data.applicationInfo;
      log.debug("applicationInfo:", data.applicationInfo);
      // Scope.get().putComponent(data.applicationInfo);
    } else {
      assert app.applicationInfo != null;
    }

    new ServerDataReceivedEvent(data).fireInCurrentScope();
  }
Exemple #15
0
  private void acitvateProjectMode(
      final Project project, final String page, final String entityId) {
    assert project != null;

    if (currentMode == Mode.PROJECT) ScrumScopeManager.destroyProjectScope();

    log.info("Activating PROJECT mode");
    Scope.get().getComponent(Ui.class).lock("Loading " + project.getLabel() + "...");
    new SelectProjectServiceCall(project.getId())
        .execute(
            new Runnable() {

              @Override
              public void run() {
                ScrumScopeManager.createProjectScope(project);
                currentMode = Mode.PROJECT;
                Scope.get().getComponent(ProjectWorkspaceWidgets.class).projectDataReceived();
                showPageAndEntity(page, entityId);
              }
            });
  }
Exemple #16
0
 @Override
 protected void onExecute() {
   Scope.get().getComponent(Uploader.class).showUploadDialog(null, new ShowFileHandler());
 }
Exemple #17
0
 @Override
 public boolean isEditable() {
   User currentUser = Scope.get().getComponent(Auth.class).getUser();
   return currentUser.isAdmin() || isAdmin(currentUser);
 }
 @Override
 protected void onExecute() {
   Impediment impediment = getCurrentProject().createNewImpediment();
   task.setImpediment(impediment);
   Scope.get().getComponent(ProjectWorkspaceWidgets.class).showEntity(impediment);
 }
 public void injectComponents(Navigator component, ilarkesto.core.scope.Scope scope) {
   component.app = (scrum.client.ScrumGwtApplication) scope.getComponent("app");
   component.auth = (scrum.client.admin.Auth) scope.getComponent("auth");
   component.dao = (scrum.client.Dao) scope.getComponent("dao");
 }
Exemple #20
0
 @Override
 public void onFileUploaded(File file) {
   Scope.get().getComponent(ProjectWorkspaceWidgets.class).showEntity(file);
 }
Exemple #21
0
 @Override
 protected void onExecute() {
   Task task = requirement.createNewTask();
   Scope.get().getComponent(ProjectWorkspaceWidgets.class).showTask(task);
 }