public class FieldCitation extends Field
To learn more, visit the Working with Fields documentation article.
Remarks:
Inserts the contents of the Source element with a specified Tag element using a bibliographic style.
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAnotherSourceTag()
Gets a value that matches the Tag element's value of another source to be included in the citation.
|
java.lang.String |
getFormatLanguageId()
Gets the language ID that is used in conjunction with the specified bibliographic style to format the citation in the document.
|
java.lang.String |
getPageNumber()
Gets a page number associated with the citation.
|
java.lang.String |
getPrefix()
Gets a prefix that is prepended to the citation.
|
java.lang.String |
getSourceTag()
Gets a value that matches the Tag element's value of the source to insert.
|
java.lang.String |
getSuffix()
Gets a suffix that is appended to the citation.
|
boolean |
getSuppressAuthor()
Gets whether the author information is suppressed from the citation.
|
boolean |
getSuppressTitle()
Gets whether the title information is suppressed from the citation.
|
boolean |
getSuppressYear()
Gets whether the year information is suppressed from the citation.
|
int |
getSwitchType(java.lang.String switchName) |
java.lang.String |
getVolumeNumber()
Gets a volume number associated with the citation.
|
void |
setAnotherSourceTag(java.lang.String value)
Sets a value that matches the Tag element's value of another source to be included in the citation.
|
void |
setFormatLanguageId(java.lang.String value)
Sets the language ID that is used in conjunction with the specified bibliographic style to format the citation in the document.
|
void |
setPageNumber(java.lang.String value)
Sets a page number associated with the citation.
|
void |
setPrefix(java.lang.String value)
Sets a prefix that is prepended to the citation.
|
void |
setSourceTag(java.lang.String value)
Sets a value that matches the Tag element's value of the source to insert.
|
void |
setSuffix(java.lang.String value)
Sets a suffix that is appended to the citation.
|
void |
setSuppressAuthor(boolean value)
Sets whether the author information is suppressed from the citation.
|
void |
setSuppressTitle(boolean value)
Sets whether the title information is suppressed from the citation.
|
void |
setSuppressYear(boolean value)
Sets whether the year information is suppressed from the citation.
|
void |
setVolumeNumber(java.lang.String value)
Sets a volume number associated with the citation.
|
getDisplayResult, getEnd, getFieldCode, getFieldCode, getFormat, getLocaleId, getResult, getSeparator, getStart, getType, isDirty, isDirty, isLocked, isLocked, needStoreOldResultNodes, remove, setLocaleId, setResult, unlink, update, updatepublic java.lang.String getSourceTag()
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
public void setSourceTag(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
value - A value that matches the Tag element's value of the source to insert.java.lang.Exceptionpublic java.lang.String getFormatLanguageId()
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
public void setFormatLanguageId(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
value - The language ID that is used in conjunction with the specified bibliographic style to format the citation in the document.java.lang.Exceptionpublic java.lang.String getPrefix()
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
public void setPrefix(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
value - A prefix that is prepended to the citation.java.lang.Exceptionpublic java.lang.String getSuffix()
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
public void setSuffix(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
value - A suffix that is appended to the citation.java.lang.Exceptionpublic boolean getSuppressAuthor()
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
public void setSuppressAuthor(boolean value)
throws java.lang.Exception
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
value - Whether the author information is suppressed from the citation.java.lang.Exceptionpublic boolean getSuppressTitle()
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
public void setSuppressTitle(boolean value)
throws java.lang.Exception
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
value - Whether the title information is suppressed from the citation.java.lang.Exceptionpublic boolean getSuppressYear()
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
public void setSuppressYear(boolean value)
throws java.lang.Exception
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
value - Whether the year information is suppressed from the citation.java.lang.Exceptionpublic java.lang.String getPageNumber()
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
public void setPageNumber(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
value - A page number associated with the citation.java.lang.Exceptionpublic java.lang.String getVolumeNumber()
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
public void setVolumeNumber(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
value - A volume number associated with the citation.java.lang.Exceptionpublic java.lang.String getAnotherSourceTag()
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
public void setAnotherSourceTag(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to work with CITATION and BIBLIOGRAPHY fields.
// Open a document containing bibliographical sources that we can find in
// Microsoft Word via References -> Citations & Bibliography -> Manage Sources.
Document doc = new Document(getMyDir() + "Bibliography.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Text to be cited with one source.");
// Create a citation with just the page number and the author of the referenced book.
FieldCitation fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
// We refer to sources using their tag names.
fieldCitation.setSourceTag("Book1");
fieldCitation.setPageNumber("85");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(true);
fieldCitation.setSuppressYear(true);
Assert.assertEquals(" CITATION Book1 \\p 85 \\t \\y", fieldCitation.getFieldCode());
// Create a more detailed citation which cites two sources.
builder.insertParagraph();
builder.write("Text to be cited with two sources.");
fieldCitation = (FieldCitation) builder.insertField(FieldType.FIELD_CITATION, true);
fieldCitation.setSourceTag("Book1");
fieldCitation.setAnotherSourceTag("Book2");
fieldCitation.setFormatLanguageId("en-US");
fieldCitation.setPageNumber("19");
fieldCitation.setPrefix("Prefix ");
fieldCitation.setSuffix(" Suffix");
fieldCitation.setSuppressAuthor(false);
fieldCitation.setSuppressTitle(false);
fieldCitation.setSuppressYear(false);
fieldCitation.setVolumeNumber("VII");
Assert.assertEquals(" CITATION Book1 \\m Book2 \\l en-US \\p 19 \\f \"Prefix \" \\s \" Suffix\" \\v VII", fieldCitation.getFieldCode());
// We can use a BIBLIOGRAPHY field to display all the sources within the document.
builder.insertBreak(BreakType.PAGE_BREAK);
FieldBibliography fieldBibliography = (FieldBibliography)builder.insertField(FieldType.FIELD_BIBLIOGRAPHY, true);
fieldBibliography.setFormatLanguageId("5129");
fieldBibliography.setFilterLanguageId("5129");
fieldBibliography.setSourceTag("Book2");
Assert.assertEquals(" BIBLIOGRAPHY \\l 5129 \\f 5129 \\m Book2", fieldBibliography.getFieldCode());
doc.updateFields();
doc.save(getArtifactsDir() + "Field.CITATION.docx");
value - A value that matches the Tag element's value of another source to be included in the citation.java.lang.Exceptionpublic int getSwitchType(java.lang.String switchName)