[google-appengine] unterminated string literal
A javascript function fails to render because and object member(ingredients and directions) is of TextProperty type and includes a value with newlines/linebreaks. I've tried to format the value in the javascript function with no luck. Below is the page source. How do I resolve this? function editRecipe(recipe) { var form = document.getElementById("recipeform"); var dialog = document.getElementById("recipeform_dialog"); document.getElementById("recipeKey").value="ahNkZWxyYWVtYXJpZXNyZWNpcGVzcgwLEgZSZWNpcGUYBgw"; document.getElementById("recipeName").value="Mark"; document.getElementById("recipeCategory").value=getCategoryIndex("Dessert"); document.getElementById("recipeCuisine").value=getCuisineIndex("American"); document.getElementById("recipeOccasion").value=getOccasionIndex("Other"); document.getElementById("recipeServes").value="4"; document.getElementById("recipeIngredients").value="BOIL TO CRACK STAGE. 280 DEGREES 2 CUPS OF WHITE SUGAR 1 CUP OF WATER 3/4 CUP OF WHITE CORN SYRUP "; document.getElementById("recipeDirections").value="REMOVE AND ADD 1 TABLESPOON OF ANISE OIL. 10 DROPS OF RED FOOD COLORING. QUICKLY STIR TO MIX. POUR INTO BUTTERED PAN. WHEN COOLED BREAK INTO PIECES. "; --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: unterminated string literal
I understand that. The line of failure in my original posting was generated from this line: document.getElementById("recipeIngredients").value="{{recipe.ingredients}}"; recipe.ingredients is the value from a text area written to the database. The new lines are necessary for display. Can you provide a suggestion on how two resolve this? On Sep 8, 4:54 pm, Wooble <[EMAIL PROTECTED]> wrote: > This has nothing whatsoever to do with App Engine, but 2 seconds in > Google shows that if you want a multi-line string in Javascript you > can just put a \ at the end of each line. > > On Sep 8, 5:49 pm,thepopeofantelope<[EMAIL PROTECTED]> wrote: > > > A javascript function fails to render because and object > > member(ingredients and directions) is of TextProperty type and > > includes a value with newlines/linebreaks. I've tried to format the > > value in the javascript function with no luck. Below is the page > > source. > > > How do I resolve this? > > > function editRecipe(recipe) { > > var form = document.getElementById("recipeform"); > > var dialog = document.getElementById("recipeform_dialog"); > > > document.getElementById("recipeKey").value="ahNkZWxyYWVtYXJpZXNyZWNpcGVzcgwLEgZSZWNpcGUYBgw"; > > document.getElementById("recipeName").value="Mark"; > > > > > document.getElementById("recipeCategory").value=getCategoryIndex("Dessert"); > > > document.getElementById("recipeCuisine").value=getCuisineIndex("American"); > > > document.getElementById("recipeOccasion").value=getOccasionIndex("Other"); > > document.getElementById("recipeServes").value="4"; > > document.getElementById("recipeIngredients").value="BOIL TO CRACK > > STAGE. 280 DEGREES > > 2 CUPS OF WHITE SUGAR > > 1 CUP OF WATER > > 3/4 CUP OF WHITE CORN SYRUP > > > "; > > document.getElementById("recipeDirections").value="REMOVE AND ADD > > 1 TABLESPOON OF ANISE OIL. > > 10 DROPS OF RED FOOD COLORING. > > QUICKLY STIR TO MIX. > > POUR INTO BUTTERED PAN. > > WHEN COOLED BREAK INTO PIECES. > > > "; --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] porting from python to Java
I ported a GAE python project to Java and want to reuse the application ID and datastore is this possible? I want to avoid exporting data from the old project and importing into the new one. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Compilation failure for method with custom object param
I created the following class and want to use it between the client and server. I get this GWT compile error on the Service class: Compiling module com.test.GWTTEst Refreshing module from source Validating newly compiled units Removing units with errors [ERROR] Errors in 'file:/C:/GWTTEst/src/com/test/client/ RecipeServiceAsync.java' [ERROR] Line 7: No source code is available for type com.test.server.Recipe; did you forget to inherit a required module? [ERROR] Errors in 'file:/C:/GWTTEst/src/com/test/client/ RecipeService.java' [ERROR] Line 9: No source code is available for type com.test.server.Recipe; did you forget to inherit a required module? === package com.test.client; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; import com.test.server.Recipe; @RemoteServiceRelativePath("recipe") public interface RecipeService extends RemoteService { public void addStock(Recipe symbol) throws NotLoggedInException; public void removeStock(String symbol) throws NotLoggedInException; public String[] getStocks() throws NotLoggedInException; } == package com.test.server; import java.io.Serializable; import java.util.Date; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import com.google.appengine.api.users.User; import com.google.gwt.user.client.rpc.IsSerializable; @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Recipe implements IsSerializable { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private User user; @Persistent private String name; @Persistent private String category; @Persistent private String cuisine; @Persistent private String occasion; @Persistent private String ingredients; @Persistent private String directions; @Persistent private Date created; public Recipe() { } public Recipe(User user, String symbol) { this(); this.user = user; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCuisine() { return cuisine; } public void setCuisine(String cuisine) { this.cuisine = cuisine; } public String getIngredients() { return ingredients; } public void setIngredients(String ingredients) { this.ingredients = ingredients; } public String getDirections() { return directions; } public void setDirections(String directions) { this.directions = directions; } public String getOccasion() { return occasion; } public void setOccasion(String occasion) { this.occasion = occasion; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public Date getCreated() { return created; } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Compilation failure for method with custom object param
I was able to get this to work by moving my pojo to the client folder and adding detachable = "false" to the PersistenceCapable annontation. @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "false") This is a simple app and provides what I need. On Aug 4, 1:01 pm, Albert Attard wrote: > Hi: > You cannot access server classes from your client. You can access client > classes from your server. > > What you have to do is start using transfer objects. Here's an > article:http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObje... > > Let me know if you need more help. > Albert Attard > > Joan Crawford<http://www.brainyquote.com/quotes/authors/j/joan_crawford.html> > - "I, Joan Crawford, I believe in the dollar. Everything I earn, I > spend." > > 2009/8/4 thepopeofantelope > > > > > > > I created the following class and want to use it between the client > > and server. I get this GWT compile error on the Service class: > > > Compiling module com.test.GWTTEst > > Refreshing module from source > > Validating newly compiled units > > Removing units with errors > > [ERROR] Errors in 'file:/C:/GWTTEst/src/com/test/client/ > > RecipeServiceAsync.java' > > [ERROR] Line 7: No source code is available for type > > com.test.server.Recipe; did you forget to inherit a required module? > > [ERROR] Errors in 'file:/C:/GWTTEst/src/com/test/client/ > > RecipeService.java' > > [ERROR] Line 9: No source code is available for type > > com.test.server.Recipe; did you forget to inherit a required module? > > > === > > > package com.test.client; > > > import com.google.gwt.user.client.rpc.RemoteService; > > import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; > > import com.test.server.Recipe; > > > @RemoteServiceRelativePath("recipe") > > public interface RecipeService extends RemoteService { > > public void addStock(Recipe symbol) throws NotLoggedInException; > > public void removeStock(String symbol) throws NotLoggedInException; > > public String[] getStocks() throws NotLoggedInException; > > } > > > == > > > package com.test.server; > > > import java.io.Serializable; > > import java.util.Date; > > > import javax.jdo.annotations.IdGeneratorStrategy; > > import javax.jdo.annotations.IdentityType; > > import javax.jdo.annotations.PersistenceCapable; > > import javax.jdo.annotations.Persistent; > > import javax.jdo.annotations.PrimaryKey; > > > import com.google.appengine.api.users.User; > > import com.google.gwt.user.client.rpc.IsSerializable; > > > @PersistenceCapable(identityType = IdentityType.APPLICATION) > > public class Recipe implements IsSerializable { > > > �...@primarykey > > �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > > private Long id; > > �...@persistent > > private User user; > > �...@persistent > > private String name; > > �...@persistent > > private String category; > > �...@persistent > > private String cuisine; > > �...@persistent > > private String occasion; > > �...@persistent > > private String ingredients; > > �...@persistent > > private String directions; > > �...@persistent > > private Date created; > > > public Recipe() { > > > } > > > public Recipe(User user, String symbol) { > > this(); > > this.user = user; > > } > > > public User getUser() { > > return user; > > } > > > public void setUser(User user) { > > this.user = user; > > } > > > public String getName() { > > return name; > > } > > > public void setName(String name) { > > this.name = name; > > } > > > public String getCuisine() { > > return cuisine; > > } > > > public void setCuisine(String cuisine) { > > this.cuisine = cuisine; > > } > > > public String getIngredients() { > > return ingredients; > > } > > > public void setIngredients(String ingredients) { > > this.ingredients = ingre