This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.essaytagger.model.BasicUser; | |
import com.essaytagger.model.Essay; | |
import com.essaytagger.server.impl.ObjectifyGenericDAO; | |
// ... | |
ObjectifyGenericDAO<BasicUser> basicUserDao = new ObjectifyGenericDAO<BasicUser>(); | |
BasicUser user = basicUserDao.get(userId); | |
ObjectifyGenericDAO<Essay> essayDao = new ObjectifyGenericDAO<Essay>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gdata.client.docs.DocsService; | |
import com.google.gdata.data.MediaContent; | |
import com.google.gdata.data.PlainTextConstruct; | |
import com.google.gdata.data.docs.DocumentListEntry; | |
import com.google.gdata.data.docs.DocumentListEntry.MediaType; | |
import com.google.gdata.data.media.MediaByteArraySource; | |
import com.google.gdata.data.media.MediaSource; | |
import com.google.gdata.util.ContentType; | |
// ...skipping to the good part... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DocumentListEntry uploadedEntry = uploadFile("/path/to/your/file.doc", "TitleToUse"); | |
System.out.println("Document now online @ :" + uploadedEntry.getHtmlLink().getHref()); | |
public DocumentListEntry uploadFile(String filepath, String title) | |
throws IOException, ServiceException { | |
File file = new File(filepath); | |
DocumentListEntry newDocument = new DocumentListEntry(); | |
String mimeType = DocumentListEntry.MediaType.fromFileName(file.getName()).getMimeType(); | |
newDocument.setFile(new File(filepath), mimeType); | |
newDocument.setTitle(new PlainTextConstruct(title)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.essaytagger.server.impl; | |
import com.essaytagger.model.Comment; | |
import com.essaytagger.model.Essay; | |
import com.essaytagger.server.IEssayManagerExtensions; | |
import com.google.appengine.api.datastore.EntityNotFoundException; | |
import com.googlecode.objectify.Key; | |
/** | |
* Implementation class for any Essay-specific methods that aren't already handled by ObjectifyGenericDAO<T>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cat oldCat = catDao.get(oldCatId); | |
Cat newCat = new Cat(); | |
newCat.setName("Whiskers"); | |
newCat.setOwner(oldCat.getOwner()); | |
catDao.save(newCat); // Causes Session conflict because Owner isn't initialized |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.essaytagger.web.user.administrator; | |
import java.io.IOException; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import org.apache.tiles.TilesContainer; | |
import org.apache.tiles.servlet.context.ServletUtil; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'visitor/_visitor_base.html' %} | |
{% block page_title %}About Us{% endblock %} | |
{% block page_headline_text %}About Us{% endblock %} | |
{% block page_content %} | |
This is the About Us text | |
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load url from future %} | |
<link href="{{ STATIC_URL }}css/facebook.css" type="text/css" rel="stylesheet" media="all" /> | |
{% include 'django_facebook/_facebook_js.html' %} | |
Register! | |
<form action="{% url 'facebook_connect' %}?facebook_login=1" method="post"> | |
<a href="javascript:void(0);" style="font-size: 20px;" onclick="F.connect(this.parentNode);">Login or register with facebook</a> | |
<input type="hidden" value="{% url 'my_post_registration_url' %}" name="register_next" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<style> | |
.page_overlay { | |
display: none; | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; |
OlderNewer