Browsing projects by Tag(s)

Select a tag to browse associated projects and drill deeper into the tag cloud.

Showing page 2 of 5

GAE Pseudo FS is a Python module, which allows you to store files in the Google Apps Engine datastore and to manage them. Overview Features

0
 
  0 reviews  |  0 users  |  0 current contributors  |  Analyzed 8 days ago
 
 

Google App Engine Virtual File System (GaeVFS)GaeVFS is an Apache Commons VFS plug-in that implements a distributed, writeable virtual file system for Google App Engine (GAE) for Java. GaeVFS is implemented using the GAE datastore and memcache APIs. The primary goal of GaeVFS is to provide a ... [More] portability layer that allows you to write application code to access the file system--both reads and writes--that runs unmodified in either GAE or non-GAE servlet environments. Start with the Using GaeVFS Wiki page to learn more about GaeVFS. NewsIMPORTANT! The datastore representation used by GaeVFS 0.3 is different and incompatible with the ones used by versions 0.2 and 0.1, and there is no automatic conversion mechanism. You must delete all of the GaeFileObject entities created by GaeVFS 0.1 or 0.2 before upgrading to version 0.3. Version 0.4 (not released yet) added GaeVfsServletEventListener to handle GaeVFS initialization automatically reworked metadata cache to no longer require thread local cache (negate issue #2); also, removed requirement for Commons VFS serialization patch moved H2 support to the gaevfs.jar and now register GaeVFS as an H2 file system plug-in rather than modifying H2 itself (a patch for H2 is still needed to prevent creation of the WriterThread) GaeFileObject.getPath() now returns a relative path from the webapp root added junit test cases July 21, 2009. Version 0.3 released. added support for files larger than 1 megabyte (fixed issue #1) added support for random access content and append file content capabilities don't use parent keys to model file/folder hierarchical relationships (revert back to original implementation using key lists within properties) GaeVFS.resolveFile() should not throw ServletException fixed issue #3: invoking FileObject.getChildren() on root directory includes the root directory in the returned array fixed issue #5: NPE within AbstractFileObject.finalize() switch to MANUAL caching strategy (versus ON_RESOLVE) added or updated javadocs for all source files June 26, 2009. Version 0.2 released. added support for the Combined Local Option added memcached-based metadata cache switched to parent-key implementation to manage hierarchical relationships (rather than storing child key list as parent property) fixed recursive deletes of directories fixed renaming of directories May 29, 2009. Version 0.1 released (first public release). DownloadThe latest version of GaeVFS can be found by clicking the Downloads tab. IMPORTANT! GaeVFS requires a modified version of Commons VFS 2.0, which is included with the GaeVFS download. The patch that implements these changes has been submitted for inclusion in the Commons VFS 2.0 release. GaeVFS also requires the following libraries (get the latest released versions unless otherwise noted): Dependency Required By Commons VFS 2.0 (see important note above) GaeVFS Commons Logging Commons VFS Commons Collections Commons VFS Commons FileUpload GaeVfsServlet Commons IO GaeVfsServlet Commons Lang GaeVfsServlet GaeVfsServletThe GaeVfsServlet, included within the GaeVFS jar file, demonstrates use of GaeVFS and the Commons VFS API, and provides some useful functionality of its own, including the ability to: upload files into GaeVFS serve files from GaeVFS (optionally) perform GaeVFS directory listings See the GaeVfsServlet javadocs or GaeVfsServlet source code for instructions on its use. The GaeVFS download package also contains an upload.html file that demonstrates uploading files via GaeVfsServlet. memcacheGaeVFS uses memcache to cache virtual file system metadata, but currently does not cache any file content. Use of memcache for file content caching is planned as a future enhancement. LimitationsThere are no file size limitations beginning with GaeVFS 0.3, which supports essentially unlimited file sizes. However, Google App Engine limits file uploads to 10 megabytes. Only a one thread at a time within a JVM is allowed to open a file for write access, however, there is currently no mechanism for locking files across multiple JVMs in a distributed environment. Therefore, it is possible that multiple threads within separate JVMs could be granted write access to the same file at the same time. GAE Datastore IndexesGaeVFS does not require defining any datastore indexes. Copyright 2009 New Atlanta Communications, LLC [Less]

0
 
  0 reviews  |  0 users  |  103,035 lines of code  |  0 current contributors  |  Analyzed almost 2 years ago
 
 

What is GoogleFileService?GoogleFileService is based on Google App Engine for Java, and its aim is to provide data models and APIs for uploading and downloading large files of each size is up to 10MB [1] to and from Google Datastore via HTTPS securely. Please visit the latest demo on Google App ... [More] Engine or download the Zip files of source codes to develop or run it yourself. Notice: GoogleFileService v0.3 supports appengine-java-sdk-1.2.1 ~ 1.2.6 now. Thanks Zhang Yu for fixing the bug of getGoogleFileById() to be compatible with the latest SDK. Key Features (What is New?)Jun 05, 2009. GoogleFileService v0.1 To break down barriers of the 1MB size limitation of each Google datastore entity, and extend singal file size up to 10MB. To send correct UTF-8 dowmloaded file name for different browsers such as IE, Firefox, and Google Chrome. To upload and download files via HTTPS securely. Jun 07, 2009. GoogleFileService v0.2 Add web management UI (Two roles as administrator or regular user. Only administrators can upload files.) Add uploading progress bar. [2] Nov 05, 2009. GoogleFileService v0.3 Add the setting in 'appengine-web.xml' to determine if only administrators can upload files. If not, then logged in users can just upload and delete their own files, while administrators can upload and delete files belong to any users. Fix the bug of getGoogleFileById() to be compatible with the latest SDK appengine-java-sdk-1.2.6. InstallationDownload the latest GoogleFileService Zip files of source codes. Locate GoogleFileService\war\WEB-INF\appengine-web.xml and modify the property 'upload.allowed-client-ip' value to be a list of IPs that can upload files via Apache HttpClient API (if required). Apply your account on Google App Engine for Java. Upload GoogleFileService source codes to Google App Engine for Java. (How to upload) Finally, you can try it on https://[your_app_id].appspot.com/ Getting StartedYou can upload your file via the webpage's form or via Apache HttpClient API. We handle uploaded file by using FileUploadServlet.java defined in web.xml as follows: upload sinica.googlefileservice.server.servlet.FileUploadServlet upload /upload 1. Webpage's form If you want to upload files via the webpage, please read as follows: Ensure the field names 'fileOwner', 'fileId', 'upfile' all exist, and the 'upfile' is the last one of these three fields to work correctly with Apache Commons FileUpload Streaming API. [Notice] Only logged in users can upload files. FileId:   FileObject: 2. Apache HttpClient If you want to upload files via other java application, please read as follows: You can use Apache 'commons-httpclient-3.1.jar' or 'httpclient-4.0-beta2.jar' to send HTTP POST data to Servlet as we do with the webpage's form. We write a convenient FileServiceClient.java to handle all the things for sending HTTP POST data, so you just need to create an instance of FileServiceClient and invoke submit() method. [Notice] Only allowed client IPs can upload files via Apache HttpClient API. Change WEB-INF/appengine-web.xml if required. // Google App Engine URL String url = "https://[your_app_id].appspot.com/upload"; // Create an instance of FileServiceClient for Google App Engine FileServiceClient client = FileServiceClientFactory.getFileServiceClient(url); // submit(String fileId, String fileOwner, String fileName, byte[] fileData, String contentType) int fileSize = client.submit(fileId, fileOwner, fileName, fileData, contentType);How It WorksWith GoogleFile and GoogleUnit data models (datastore), you can upload a large file of size up to 10 MB very easily via our static method DatastoreUtils.insertGoogleFile(). Some code of FileUploadServlet.java is as follows: String fileId = ""; String fileOwner = ""; String fileName = ""; int fileSize = -1; String contentType = ""; // Create a new file upload handler ServletFileUpload upload = new ServletFileUpload(); // Set overall request size constraint: the default value of -1 indicates that there is no limit. upload.setSizeMax(10240000); //10MB, the maximum allowed size, in bytes. // Set the UTF-8 encoding to grab the correct uploaded filename, especially for Chinese upload.setHeaderEncoding("UTF-8"); // Parse the request FileItemIterator iter = upload.getItemIterator(req); while (iter.hasNext()) { FileItemStream item = iter.next(); InputStream stream = item.openStream(); String fieldName = item.getFieldName(); if (item.isFormField()) { //process a regular form field if (fieldName.equals("fileId")) //set the UTF-8 encoding to grab the correct string fileId = Streams.asString(stream, "UTF-8"); if (fieldName.equals("fileOwner")) //set the UTF-8 encoding to grab the correct string fileOwner = Streams.asString(stream, "UTF-8"); } else { //process a file upload fileName = item.getName(); if (fileName != null) fileName= FilenameUtils.getName(fileName); contentType = item.getContentType(); if (fieldName.equals("upfile")) { // Check if the fileId conforms to the Key format of the Google datastore // and all other uploaded fields are not empty. if (DatastoreUtils.isKey(fileId) && fileOwner.length() > 0 && fileName.length() > 0) { // Save into Google datastore fileSize = DatastoreUtils.insertGoogleFile(fileId, fileOwner, fileName, contentType, stream); } } } }Known IssuesIf we submit a large file of size over 10 MB, then we'll receive a HTTP Error 413 Request Entity Too Large (Your client issued a request that was too large) from Google App Engine. The uploading progress bar works on local development server, but not works on Google App Engine. Questions or Suggestions? => GoogleFileService [Less]

0
 
  0 reviews  |  0 users  |  1,256 lines of code  |  0 current contributors  |  Analyzed 8 days ago
 
 

Implements a JDOQL-like query language for use with the Google App Engine (Java) datastore low-level API.

0
 
  0 reviews  |  0 users  |  202 lines of code  |  0 current contributors  |  Analyzed 3 days ago
 
 

intented mostly for small, "serverless" apps, for google app engine.

0
 
  0 reviews  |  0 users  |  148 lines of code  |  0 current contributors  |  Analyzed about 3 hours ago
 
 

CursorLogA Python script made with Google Apps Engine to record/log mouse cursor movements on a web page, store them and replay them later. Almost all cursor events are logged including 'mousedown', 'mouseup', and 'mousemove'. Mootools-powered. Demohttp://cursorlog.appspot.com/

0
 
  0 reviews  |  0 users  |  575 lines of code  |  0 current contributors  |  Analyzed 3 days ago
 
 
Compare

Google App Engine for Java only supports JDO and JPA as standard protocols for data persistence. However many Java programmers are used to JDBC as the preferred protocol. Applications requiring JDBC support can now turn to jiql. jiql is a JDBC wrapper of the lower level Google DataStore APIs thus ... [More] providing a familiar way to utilize Google's BigTable. So a Java application, using standard JDBC calls to the jiql JDBC client, is able to store critical data in GBT. jiql can also be used for querying Data persisted by other protocols, such as JDO or JPA. And jiql can be configured for remote access via the JiqlServlet. The jiql website is located at http://www.jiql.org [Less]

0
 
  0 reviews  |  0 users  |  21,356 lines of code  |  0 current contributors  |  Analyzed 3 days ago
 
 

This project is a framework for storing entities larger than 1MB using the Google App Engine low-level datastore API. MindashDatastoreService.java is a plug and play replacement for DatastoreService.java provided by Google. It uses DatastoreService under the hood and abstracts all the maintenance ... [More] related to storing large entities. If you can upload / create it in memory, you'll be able to store it in the Datastore. Additionally, Mindash Datastore implementation removes the 500 put / delete and 1000 get limits (see DatastoreHelperImpl.java). Tests are included so you can see the extent to which the implementations have been tested. Source code comments are enabled for everyone. Alpha release 0.7 com.mindash.datastore-0.7-src.jar implements the DatastoreService interface with added EntityCorruptException (see below). Transactions, queries, and get(Iterable) & put(Iterable) have not yet been extensively tested, hence the Alpha release. The preparation of queries as QueryResultIterable has not yet been implemented. The project is dependent on AppEngine SDK 1.3.0 and JUnit4. Other dependencies are included in the lib folder. public interface MindashDatastoreService { public static String MindashNamePrefixLabel = "mdd"; public static String MindashShardCountLabel = "mddx"; public static int MindashInitialEntityOverheadSize = 1024; public static int MindashEntityMaximumSize = 1024 * 1024; public static int MindashAssumedPropertyOverhead = 128; public KeyRange allocateIds(Key parent, String kind, long num); public KeyRange allocateIds(String kind, long num); public Transaction beginTransaction(); public void delete(Key... keys); public void delete(Transaction txn, Key... keys); public void delete(Transaction txn, Iterable keys); public void delete(Iterable keys); public Entity get(Key key) throws EntityNotFoundException, EntityCorruptException; public Entity get(Transaction txn, Key key) throws EntityNotFoundException, EntityCorruptException; public Map get(Transaction txn, Iterable keys) throws EntityCorruptException; public Map get(Iterable keys) throws EntityCorruptException; public Collection getActiveTransactions(); public Transaction getCurrentTransaction(); public Transaction getCurrentTransaction(Transaction txn); public MindashPreparedQuery prepare(Query query); public MindashPreparedQuery prepare(Transaction txn, Query query); public Key put(Entity entity); public Key put(Transaction txn, Entity entity); public List put(Transaction txn, Iterable entities); public List put(Iterable entities); }public interface MindashPreparedQuery { public Iterable asIterable(); public Iterable asIterable(FetchOptions fetchOptions); public Iterator asIterator(); public Iterator asIterator(FetchOptions fetchOptions); public List asList(FetchOptions fetchOptions); public QueryResultIterable asQueryResultIterable() throws NotImplementedException; public QueryResultIterable asQueryResultIterable(FetchOptions fetchOptions) throws NotImplementedException; public QueryResultIterator asQueryResultIterator() throws NotImplementedException; public QueryResultIterator asQueryResultIterator(FetchOptions fetchOptions) throws NotImplementedException; public QueryResultList asQueryResultList(FetchOptions fetchOptions) throws NotImplementedException; public Entity asSingleEntity() throws TooManyResultsException; public int countEntities(); } [Less]

0
 
  0 reviews  |  0 users  |  2,296 lines of code  |  0 current contributors  |  Analyzed 7 days ago
 
 

This self-contained tool enables incremental synchronization of your data from Google AppEngine's Datastore to a local SQLite 3 database. It will automatically convert your model definitions into an SQL schema, and download the model data in parallel using the new remote_api. Synchronization ... [More] is currently unidirectional (i.e. Datastore to SQLite, not the other way around) due to a lack of need, and also at least one technical limitation. IntroductionThere are still many data processing tasks that aren't possible on AppEngine, to which a traditional SQL database is ideally suited. These include driving a full text indexer, running reports that aggregate complex statistics in multiple dimensions from your data, or asking ad-hoc questions that your application's counters weren't designed to support. This utility solves these problems, while enabling many more applications to integrate with your data with minimal time and effort. An SQL schema is automatically generated by introspecting the model classes defined in your application's source code, into which new and updated entities are automatically fetched with a single command. The database may be used for running interactive queries using one of the many free GUI management tools, or even hooking up to Microsoft Excel via ODBC. Additionally, by configuring a cron job it is possible to mirror your entire Datastore to an external location, for consumption by external software (for example, full text indexing, automated reporting and analysis, etc.) How This WorksThe magic __key__ property is used to search for new immutable entities, while any Model subclasses that define at least one DateTimeProperty with auto_now=True will be automatically re-fetched every time they are modified. This means that you gain completely hands-free replication to an effortlessly accessible SQL database simply by including a single DateTimeProperty in each of your mutable models. Model → SQL Schema MappingAll identifiers are mapped like so: ModelClassName → model_class_name, and ModelClassName.propertyName → model_class_name_property_name. The current code generates the following SQL objects: One TABLE for each Model subclass, containing a unique integer (id) and string-encoded Datastore Key. One TABLE for each property of each Model, containing an integer (class_name_id) and the actual value column (value). One VIEW for each Model, defined as a SELECT which joins together all the other tables into a single combined "SQL like" table. This is the most useful object. This design was chosen to make it trivial to add and drop columns on large data sets, without having to wait for large ALTER TABLE commands to run. It also makes it easier to define custom VIEWs on just the subset of your data you need. Type Mapping SQL Type Datastore Native Type TEXT Key, ByteString, !IM, User, GeoPt, PhoneNumber, !Email, etc. (all simple text fields) TIMESTAMP datetime, date, time INTEGER int, long, Rating REAL float ExampleThe following model: class Address(db.Model): careOf = db.StringProperty() line1 = db.StringProperty() line2 = db.StringProperty() lastUpdated = db.DateTimeProperty(auto_now=True)Would be mapped to: CREATE TABLE address_entity(id INTEGER PRIMARY KEY, ds_key TEXT NOT NULL); CREATE TABLE address_care_of(address_entity_id INT NOT NULL, value TEXT); CREATE TABLE address_line1(address_entity_id INT NOT NULL, value TEXT); CREATE TABLE address_line2(address_entity_id INT NOT NULL, value TEXT); CREATE TABLE address_last_updated(address_entity_id INT NOT NULL, value TIMESTAMP); CREATE UNIQUE INDEX address_entity_ds_key_index ON address_entity(ds_key); CREATE UNIQUE INDEX address_care_of_address_entity_id_index ON address_care_of(address_entity_id); CREATE UNIQUE INDEX address_line1_address_entity_id_index ON address_line1(address_entity_id); CREATE UNIQUE INDEX address_line2_address_entity_id_index ON address_line2(address_entity_id); CREATE UNIQUE INDEX address_last_updated_address_entity_id_index ON address_last_updated(address_entity_id); CREATE VIEW address AS SELECT address_entity.id AS __id, address_entity.ds_key AS __ds_key, address_care_of.value AS care_of, address_line1.value AS line1, address_line2.value AS line2, address_last_updated.value AS last_updated FROM address_entity LEFT JOIN address_care_of ON (address_care_of.address_entity_id = address_entity.id) LEFT JOIN address_line1 ON (address_line1.address_entity_id = address_entity.id) LEFT JOIN address_line2 ON (address_line2.address_entity_id = address_entity.id) LEFT JOIN address_last_updated ON (address_last_updated.address_entity_id = address_entity.id) -- Example query: SELECT COUNT(*) FROM address WHERE line1 LIKE '1 Infinite Loop%'UsageUsage: dsync.py [options] Options: -a AppEngine application name, e.g. "shell" -e Developer's e-mail address (default: prompt) -p Developer's password (default: prompt) -r remote_api path on server (default "/remote_api") -L Prepend extra path to module search path -m Load Model classes from module -d Local database path (default "./models.sqlite3") -x Exclude the given Model class -N Number of fetch worker threads (default: 5) -C Number of entities to fetch per request (default: 50) -v Verbose/debug output --batch Fail rather than prompt for a password if none is provided on the command line. --sdk-path= Path to AppEngine SDK (default: search). --trigger-cmd=":command" Arrange for the given system command to be executed after new or updated entities whose class matches ModelGlob fetched (glob may contain * and ?). --trigger-sql=":SQL STATEMENT" Arrange for the given SQL statement to be executed after new or updated entities whose class matches ModelGlob fetched (glob may contain * and ?). --help This message. Commands: sync-model Synchronize the database schema to match the loaded Model subclasses. fetch Start fetching data from Datastore to the database, synchronizing its schema if necessary. orphaned List properties and tables that no longer have associated definitions in the loaded Model classes. prune Remove properties and tables from local database that no longer have associated definitions in the loaded Model classes. Check "orphaned" output first to verify this won't result in data loss! Example: Backup "myapp.appspot.com"'s datastore to $HOME/myapp.db except for RemoteUrlCacheEntry: dsync.py -L $HOME/src -m myapp.models -m myapp.counters \ -d $HOME/myapp.db -x RemoteUrlCacheEntry \ -a myapp -e me@gmail.com -p 1234 \ fetchKnown IssuesThis code represents about 10 hours worth of work; it's still at a very early stage. Please see the issue tracker for a more definitive list of issues, but most importantly right now: With high worker thread counts, SQLite locks timeout. Not well tested. Only supports SQLite; PostgreSQL support would be great for very large data sets. I will be productionizing the code in the coming months, but if you come across a major issue, please tell me about it. ConfigurationLocal SystemBefore using the utility, you must have Python 2.5 and the Google AppEngine SDK installed on your working machine, along with a copy of your site's source code. The source code is currently necessary for introspecting your application's Datastore schema. The utility searches for the SDK in the default locations for Windows and OS X. If you have changed the install path for the SDK, you will need to specify it using a command line parameter. After completing these steps, you must configure a remote_api URI for your site as shown below. Application ChangesSimply add the following to app.yaml in your project directory: handlers: - url: /remote_api script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py login: adminIt is recommended that you use the URI shown above, however you can specify an alternative using a command-line parameter if you desire. This enables the remote_api handler built into AppEngine, which you can read more about here. Creating A Sync ScriptIt is recommended that you create a batch file or UNIX shell script to save the settings used for launching the utility. This helps reduce the potential for human error cropping up (for example, missing a library path). The main tasks required for this are picking a stable location for your site's source code, say, $HOME/src/my-site (or %USERPROFILE%\my-site for Windows users), and figuring out which modules in your source code contain Datastore model definitions. This will be easier if you use only a single file for declaring models. Here is an example sync script written in bash. It will prompt for me@gmail.com's password at startup, or you can hard-code it using the -p option. #!/bin/bash EMAIL=me@gmail.com APPNAME=mysite # mysite.appspot.com SOURCE_DIR=$HOME/src/my-site DATABASE_PATH=$HOME/data/my-site.sqlite3 TRIG="Member:$HOME/bin/index-new-members.sh" dsync.py \ -L $SOURCE_DIR \ -m my_site.models \ # Equivalent to $SOURCEDIR/my_site/models.py -m my_site.counter \ -a $APPNAME \ -e $EMAIL \ -N 5 \ # Start 5 worker threads. --trigger-cmd="$TRIG" \ # Trigger indexing when a new member joins. fetchStart Syncing$ ./my-sync-script.sh INFO:root:Server: my-site.appspot.com INFO:root:Session done: 1 added, 0 updated. INFO:root:Room done: 1 added, 0 updated. INFO:root:Invitation done: 2 added, 0 updated. INFO:root:Video done: 5 added, 0 updated. INFO:root:Item done: 5 added, 0 updated. INFO:root:Member done: 2 added, 0 updated. INFO:root:grand total: 1.73s for 16 added, 0 updated in 13 models. $ $ ./my-sync-script.sh INFO:root:Server: my-site.appspot.com INFO:root:grand total: 0.97s for 0 added, 0 updated in 13 models.If all has gone well, you should now have a local SQLite copy of your Datastore! Run Some Queries$ sqlite3 $HOME/data/my-site.sqlite3 SQLite version 3.5.7 Enter ".help" for instructions sqlite> .mode column sqlite> SELECT COUNT(*) FROM session; COUNT(*) ---------- 1 sqlite> SELECT session_id, display_name, last_seen, last_address, expiry_time, first_seen FROM session; session_id display_name last_seen last_address expiry_time first_seen -------------------------------- ------------ ------------------- -------------- ----------- ------------------- 0ed373e4a697d2fed5b7e6b00f462423 Anonymous 2009-02-24 15:02:45 80.127.152.220 2009-02-24 12:16:03Feed A Starving Hacker! [Less]

0
 
  0 reviews  |  0 users  |  677 lines of code  |  0 current contributors  |  Analyzed 4 days ago
 
 

Membership management project using Java Datastore

0
 
  0 reviews  |  0 users  |  638 lines of code  |  0 current contributors  |  Analyzed 12 months ago
 
 
 
 

Creative Commons License Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.