public String getPlainTextContent() { if (content == null) { return null; } return content.getPlainText(); }
public String getPlainTextContent() { if (content == null) { return null; } return content.getPlainText(); }
@Override public String getPlainText() { return wrapped.getPlainText(); }
@Override public String getPlainText() { return wrapped.getPlainText(); }
/** * Returns a positive integer if {@code e1}'s title comes after {@code e2}'s * title alphabetically. */ @Override public int compare(BaseContentEntry<?> e1, BaseContentEntry<?> e2) { return e1.getTitle().getPlainText().compareTo(e2.getTitle().getPlainText()); } }
private WorksheetEntry getWorkSheet(String sheetName) throws IOException, ServiceException { for (WorksheetEntry workSheet : spreadSheet.getWorksheets()) { if (workSheet.getTitle().getPlainText().equalsIgnoreCase(sheetName)) { return workSheet; } } return null; }
public GSWorksheet(final GSModel model, final WorksheetEntry worksheetEntry, final boolean existsInSpreadsheet) throws Exception { super(model, worksheetEntry.getTitle().getPlainText(), existsInSpreadsheet); this.model = model; this.worksheetEntry = worksheetEntry; this.headerInWorksheetIsEmpty = true; this.hasGoogleIdsSet = false; this.rows = null; this.initialise(); }
/** * Assumes the <content> element's contents are plain-text and * returns its value as a string * * @return A string containing the plain-text value of the content tag. * * @throws IllegalStateException * If the content element is not a text type. */ public String getPlainTextContent() { TextConstruct textConstruct = getTextContent().getContent(); if (!(textConstruct instanceof PlainTextConstruct)) { throw new IllegalStateException( "TextConstruct object is not a PlainTextConstruct"); } return textConstruct.getPlainText(); }
/** * Assumes the <content> element's contents are plain-text and * returns its value as a string * * @return A string containing the plain-text value of the content tag. * * @throws IllegalStateException * If the content element is not a text type. */ public String getPlainTextContent() { TextConstruct textConstruct = getTextContent().getContent(); if (!(textConstruct instanceof PlainTextConstruct)) { throw new IllegalStateException( "TextConstruct object is not a PlainTextConstruct"); } return textConstruct.getPlainText(); }
private void downloadAttachment(AttachmentEntry attachment, File rootDirectory, EntryStore entryStore, SitesService sitesService) { BasePageEntry<?> parent = entryStore.getParent(attachment.getId()); if (parent != null) { File relativePath = getPath(parent, entryStore); if (relativePath != null) { File folder = new File(rootDirectory, relativePath.getPath()); folder.mkdirs(); File file = new File(folder, attachment.getTitle().getPlainText()); attachmentDownloader.download(attachment, file, sitesService); } } }
/** * Returns the comment of the complaint. * * @return the comment of the complaint */ public String getComment() { if (getContent() instanceof TextContent) { return ((TextContent) getContent()).getContent().getPlainText(); } return null; }
/** * Returns the comment of the complaint. * * @return the comment of the complaint */ public String getComment() { if (getContent() instanceof TextContent) { return ((TextContent) getContent()).getContent().getPlainText(); } return null; }
/** * Creates a new hAtom "entry-summary" element for the given entry. */ static XmlElement getSummaryElement(BaseContentEntry<?> entry) { checkNotNull(entry); XmlElement element = new XmlElement("span"); element.setAttribute("class", "entry-summary"); TextConstruct summary = entry.getSummary(); if (summary == null) { element.addText(""); } else { element.addText(entry.getSummary().getPlainText()); } return element; }
@Override public void putAttributes(AttributeGenerator generator) { if (content != null) { String type = content.getType() == TextConstruct.Type.TEXT ? "plain" : "html"; generator.put("type", type); if (content != null) { if (content instanceof HtmlTextConstruct) { HtmlTextConstruct html = (HtmlTextConstruct) content; generator.setContent(html.getHtml()); } else { generator.setContent(content.getPlainText()); } } } }
@Override public void putAttributes(AttributeGenerator generator) { if (content != null) { String type = content.getType() == TextConstruct.Type.TEXT ? "plain" : "html"; generator.put("type", type); if (content != null) { if (content instanceof HtmlTextConstruct) { HtmlTextConstruct html = (HtmlTextConstruct) content; generator.setContent(html.getHtml()); } else { generator.setContent(content.getPlainText()); } } } }
@Override public XmlElement renderSubpageLinks(List<BasePageEntry<?>> subpages) { XmlElement div = new XmlElement("div"); div.addText("Subpages (" + subpages.size() + "):"); for (BasePageEntry<?> subpage : subpages) { String href = subpage.getPageName().getValue() + "/index.html"; div.addText(" "); div.addElement(RendererUtils.getHyperLink(href, subpage.getTitle().getPlainText())); } return div; } }
/** * Positive test case for retrieveAllContactGroups method with mandatory parameters. * * @throws Exception the exception */ @Test(priority = 1, groups = { "wso2.esb" }, description = "Google Contacts {retrieveAllContactGroups} method {mandatory parameters} Integration Tests") public void testRetrieveAllContactGroupsMandatoryParameters() throws Exception { SOAPEnvelope esbSoapResponse = sendSOAPRequest(proxyUrl, "esb_retrieveAllContactGroups_mandatory.xml"); ContactGroupFeed groupFeed = directInvoker.retrieveAllContactGroups(); Assert.assertEquals(String.valueOf(groupFeed.getTotalResults()), (String) xPathEvaluate(esbSoapResponse.getBody().getFirstElement(), "string(//openSearch:totalResults/text())", nameSpaceMap)); Assert.assertEquals(groupFeed.getEntries().get(groupFeed.getEntries().size() - 1).getTitle().getPlainText(), (String) xPathEvaluate(esbSoapResponse.getBody().getFirstElement(), "string(//atom:entry[last()]/atom:title/text())", nameSpaceMap)); }
/** * Positive test case for retrieveContactsByQuery method with mandatory parameters. * * @throws Exception the exception */ @Test(priority = 1, groups = { "wso2.esb" }, description = "Google Contacts {retrieveContactsByQuery} method {mandatory parameters} Integration Tests") public void testRetrieveContactsByQueryMandatoryParameters() throws Exception { SOAPEnvelope esbSoapResponse = sendSOAPRequest(proxyUrl, "esb_retrieveContactsByQuery_mandatory.xml"); ContactFeed contactFeed = directInvoker.retrieveAllContacts(); Assert.assertEquals(String.valueOf(contactFeed.getTotalResults()), (String) xPathEvaluate(esbSoapResponse.getBody().getFirstElement(), "string(//openSearch:totalResults/text())", nameSpaceMap)); Assert.assertEquals( contactFeed.getEntries().get(contactFeed.getEntries().size() - 1).getTitle().getPlainText(), (String) xPathEvaluate(esbSoapResponse.getBody().getFirstElement(), "string(//atom:entry[last()]/atom:title/text())", nameSpaceMap)); }
/** * Creates a new hAtom "entry-title" element for the given entry. */ static XmlElement getTitleElement(BaseContentEntry<?> entry) { checkNotNull(entry); String title = entry.getTitle().getPlainText(); if (getType(entry) == ATTACHMENT) { return getHyperLink(title, title).setAttribute("class", "entry-title"); } else if (getType(entry) == WEB_ATTACHMENT) { String href = ((OutOfLineContent) entry.getContent()).getUri(); return getHyperLink(href, title).setAttribute("class", "entry-title"); } return new XmlElement("span").setAttribute("class", "entry-title") .addText(title); }
public GSpreadResultSet retrieveData() throws Exception { URL worksheetUrl = this.getConfig().generateWorksheetFeedURL(); WorksheetFeed feedw = this.getConfig().getFeed(worksheetUrl, WorksheetFeed.class); WorksheetEntry worksheetEntry = feedw.getEntries().get(this.getWorksheetNumber() - 1); CellFeed feedc = this.getConfig().getFeed(worksheetEntry.getCellFeedUrl(), CellFeed.class); List<CellEntry> entries = feedc.getEntries(); GSpreadResultSet grs = new GSpreadResultSet(); /* store the data */ for (CellEntry entry : entries) { grs.addCell(this.getPosStringFromId(entry.getId()), entry.getTextContent().getContent().getPlainText()); } return grs; }