Examples of DocumentHeader


Examples of org.asciidoctor.ast.DocumentHeader

    }

    @Override
    public void processHeader(final ParserContext context) {
        final Asciidoctor asciidoctor = getEngine();
        DocumentHeader header = asciidoctor.readDocumentHeader(context.getFile());
        Map<String, Object> contents = context.getContents();
        if (header.getDocumentTitle() != null) {
            contents.put("title", header.getDocumentTitle().getMain());
        }
        Map<String, Object> attributes = header.getAttributes();
        for (String key : attributes.keySet()) {
            if (key.startsWith("jbake-")) {
                Object val = attributes.get(key);
                if (val!=null) {
                    String pKey = key.substring(6);
View Full Code Here

Examples of org.kuali.rice.krad.bo.DocumentHeader

  public void testIdMgrPermissions_populateGroup() throws WorkflowException {
    Map<String, Boolean> authUsers = getTestUtils().getAuthUsers();
    GlobalVariables.setUserSession(new UserSession("admin"));
    //Document document = KRADServiceLocatorWeb.getDocumentService().getNewDocument(IdentityManagementPersonDocument.class);
    Document document = mock(IdentityManagementPersonDocument.class);
    DocumentHeader header = mock(DocumentHeader.class);
    WorkflowDocument wd = mock(WorkflowDocument.class);
    when(document.getDocumentHeader()).thenReturn(header);
    when(header.getWorkflowDocument()).thenReturn(wd);
    when(document.getDocumentNumber()).thenReturn("1001");
    when(wd.getDocumentTypeName()).thenReturn("IdentityManagementPersonDocument");
    when(wd.isInitiated()).thenReturn(true);
    when(wd.getStatus()).thenReturn(DocumentStatus.fromCode("I"));
    // assign users to groups
View Full Code Here

Examples of org.kuali.rice.krad.bo.DocumentHeader

   *
   * @return String initiator name
   */
  public String getDocumentInitiatorNetworkId() {
    String initiatorNetworkId = "";
    DocumentHeader tmpDocumentHeader = getDocumentHeader();
    if (tmpDocumentHeader != null && !StringUtils.isEmpty(tmpDocumentHeader.getDocumentNumber())) {
      String initiatorPrincipalId = tmpDocumentHeader.getWorkflowDocument().getInitiatorPrincipalId();
      Person initiator = KimApiServiceLocator.getPersonService().getPerson(initiatorPrincipalId);
      if (initiator != null) {
        initiatorNetworkId = initiator.getPrincipalName();
      }
    }
View Full Code Here

Examples of org.kuali.rice.krad.bo.DocumentHeader

   * initializes {@link #workflowDocument} so that info can be displayed on the work inquiry section table
   * <p>This is because during the inquiry, the work bo is fetched via ojb directly and not via the document service</p>
   */
  @Override
  public DocumentHeader getDocumentHeader() {
    DocumentHeader tmpDocumentHeader = super.getDocumentHeader();
    if (tmpDocumentHeader != null && ! tmpDocumentHeader.hasWorkflowDocument()) {
      WorkflowDocument wfd = null;
      if (! StringUtils.isEmpty(getDocumentNumber())) {
        wfd = WorkflowDocumentFactory.loadDocument(
            GlobalVariables.getUserSession().getPrincipalId(), getDocumentNumber());
      }
      if (wfd == null) {
        log.debug("set dummy WorkflowDocument");
        tmpDocumentHeader.setWorkflowDocument(new DummyWorkFlowDocument());
      } else {
        tmpDocumentHeader.setWorkflowDocument(wfd);
        log.debug("set found WorkflowDocument");
      }
    }
    return tmpDocumentHeader;
  }
View Full Code Here

Examples of org.kuali.rice.krad.bo.DocumentHeader

   * {@link org.kuali.rice.kew.api.WorkflowDocument} to return a timestamp since it will be displayed is the configured format
   * @return the timestamp if {@link #getDocumentHeader().getWorkflowDocument().getDateCreated()} is not null, otherwise null
   */
  public Timestamp getDateCreated() {
    DateTime dateCreated = null;
    DocumentHeader tmpHdr = getDocumentHeader();
    if (tmpHdr != null && (dateCreated = tmpHdr.getWorkflowDocument().getDateCreated()) != null) {
      return new Timestamp(dateCreated.getMillis());
    } else {
      return null;
    }
  }
View Full Code Here

Examples of org.kuali.rice.krad.bo.DocumentHeader

  /**
   * the time period between creation and last modification
   * @return empty string if any of created or last modification times are null, the period otherwise
   */
  public String getPeriodToLastModification() {
    final DocumentHeader tmpHdr = getDocumentHeader();
    if (tmpHdr == null) {
      return "";
    } else {
      final DateTime dateCreated = tmpHdr.getWorkflowDocument().getDateCreated();
      final DateTime dateLastModified = tmpHdr.getWorkflowDocument().getDateLastModified();
      if(dateCreated != null && dateLastModified != null) {
        Period period = new Period(dateCreated, dateLastModified);
        return period.toString(PeriodFormat.getDefault());
      } else {
        return "";
View Full Code Here

Examples of org.kuali.rice.krad.bo.DocumentHeader

  /**
   * the time period between creation and completion
   * @return empty string if any of created or completion times are null, the period otherwise
   */
  public String getPeriodToCompletion() {
    final DocumentHeader tmpHdr = getDocumentHeader();
    if (tmpHdr == null) {
      return "";
    }
    final DateTime dateCreated = tmpHdr.getWorkflowDocument().getDateCreated();
    DateTime dateCompleted = getActionDate(tmpHdr, KewApiConstants.ACTION_TAKEN_COMPLETED_CD);
    if (dateCreated != null && dateCompleted != null) {
      Period period = new Period(dateCreated, dateCompleted);
      return period.toString(PeriodFormat.getDefault());
    } else {
View Full Code Here

Examples of org.kuali.rice.krad.bo.DocumentHeader

  /**
   * the time period between completion and approval
   * @return empty string if any of created or completion times are null, the period otherwise
   */
  public String getPeriodToApprove() {
    final DocumentHeader tmpHdr = getDocumentHeader();
    if (tmpHdr == null) {
      return "";
    }
    DateTime dateCompleted = getActionDate(tmpHdr, KewApiConstants.ACTION_TAKEN_COMPLETED_CD);
    DateTime dateApproved = getActionDate(tmpHdr, KewApiConstants.ACTION_TAKEN_APPROVED_CD);
View Full Code Here

Examples of org.kuali.rice.krad.bo.DocumentHeader

   * add mock header and workflow doc to the work document
   */
  public void setupHeader() {
    wfd = mock(WorkflowDocument.class);
    when(wfd.getDateCreated()).thenReturn(DateTime.now());
    DocumentHeader docHdr = mock(DocumentHeader.class);
    when(docHdr.getWorkflowDocument()).thenReturn(wfd);
    when(work.getDocumentHeader()).thenReturn(docHdr);
  }
View Full Code Here

Examples of org.openbel.framework.common.protonetwork.model.DocumentTable.DocumentHeader

                    "Description", "Version", "Copyright", "Disclaimer",
                    "ContactInfo", "Authors", "Licenses");

            List<DocumentHeader> dhs = dt.getDocumentHeaders();
            for (int i = 0; i < dhs.size(); i++) {
                DocumentHeader dh = dhs.get(i);

                tdvWriter
                        .writeNext(new String[] {
                                String.valueOf(i),
                                dh.getName() == null ? "-" : dh.getName(),
                                dh.getDescription() == null ? "-" : dh
                                        .getDescription(),
                                dh.getVersion() == null ? "-" : dh.getVersion(),
                                dh.getCopyright() == null ? "-" : dh
                                        .getCopyright(),
                                dh.getDisclaimer() == null ? "-" : dh
                                        .getDisclaimer(),
                                dh.getContactInfo() == null ? "-" : dh
                                        .getContactInfo(),
                                dh.getAuthors() == null ? "-" : dh.getAuthors(),
                                dh.getLicenses() == null ? "-" : dh
                                        .getLicenses() });

                allWriter
                        .writeNext(new String[] {
                                String.valueOf(i),
                                dh.getName() == null ? "-" : dh.getName(),
                                dh.getDescription() == null ? "-" : dh
                                        .getDescription(),
                                dh.getVersion() == null ? "-" : dh.getVersion(),
                                dh.getCopyright() == null ? "-" : dh
                                        .getCopyright(),
                                dh.getDisclaimer() == null ? "-" : dh
                                        .getDisclaimer(),
                                dh.getContactInfo() == null ? "-" : dh
                                        .getContactInfo(),
                                dh.getAuthors() == null ? "-" : dh.getAuthors(),
                                dh.getLicenses() == null ? "-" : dh
                                        .getLicenses() });
            }

            tdvWriter.close();
        } catch (IOException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.