Google Spreadsheet Java API - Protect Worksheet - java

Is it possible to programmatically protect a worksheet in a spreadsheet to only allow specific people to edit it?
I can't find any decent documentation or examples on how to do this. The only things I can find that may be relevant are the setRights()/getRights() and getContributors() methods in BaseEntry.java, which I don't think are any good, but I don't know because there's no documentation.
Is there are feed URL I can post to to update the list of contributors?
Thanks for any help.

Google-apps-script
Looks to be possible with Google-apps-script
https://developers.google.com/apps-script/reference/spreadsheet/sheet#setSheetProtection(PageProtection)
Gdata - spreadsheet api
there is nothing close to that in the spreadsheet api. Even basics
like set cell color or insert row don't exist. (there an append row)
It works fine for data and calculation but little else.

Related

poi PropertyTemplate.Extent vs BorderExtent

I'm just working with Borders using the POI library (Thank you for the amazing work!) and I've just discovered the PropertyTemplate. While going through the Quick Guide (https://poi.apache.org/spreadsheet/quick-guide.html#DrawingBorders) I wrote up the following:
propertyTemplate.drawBorders(range, borderType, color, extent);
While trying to fill in the extent following the quick-guide, it shows "PropertyTemplate.Extent.ALL" for example as a constant. When I try to match that, the PropertyTemplate.Extent does not exist.
I tried however with "BorderExtent.ALL" and that works. Is it just a typo in the quick-guide?
I looked for a way to contact them directly about the quick guide but I didn't want to go through all the mailling list or bug contribution sections just for an update on the website.
Does anyone know:
If BorderExtent.ALL (or any of the other constants) is correct or should it be PropertyTemplate.Extent.ALL and I'm doing something wrong?
Is there a way to notify the POI team to update the Quick-Guide without disturbing to many people?
Thank you!
Alex

How to detect changes in Google Spreadsheet? Java

The spreadsheet holds events and my code has a linked list of these events organized by date.
However my code only reads the spreadsheet once.
So if the spreadsheet is every changed (added a row, deleted a row) my code doesn't know.
I'd like my spreadsheet to somehow notify my code that a change has been made.
Else I guess the other option is to check for any changes once a day with something like a while loop.
Thanks!
There are 4 events as mentioned in official documentation on Google Developers Site, as follows
onOpen()
onEdit()
onChange()
onFormSubmit()
Update: These events are written in Google App Script and not in Java.

Adding new sheet to existing spreadsheet via Google sheets api v4

I've been facing an issue within adding a new sheet (tab) to existing spreadsheet.
Before the main issue, I will try to explain why I need to do such a thing and maybe there will be other solution. I'm trying to upload spreadsheet with several sheets. When sheets have smaller size, everything is ok. But when I do the "service.spreadsheets().create(spreadsheet).execute()" request with really big sheets (like two sheets with 40k cells), I get normal response, but created spreadsheet contains only empty "Untitled document" with empty tab. That's first thing which bothers me, why I don't receive something like "your insert is too big" or something like that.
So I would like to create spreadsheet, insert first tab (as a smaller request) and then add another tab (sheet) and so.. But what I only found over the stack and google documentation is "BatchUpdateSpreadsheetRequest". But this request doesn't allow me to add already created sheet, it just create new empty sheet, which is really annoying.
Do I miss some API call? Also I found over the documentation and stack some limits, but there is no clear info about how big can be requests with sheets (I've seen all the 400k rows, and what you can found here), but that didn't help a lot.
Can someone provide me info how to "split" spreadsheet creation into creating more smaller request so the created spreadsheet will contain all the data?
Thanks
The V4 API currently has a limit of 10MB of data per request, though I don't think we advertise this fact in the documentation anywhere right now.
To workaround, you can use multiple different requests in a BatchUpdateSpreadsheetRequest -- an AddSheetRequest as you mentioned, plus UpdateCellsRequest, or some number of other requests. Check out the guide that details what requests deal with what portions of the spreadsheet.
If you have specific portions of the spreadsheet you're curious about how to set, please follow up.

PDF Parsing tables in java with Pdfbox

i've been looking for quite long time for answer, but i haven't found anything.
My problem is in parsing pdf, i have page made with some kind of tables.
I've already written some code via which i can extract iformation from specified rectangle, but i am declaring those values in code and it is not dynamic as it should. I want to find information about cells and with this information i will be able to get those string which i will need. In PDFbox api i haven't found anything what could be useful.
I would be graceful for any tips.

Groovy - writing and formatting excel 2010

What are th options for working with an excel workbook from within a groovy (java) environment? We would like to be able to use the following features
add sheets
add cells: headings and data
format columns, rows, cells
and potentially
form pivot tables
copy the pivot table by value
paste clipboard by value on another screen
Essentially this will allow us to forma pivot table but remove the underlying data from the worksheet.
Thoughts? Thanks in advance.
Try apache poi. Can definitely perform your first list of requirements. I have used this api a good bit. If you have any questions, please feel free to ask.
Several Java libraries are available to handle the requirements you're looking for:
Apache POI
OpenOffice API
JExcelAPI
Jacob
...
Not sure which one can easily handle pivot tables.
Good luck with your project!
Wim
This page describes some more Groovy-specific options, but my recommendation would be to use Apache POI, either from Java or Groovy

Categories

Resources