Beispiel #1
0
  public StatsPanel() {
    setWidth100();
    setMembersMargin(10);

    service.getStatistics(
        Session.get().getSid(),
        I18N.getLocale(),
        new AsyncCallback<GUIParameter[][]>() {

          @Override
          public void onFailure(Throwable caught) {
            Log.serverError(caught);
          }

          @Override
          public void onSuccess(GUIParameter[][] parameters) {
            Label lastUpdateLabel =
                new Label(
                    "<b>"
                        + I18N.message("lastupdate")
                        + ": "
                        + parameters[3][0].getValue()
                        + "</b>");
            lastUpdateLabel.setHeight(30);
            lastUpdateLabel.setAlign(Alignment.RIGHT);

            PieStats charts = new PieStats(parameters);

            setMembers(lastUpdateLabel, charts);
          }
        });
  }
  public ExtendedAttributeOptionsDS(long templateId, String attribute, boolean withEmpty) {
    setRecordXPath("/list/option");
    DataSourceTextField id = new DataSourceTextField("id");
    id.setPrimaryKey(true);
    id.setHidden(true);
    id.setRequired(true);
    DataSourceTextField _attribute = new DataSourceTextField("attribute");
    _attribute.setHidden(true);

    DataSourceTextField value = new DataSourceTextField("value");

    DataSourceIntegerField position = new DataSourceIntegerField("position");
    position.setHidden(true);

    DataSourceTextField _templateId = new DataSourceTextField("templateId");
    _templateId.setHidden(true);

    setFields(id, _attribute, value, position, _templateId);
    setClientOnly(true);

    setDataURL(
        "data/extoptions.xml?sid="
            + Session.get().getSid()
            + "&"
            + "templateId="
            + templateId
            + "&"
            + "attribute="
            + attribute
            + "&withempty="
            + withEmpty);
  }
 @Override
 public GUIDocument markSelectedAsCheckedOut() {
   Record record = getSelectedRecord();
   if (record == null) return null;
   record.setAttribute("locked", "page_edit");
   record.setAttribute("lockUserId", Session.get().getUser().getId());
   record.setAttribute("status", Constants.DOC_CHECKED_OUT);
   redraw();
   return getSelectedDocument();
 }
Beispiel #4
0
  public DiscussionsDS(long docId) {
    setRecordXPath("/list/discussion");
    DataSourceTextField title = new DataSourceTextField("title");
    DataSourceTextField id = new DataSourceTextField("id");
    id.setPrimaryKey(true);
    id.setHidden(true);
    id.setRequired(true);
    DataSourceTextField user = new DataSourceTextField("user");
    DataSourceIntegerField posts = new DataSourceIntegerField("posts");
    DataSourceIntegerField visits = new DataSourceIntegerField("visits");
    DataSourceDateTimeField lastPost = new DataSourceDateTimeField("lastPost");

    setFields(id, title, user, posts, visits, lastPost);
    setClientOnly(true);
    setDataURL("data/discussions.xml?sid=" + Session.get().getSid() + "&docId=" + docId);
  }
Beispiel #5
0
  private DashboardPanel() {
    userTab = new Tab(I18N.message("user"));
    userTab.setID("user");
    userTab.setPane(new UserDashboard());

    tagsTab = new Tab(I18N.message("tags"));
    tagsTab.setID("tags");
    tagsTab.setPane(new TagsDashboard());

    messagesTab = new Tab(I18N.message("messages"));
    messagesTab.setID("messages");
    messagesTab.setPane(new MessagesPanel());

    subscriptionsTab = new Tab(I18N.message("subscriptions"));
    subscriptionsTab.setID("subscriptions");
    subscriptionsTab.setPane(new SubscriptionsPanel());

    workflowTab = new Tab(I18N.message("workflow"));
    workflowTab.setID("workflow");
    workflowTab.setPane(new WorkflowDashboard());

    tabSet.addTab(userTab);

    if (Feature.visible(Feature.TAGS)) {
      tabSet.addTab(tagsTab);
      if (!Feature.enabled(Feature.TAGS)) tagsTab.setPane(new TagsDashboard());
    }

    if (Feature.visible(Feature.MESSAGES)) {
      tabSet.addTab(messagesTab);
      if (!Feature.enabled(Feature.MESSAGES)) messagesTab.setPane(new FeatureDisabled());
    }

    if (Feature.visible(Feature.AUDIT)) {
      tabSet.addTab(subscriptionsTab);
      if (!Feature.enabled(Feature.AUDIT)) subscriptionsTab.setPane(new FeatureDisabled());
    }

    if (Feature.visible(Feature.WORKFLOW)) {
      tabSet.addTab(workflowTab);
      if (!Feature.enabled(Feature.WORKFLOW)) workflowTab.setPane(new FeatureDisabled());
    }

    setMembers(tabSet);

    Session.get().getUser().addObserver(this);
  }
Beispiel #6
0
  public DocumentNotesDS(long documentId) {
    setRecordXPath("/list/note");
    DataSourceTextField id = new DataSourceTextField("id");
    id.setPrimaryKey(true);
    id.setHidden(true);
    id.setRequired(true);

    DataSourceTextField docId = new DataSourceTextField("docId");
    DataSourceTextField userId = new DataSourceTextField("userId");
    DataSourceTextField username = new DataSourceTextField("username");
    DataSourceDateTimeField date = new DataSourceDateTimeField("date");
    DataSourceTextField message = new DataSourceTextField("message");

    setFields(id, docId, username, userId, date, message);
    setClientOnly(true);
    setDataURL("data/documentnotes.xml?sid=" + Session.get().getSid() + "&docId=" + documentId);
  }
Beispiel #7
0
  public MessagesDS() {
    setTitleField("subject");
    setRecordXPath("/list/message");
    DataSourceTextField id = new DataSourceTextField("id");
    id.setPrimaryKey(true);
    id.setRequired(true);

    DataSourceTextField subject = new DataSourceTextField("subject");
    DataSourceTextField text = new DataSourceTextField("text");
    DataSourceImageField priority = new DataSourceImageField("priority");
    DataSourceTextField from = new DataSourceTextField("from");
    DataSourceDateTimeField sent = new DataSourceDateTimeField("sent");
    DataSourceTextField read = new DataSourceTextField("read");

    setFields(id, subject, text, priority, from, sent, read);
    setClientOnly(true);
    setDataURL("data/messages.xml?sid=" + Session.get().getSid());
  }