本文整理汇总了Java中com.google.gdata.data.spreadsheet.WorksheetEntry.getListFeedUrl方法的典型用法代码示例。如果您正苦于以下问题:Java WorksheetEntry.getListFeedUrl方法的具体用法?Java WorksheetEntry.getListFeedUrl怎么用?Java WorksheetEntry.getListFeedUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gdata.data.spreadsheet.WorksheetEntry
的用法示例。
在下文中一共展示了WorksheetEntry.getListFeedUrl方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEmptyClinicalVariants
import com.google.gdata.data.spreadsheet.WorksheetEntry; //导入方法依赖的package包/类
private static void getEmptyClinicalVariants(Gene gene, SpreadsheetService service, WorksheetEntry entry) throws IOException, ServiceException {
if (gene != null && service != null && entry != null) {
URL feedUrl = entry.getListFeedUrl();
Set<ClinicalVariant> variants = MainUtils.getClinicalVariants(gene);
for (ClinicalVariant variant : variants) {
if (variant.getOncoTreeType() == null || StringUtils.isNullOrEmpty(variant.getLevel())
|| (variant.getDrugAbstracts().isEmpty() && variant.getDrugPmids().isEmpty())
|| variant.getDrug().isEmpty()) {
ListEntry row = new ListEntry();
setValue(row, "Gene", gene.getHugoSymbol());
setValue(row, "Alteration", variant.getVariant().getAlteration());
setValue(row, "CancerType", getCancerType(variant.getOncoTreeType()));
setValue(row, "Level", variant.getLevel());
setValue(row, "Drug", org.apache.commons.lang3.StringUtils.join(variant.getDrug(), ", "));
setValue(row, "Pmids", org.apache.commons.lang3.StringUtils.join(variant.getDrugPmids(), ", "));
setValue(row, "Abstracts", org.apache.commons.lang3.StringUtils.join(variant.getDrugAbstracts(), ", "));
service.insert(feedUrl, row);
}
}
}
}
示例2: getEmptyBiologicalVariants
import com.google.gdata.data.spreadsheet.WorksheetEntry; //导入方法依赖的package包/类
private static void getEmptyBiologicalVariants(Gene gene, SpreadsheetService service, WorksheetEntry entry) throws IOException, ServiceException {
if (gene != null && service != null && entry != null) {
URL feedUrl = entry.getListFeedUrl();
Set<BiologicalVariant> variants = MainUtils.getBiologicalVariants(gene);
for (BiologicalVariant variant : variants) {
if (variant.getOncogenic() == null || variant.getMutationEffect() == null
|| (variant.getMutationEffectPmids().isEmpty() && variant.getMutationEffectAbstracts().isEmpty())) {
ListEntry row = new ListEntry();
setValue(row, "Gene", gene.getHugoSymbol());
setValue(row, "Alteration", variant.getVariant().getAlteration());
setValue(row, "Oncogenicity", variant.getOncogenic());
setValue(row, "MutationEffect", variant.getMutationEffect());
setValue(row, "PMIDs", org.apache.commons.lang3.StringUtils.join(variant.getMutationEffectPmids(), ", "));
Set<ArticleAbstract> articleAbstracts = variant.getMutationEffectAbstracts();
Set<String> abstracts = new HashSet<>();
for (ArticleAbstract articleAbstract : articleAbstracts) {
abstracts.add(articleAbstract.getAbstractContent());
}
setValue(row, "Abstracts", org.apache.commons.lang3.StringUtils.join(abstracts, ", "));
service.insert(feedUrl, row);
}
}
}
}
示例3: printTumorTypeSummary
import com.google.gdata.data.spreadsheet.WorksheetEntry; //导入方法依赖的package包/类
private static void printTumorTypeSummary(Set<Evidence> evidences, SpreadsheetService service, WorksheetEntry entry) throws IOException, ServiceException {
URL feedUrl = entry.getListFeedUrl();
if (evidences != null && service != null && entry != null) {
for (Evidence evidence : evidences) {
ListEntry row = new ListEntry();
setValue(row, "Gene", evidence.getGene().getHugoSymbol());
List<String> alterationNames = getAlterationNameByEvidence(evidence);
setValue(row, "Variants", MainUtils.listToString(alterationNames, ", "));
setValue(row, "CancerType", getCancerType(evidence.getOncoTreeType()));
setValue(row, "Summary", evidence.getDescription());
service.insert(feedUrl, row);
}
}
}
示例4: loadSheet
import com.google.gdata.data.spreadsheet.WorksheetEntry; //导入方法依赖的package包/类
/**
* Uses the user's creadentials to get a list of spreadsheets. Then asks the
* user which spreadsheet to load. If the selected spreadsheet has multiple
* worksheets then the user will also be prompted to select what sheet to use.
*
* @param reader to read input from the keyboard
* @throws ServiceException when the request causes an error in the Google
* Spreadsheets service.
* @throws IOException when an error occurs in communication with the Google
* Spreadsheets service.
*
*/
public void loadSheet(BufferedReader reader) throws IOException,
ServiceException {
// Get the spreadsheet to load
SpreadsheetFeed feed = service.getFeed(factory.getSpreadsheetsFeedUrl(),
SpreadsheetFeed.class);
List spreadsheets = feed.getEntries();
int spreadsheetIndex = getIndexFromUser(reader, spreadsheets,
"spreadsheet");
SpreadsheetEntry spreadsheet = (SpreadsheetEntry) spreadsheets
.get(spreadsheetIndex);
// Get the worksheet to load
if (spreadsheet.getWorksheets().size() == 1) {
listFeedUrl = spreadsheet.getWorksheets().get(0).getListFeedUrl();
} else {
List worksheets = spreadsheet.getWorksheets();
int worksheetIndex = getIndexFromUser(reader, worksheets, "worksheet");
WorksheetEntry worksheet = (WorksheetEntry) worksheets
.get(worksheetIndex);
listFeedUrl = worksheet.getListFeedUrl();
}
System.out.println("Sheet loaded.");
}
示例5: printEvidences
import com.google.gdata.data.spreadsheet.WorksheetEntry; //导入方法依赖的package包/类
private static void printEvidences(Set<Evidence> evidences, SpreadsheetService service, WorksheetEntry entry) throws IOException, ServiceException {
URL feedUrl = entry.getListFeedUrl();
if (evidences != null && service != null && entry != null) {
for (Evidence evidence : evidences) {
ListEntry row = new ListEntry();
setValue(row, "Level", evidence.getLevelOfEvidence().getLevel());
setValue(row, "Gene", evidence.getGene().getHugoSymbol());
List<String> alterationNames = getAlterationNameByEvidence(evidence);
setValue(row, "Variants", MainUtils.listToString(alterationNames, ", "));
setValue(row, "Disease", getCancerType(evidence.getOncoTreeType()));
Set<String> drugs = EvidenceUtils.getDrugs(Collections.singleton(evidence));
List<String> drugList = new ArrayList<>(drugs);
Collections.sort(drugList);
setValue(row, "Drugs", org.apache.commons.lang3.StringUtils.join(drugList, ", "));
Set<String> articles = EvidenceUtils.getPmids(Collections.singleton(evidence));
List<String> articleList = new ArrayList<>(articles);
Collections.sort(articleList);
setValue(row, "PMIDs", org.apache.commons.lang3.StringUtils.join(articleList, ", "));
setValue(row, "NumberOfPMIDs", Integer.toString(articleList.size()));
Set<String> abstractContent = getAbstractContentFromEvidence(evidence);
setValue(row, "Abstracts", org.apache.commons.lang3.StringUtils.join(abstractContent, ", "));
service.insert(feedUrl, row);
}
}
}
示例6: getListRows
import com.google.gdata.data.spreadsheet.WorksheetEntry; //导入方法依赖的package包/类
public List getListRows(Object worksheetEntryObject) throws Exception {
WorksheetEntry worksheet = (WorksheetEntry) worksheetEntryObject;
// Fetch the list feed of the worksheet.
URL listFeedUrl = worksheet.getListFeedUrl();
ListFeed listFeed = service.getFeed(listFeedUrl, ListFeed.class);
return listFeed.getEntries();
}
示例7: insertRow
import com.google.gdata.data.spreadsheet.WorksheetEntry; //导入方法依赖的package包/类
public ListEntry insertRow(WorksheetEntry worksheet, ListEntry rowEntry) throws IOException, ServiceException, URISyntaxException {
// Fetch the list feed of the worksheet.
URL listFeedUrl = worksheet.getListFeedUrl();
// Send the new row to the API for insertion.
return service.insert(listFeedUrl, rowEntry);
}
示例8: updateRow
import com.google.gdata.data.spreadsheet.WorksheetEntry; //导入方法依赖的package包/类
public ListEntry updateRow(WorksheetEntry worksheet, ListEntry rowEntry) throws IOException, ServiceException, URISyntaxException {
// Fetch the list feed of the worksheet.
URL listFeedUrl = worksheet.getListFeedUrl();
// Send the new row to the API for insertion.
return service.update(listFeedUrl, rowEntry);
}
示例9: getListFeedForWorksheet
import com.google.gdata.data.spreadsheet.WorksheetEntry; //导入方法依赖的package包/类
private ListFeed getListFeedForWorksheet(WorksheetEntry worksheet) throws IOException, ServiceException
{
URL listFeedUrl = worksheet.getListFeedUrl();
ListFeed cellFeed = spreadsheetService.getFeed(listFeedUrl, ListFeed.class);
return cellFeed;
}
示例10: deleteSpreadsheetsRow
import com.google.gdata.data.spreadsheet.WorksheetEntry; //导入方法依赖的package包/类
/**
* Deletes Google Spreadsheets row.
*
* @param context the context
* @param accountName the account name
* @param trackName the track name
* @return true if deletion is success.
*/
public static boolean deleteSpreadsheetsRow(
Context context, String accountName, String trackName) {
try {
// Get spreadsheet Id
List<File> files = searchSpreadsheets(context, accountName);
if (files == null || files.size() == 0) {
return false;
}
String spreadsheetId = files.get(0).getId();
// Get spreadsheet service
SpreadsheetService spreadsheetService = new SpreadsheetService(
"MyTracks-" + SystemUtils.getMyTracksVersion(context));
Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod());
credential.setAccessToken(
SendToGoogleUtils.getToken(context, accountName, SendToGoogleUtils.SPREADSHEETS_SCOPE));
spreadsheetService.setOAuth2Credentials(credential);
// Get work sheet
WorksheetFeed worksheetFeed = spreadsheetService.getFeed(new URL(
String.format(Locale.US, SendSpreadsheetsAsyncTask.GET_WORKSHEETS_URI, spreadsheetId)),
WorksheetFeed.class);
Iterator<WorksheetEntry> worksheetEntryIterator = worksheetFeed.getEntries().iterator();
while (worksheetEntryIterator.hasNext()) {
WorksheetEntry worksheetEntry = (WorksheetEntry) worksheetEntryIterator.next();
String worksheetTitle = worksheetEntry.getTitle().getPlainText();
if (worksheetTitle.equals(SPREADSHEETS_WORKSHEET_NAME)) {
URL url = worksheetEntry.getListFeedUrl();
Iterator<ListEntry> listEntryIterator = spreadsheetService.getFeed(url, ListFeed.class)
.getEntries().iterator();
while (listEntryIterator.hasNext()) {
ListEntry listEntry = (ListEntry) listEntryIterator.next();
String name = listEntry.getCustomElements().getValue(SPREADSHEETS_TRANCK_NAME_COLUMN);
if (name.equals(trackName)) {
listEntry.delete();
return true;
}
}
}
}
} catch (Exception e) {
Log.e(TAG, "Unable to delete spreadsheets row.", e);
}
return false;
}
示例11: createRecordInSpreadsheet
import com.google.gdata.data.spreadsheet.WorksheetEntry; //导入方法依赖的package包/类
/**
* Recording a copy of the information somebody used the Streetlight Seattle Reporter app to send to Seattle City Light.
* Google Docs approach inspired by: https://developers.google.com/google-apps/spreadsheets/#adding_a_list_row
* Spreadsheet viewable at: https://docs.google.com/spreadsheet/ccc?key=0AvDYc0olGEwRdE56dTlKMVVZdGYxQkc5eGJEQzJLNkE&usp=drive_web#gid=0
*
* @param parameters names and values from the activity; names are column headers in the spreadsheet.
* @throws AuthenticationException
* @throws MalformedURLException
* @throws IOException
* @throws ServiceException
*/
private void createRecordInSpreadsheet(List<NameValuePair> parameters)
throws AuthenticationException, MalformedURLException, IOException, ServiceException
{
String timeStamp = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(Calendar.getInstance().getTime());
parameters.add(new BasicNameValuePair("Date", timeStamp));
//parameters.remove(object)
SpreadsheetService service = new SpreadsheetService("CodeForSeattle-StreetlightSeattleReporter-v1");
// Authorize the service object for a specific user (see other sections)
final String user = "[email protected]";
final String pword = StringUtil.repeat(getString(R.string.app_initials), 3) + "333";
service.setUserCredentials(user, pword);
// Define the URL to request. This should never change.
URL SPREADSHEET_FEED_URL = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full");
// Make a request to the API and get all spreadsheets.
SpreadsheetFeed feed = service.getFeed(SPREADSHEET_FEED_URL, SpreadsheetFeed.class);
List<SpreadsheetEntry> spreadsheets = feed.getEntries();
if (spreadsheets.size() == 0) {
// There were no spreadsheets, act accordingly.
return;
}
SpreadsheetEntry spreadsheet = null;
for (SpreadsheetEntry s : spreadsheets)
{
String title = s.getTitle().getPlainText();
if (title.equals("StreetlightSeattleReporter"))
{
spreadsheet = s;
break;
}
if (spreadsheet == null) // Backup plan.
spreadsheet = spreadsheets.get(0);
}
// Get the first worksheet of the first spreadsheet.
WorksheetFeed worksheetFeed = service.getFeed(spreadsheet.getWorksheetFeedUrl(), WorksheetFeed.class);
List<WorksheetEntry> worksheets = worksheetFeed.getEntries();
WorksheetEntry worksheet = worksheets.get(0);
// Fetch the list feed of the worksheet.
URL listFeedUrl = worksheet.getListFeedUrl();
ListFeed listFeed = service.getFeed(listFeedUrl, ListFeed.class);
// Create a local representation of the new row.
ListEntry row = new ListEntry();
// Set the values of the new row.
for (NameValuePair param : parameters) {
String key = param.getName();
// Refrain from storing these 3 fields in the Google Docs spreadsheet.
if (key.equals("LastName") || key.equals("Phone") || key.equals("Email"))
continue;
row.getCustomElements().setValueLocal(key, param.getValue());
}
// Send the new row to the API for insertion.
row = service.insert(listFeedUrl, row);
}
示例12: getListFeed
import com.google.gdata.data.spreadsheet.WorksheetEntry; //导入方法依赖的package包/类
public static ListFeed getListFeed(TGSpreadConnection connection,
WorksheetEntry currentWorkSheet) throws SQLException {
ListQuery listQuery = new ListQuery(currentWorkSheet.getListFeedUrl());
return connection.getFeedProcessor().getFeed(listQuery, ListFeed.class);
}