I would like to read all appointments from one user between some dates. And get from them the information about what, from when till when, which color (category) it has, the state if out of office.
I didn't found a sample which worked. Can you show me a sample for that.
I'm using win7 and EWS Java API 1.2 from MS
Use a CalendarView with a start and end date on the Calendar folder to get everything within a set date range. Place the properties you'd like in a PropertySet, set it in the CalendarView, and use ExchangeService.findAppointments() to get them:
CalendarView view = new CalendarView(startDate, endDate);
PropertySet p = new PropertySet(ItemSchema.Categories, AppointmentSchema.Start,
AppointmentSchema.End);
view.setPropertySet(p);
FindItemsResults<Appointment> find = service.findAppointments(
WellKnownFolderName.Calendar, view);
Iterate through the FindItemsResults and get what you need. I'm not sure if it's necessary, but various operations won't always return the information you need even if you request it with the PropertySet. If that's the case, then you'll need to use Appointment.load(PropertySet) or ExchangeService.loadPropertiesForItems(Items, PropertySet) to get them. I'm not sure what you mean by out of office on the Appointment itself. Do you mean the status of the Appoinment? The state as in province? By out of office, do you mean outside of the office of the user or if the user has a status of "Out of Office" (aka OOF) when the Appointment is scheduled?
Related
I am trying to get the modified content after the given time from google sheets. Nowhere I can found the api to get the data. What i can see is getting modified date alone from the drive Api. How can I get the data using Drive or Sheets Api? Give me the suggestions if Possible
Google Drive keeps a track of revision history of files that are contained on it. There is however, no way to obtain the revisions from a request alone.
Google allows for you to receive email notifications whenever a user makes an edit to your sheet, which you can set up by completing the following steps:
In the Spreadsheet's web view, click Tools -> Notification rules...
Under Notify me at myemail#address.ext when... select Any changes are made
Under Notify me with... select Email - right away
Click Save.
You should also be aware that you will not get a notification for edits made to the sheet by you - notifications are only received when another user edits the sheet. Whenever you get an email notification, you will receive a link to view the changes to the spreadsheet in the form of a read-only web view link.
You can work around this programatically, though there isn't one right way and it can be quite complicated. You can use the Revisions: list method of the Drive REST API to get the information about the user that made an edit, as well as a list of links which you can use to export that revision of the sheet to another MIME Type, as shown below in the request response.
Requesting:
GET https://www.googleapis.com/drive/v3/files/SPREADSHEET_ID/revisions
with revisions/exportLinks,revisions/lastModifyingUser/emailAddress as the fields field and replacing SPREADSHEET_ID with the ID of the spreadsheet will give you a 200 response:
{
"revisions": [
{
"lastModifyingUser": {
"emailAddress": "username#domain.ext"
},
"exportLinks": {
"application/x-vnd.oasis.opendocument.spreadsheet": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=revisionNumber&exportFormat=ods",
"text/tab-separated-values": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=revisionNumber&exportFormat=tsv",
"application/pdf": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=revisionNumber&exportFormat=pdf",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=revisionNumber&exportFormat=xlsx",
"text/csv": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=revisionNumber&exportFormat=csv",
"application/zip": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=revisionNumber&exportFormat=zip",
"application/vnd.oasis.opendocument.spreadsheet": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=1&exportFormat=ods"
}
}
]
}
With the links to individual changes, you can fetch and compare the different versions of the Sheet using Apps Script, and output A1 notation of the cells that have different values between versions. This, with the email address from the original Revisions: list request, is enough to compile a file or a log containing.
You can put this into a simple onEdit() trigger bound to the sheet will allow you to automatically get the changes each time a user edits the sheet.
I want to list the recently added songs,albums and artists on my application.
I can able to get the date of song by using this code.
cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DATE_ADDED))
May I know how to get the DATE ADDED of album and artist ?
Maybe the MediaMetadataRetriever can be of help here. With String extractMetadata(int keyCode) you can retrieve Metadata from a media file. For your application the keyCodes METADATA_KEY_DATE or METADATA_KEY_YEAR might be interesting.
METADATA_KEY_DATE gives you the time and date the file was last modified.
METADATA_KEY_YEAR gives the year the file was originally created (if this Information was added by the creator and not mdified by someone else)
You can find more Details here:
Adroid MediaMetadataRetriever
I must've gone through ever Stack Overflow question based on the Google Calendar so far with no luck what so ever. I've been trying this for hours now and got little to no results at all.
I'm a pretty new programmer with Java and Android, with quite little experience out of the field as it is. Basically the main problem I am having is with viewing another user's Google Calendar which is set to public.
At the moment, from the Google tutorials and other sites I've managed to get the calendar showing, which is pretty simple enough. It'll just load up and show the current user's calendar. Which can literally be done with (with a simple button in the layout).
public void onClick(View view) {
// A date-time specified in milliseconds since the epoch.
long startMillis = System.currentTimeMillis();
Uri.Builder builder = CalendarContract.CONTENT_URI.buildUpon();
builder.appendPath("time");
ContentUris.appendId(builder, startMillis);
Intent intent = new Intent(Intent.ACTION_VIEW).setData(builder.build());
startActivity(intent);
}
Obviously this doesn't pass in any user data for the public account or anything, I've been reading through the Calendar Provider Developer guides within the Google tutorials. I've tried to set up the account details thing, but it just never works. I've tried to do it as a Sync Adapter, but honestly I just know I'm not doing it right. I don't know if I really even need to use a Sync Adapter as all I want to do is literally see the events, not modify anything or update anything.
I am using API 14+ and want to user the Calendar Provider etc. It looks simple enough but I've been bashing my head against this for a few days and put a lot of hours into it and seemingly nothing I do works. At least I've got some sort of calendar opening but it's not what I want.
Is it all just down to the sync adapter? If so how will I be able to call a calendar? Another question similar had
private static Uri buildCalUri() {
return CalendarContract.Calendars.CONTENT_URI
.buildUpon()
.appendQueryParameter(CalendarContract.CALLER_IS_SYNCADAPTER, "true")
.appendQueryParameter(Calendars.ACCOUNT_NAME, ACCOUNT_NAME)
.appendQueryParameter(Calendars.ACCOUNT_TYPE, CalendarContract.ACCOUNT_TYPE_LOCAL)
.build();
}
I'm hoping this is something similar to what I need but I'm very unsure. In the developer tutorial ACCOUNT_TYPE_LOCAL was important if the account wasn't on the device
Any help will be greatly appreciated!
If you are looking to integrate the public Google Calendar (www.google.com/calendar) with your Android Application, you have to use the Google Calendar API.
The easiest method would be download the Google Calendar Client Library from here and then use the API Reference here. In the Client Library Page, you want to download "Google APIs Client Library for Java (rc)" package to integrate into your Android App.
You will first need to go to API Console to create an App with Calendar API Access .
If you do not want to use the native library, you can even do it using REST API (use HTTP GET & POST Commands), example App here
Hope this helps.
For anybody that has followed the Android Developer API example, but still can't find how to add a public calendar. Try out
CalendarListEntry gracieCal = new CalendarListEntry();
gracieCal.setId("your-public-calendar-id");
mService.calendarList().insert(gracieCal);
Events events = mService.events().list(gracieCal.getId())
.setMaxResults(10)
.setTimeMin(new DateTime(System.currentTimeMillis()))
.setOrderBy("startTime")
.setSingleEvents(true)
.execute();
List<Event> items = events.getItems();
'mService' is the com.google.api.services.calendar.Calendar instance that you should have already created. (see the api tutorials mentioned by the other answer)
'your-public-calendar-id' can be found in the settings for your public google calendar.
My client uses Lotus Notes for calendering. We have a need to serve event information on SharePoint. I'm trying to create an HTML link or button I can use in a custom display form on SharePoint (HTML) that users can click to add the event to their Notes calendars. So far, I've found no way to do this.
An app exists on my client's Domino deployment(?) that creates buttons for use in Notes email messages that also can collect response information. The action of this button is handled by what looks like Java to me. I've included a sample in case it's relevant, and I can include all of it if it looks like it would be helpful, but it's quite long:
Set CurDb=Session.CurrentDatabase
'Get mail file information from Location document using Notes.ini
MailServer$ = session.GetEnvironmentString( "MailServer",True)
MailFile$ = session.GetEnvironmentString( "MailFile",True)
'Set MailDB = session.CurrentDatabase
If CurDb.Server = "" Then
'Attempt to open local mail file
Set MailDB = session.GetDatabase("", MailFile$)
If Not MailDB.IsOpen Then
Set MailDB = New NotesDatabase(MailServer$, MailFile$)
If Not MailDB.IsOpen Then
Msgbox "Unable to add event to your calendar because your local and server mail file cannot be located.",16, "Notice"
Exit Sub
End If
End If
Else
'Attempt to open server replica of mail file
Set MailDB = New NotesDatabase(MailServer$, MailFile$)
If Not MailDB.IsOpen Then
Msgbox "Unable to add event to your calendar because your server mail file cannot be located.",16, "Notice"
Exit Sub
End If
End If
The same app can create a "web" version that can be added to our current intranet platform, but it uses what looks to me like a custom "hook" to interact with the button application and the user's calendar, and it has no function if not placed within an object on that platform. I include the snippet here in case it offers a clue:
<input type="button" onclick="SendEmailNotification('PTHN-132512')"
value="Send me a Notes Calendar Invitation" id="HTMLWebBtn">
I'm wondering if using the snippet elsewhere is as easy as linking to a .js file in my source, and am waiting to hear back from people managing the platform internally, but experience says this is a dead end.
Searching on the Googlybox has so far been basically fruitless. I know you can have a link open Lotus Notes by replacing the http:// with Notes:// followed by the server's name and the application/database/document address (usually a sometimes-really-long string of alphanumeric characters). And I found an article containing strings you can place after the Notes:// to open a new document in a given application, i.e., the email editor. But that's as close as I've come.
Any help, folks?
You can leverage the fact that Notes supports the .ics file format. When a ICS file is opened, Notes can respond by creating a new calendar entry. The best thing is that this works in other mail platforms too, in case your environment is mixed.
Here is some info on setting up Notes: http://www.ibm.com/developerworks/lotus/library/notes85-icalendar/
You can programmatically generate that ICS file, or if you're looking to just play around there are sites online that will generate one for you:
http://www.pratie.com/lab/icalendar/
I've got a website, and I want to add a welcoming message which hovers on a certain part of the page which only loads for the visitor for the first time they login, and won't again(presumably cookies used). And says something like "adjust your settings here.."
I don't want it to be an external popup but something that loads on the page in a certain area, defined by me (PX-pixle reference)
What would be the best coding language to do it in, oes anyone have any examples of this, or any site based generators to make it on?
thanks
Create one more field in database with lastlogin.
When user is created then make lastlogin field with special.
When user signs the next time from Login Page, update the field the lastlogin value to regular
//query to get value of lastlogin
//add css to elements you want to hover
<element class="<?php if($last-login == 'sepcial') { echo 'sepcialcss'; } else {echo 'regularcss'; }">
Done in PHP
As you added the tag, php would do this, actually any language will do.
Generally you have two ways to do this.
Do it on your server.
Do it on client's computer.
for the first way, you check the cookies and generate the page you want.
for the second way, you need to arrange the page the visitors see with java script.
way 1 recommended, coz it loads less bits. LOL
Update:
your server supports php right? the page, say it index.php, has a special area which is different when the visitors login the first time, right?
<?php
if (firstLogin()){
genSpecial();
}
else{
genRegular();
}
?>
in the funcition firstLogin(), you shall read the cookies and determine.
in the other two functions, just gen two different part, i.e. some html source code.
to your question, if you need to load some image, do it in genSpecial(). and if you choose the first way, js is not used to gen the special area, it's used only if in the special area, there needs some js.
It is possible through javascript. Once the user is shown the settings, store the result in a cookie valid for as long as you want. The next time the user logs in, verify if the cookie is set and then proceed.
Sample code to create cookies:
function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}
Refer this for more details on how to create and use cookies