From 94b116244de92c3535ea06c784af9bca1021ca87 Mon Sep 17 00:00:00 2001 From: Alfredo Aguirre Date: Wed, 30 May 2012 15:03:58 +0100 Subject: [PATCH] Incorporated latest version of Butter with the templates --- butter | 2 +- .../0017_auto__add_field_template_metadata.py | 148 ++++++++++++++++++ popcorn_gallery/popcorn/models.py | 3 +- popcorn_gallery/popcorn/tests/views_test.py | 37 ----- popcorn_gallery/popcorn/urls/api.py | 2 +- popcorn_gallery/popcorn/urls/projects.py | 2 + popcorn_gallery/popcorn/views/api.py | 66 ++++---- popcorn_gallery/popcorn/views/projects.py | 4 + .../templates/butter/default-butter/base.html | 2 +- .../butter/default-butter/config.cfg | 51 +----- .../templates/template/object_detail.html | 4 +- puppet/modules/nginx/manifests/init.pp | 11 ++ puppet/modules/nginx/templates/mime.types | 76 +++++++++ 13 files changed, 289 insertions(+), 119 deletions(-) create mode 100644 popcorn_gallery/popcorn/migrations/0017_auto__add_field_template_metadata.py delete mode 100644 popcorn_gallery/popcorn/tests/views_test.py create mode 100644 puppet/modules/nginx/templates/mime.types diff --git a/butter b/butter index 5f806e4..ec52b69 160000 --- a/butter +++ b/butter @@ -1 +1 @@ -Subproject commit 5f806e49f87f103d3de0b2e4dfc663913e5df9a5 +Subproject commit ec52b6907a1988f042eb61ac3450cf8361ef60b4 diff --git a/popcorn_gallery/popcorn/migrations/0017_auto__add_field_template_metadata.py b/popcorn_gallery/popcorn/migrations/0017_auto__add_field_template_metadata.py new file mode 100644 index 0000000..4f1aedf --- /dev/null +++ b/popcorn_gallery/popcorn/migrations/0017_auto__add_field_template_metadata.py @@ -0,0 +1,148 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding field 'Template.metadata' + db.add_column('popcorn_template', 'metadata', + self.gf('django.db.models.fields.TextField')(default=''), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Template.metadata' + db.delete_column('popcorn_template', 'metadata') + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'popcorn.project': { + 'Meta': {'ordering': "('is_featured', '-modified')", 'object_name': 'Project'}, + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), + 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['popcorn.ProjectCategory']", 'symmetrical': 'False', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'html': ('django.db.models.fields.TextField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_forkable': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_removed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_shared': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'metadata': ('django.db.models.fields.TextField', [], {}), + 'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'source': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['popcorn.Project']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}), + 'status': ('django.db.models.fields.IntegerField', [], {'default': '2'}), + 'template': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['popcorn.Template']", 'null': 'True', 'blank': 'True'}), + 'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), + 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '36', 'blank': 'True'}), + 'views_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'votes_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}) + }, + 'popcorn.projectcategory': { + 'Meta': {'object_name': 'ProjectCategory'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'slug': ('django_extensions.db.fields.AutoSlugField', [], {'allow_duplicates': 'False', 'max_length': '50', 'separator': "u'-'", 'blank': 'True', 'populate_from': "'name'", 'overwrite': 'False'}) + }, + 'popcorn.projectcategorymembership': { + 'Meta': {'unique_together': "(('user', 'project_category'),)", 'object_name': 'ProjectCategoryMembership'}, + 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}), + 'project_category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['popcorn.ProjectCategory']"}), + 'status': ('django.db.models.fields.IntegerField', [], {'default': '2'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['users.Profile']"}) + }, + 'popcorn.template': { + 'Meta': {'ordering': "('-is_featured', 'name')", 'object_name': 'Template'}, + 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['popcorn.TemplateCategory']", 'symmetrical': 'False', 'blank': 'True'}), + 'config': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'metadata': ('django.db.models.fields.TextField', [], {}), + 'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}), + 'status': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'template': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}), + 'views_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'votes_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}) + }, + 'popcorn.templatecategory': { + 'Meta': {'object_name': 'TemplateCategory'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'slug': ('django_extensions.db.fields.AutoSlugField', [], {'allow_duplicates': 'False', 'max_length': '50', 'separator': "u'-'", 'blank': 'True', 'populate_from': "'name'", 'overwrite': 'False'}) + }, + 'taggit.tag': { + 'Meta': {'object_name': 'Tag'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'taggit.taggeditem': { + 'Meta': {'object_name': 'TaggedItem'}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'taggit_taggeditem_tagged_items'", 'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'taggit_taggeditem_items'", 'to': "orm['taggit.Tag']"}) + }, + 'users.profile': { + 'Meta': {'object_name': 'Profile'}, + 'bio': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['popcorn.ProjectCategory']", 'through': "orm['popcorn.ProjectCategoryMembership']", 'symmetrical': 'False'}), + 'featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}), + 'website': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}) + } + } + + complete_apps = ['popcorn'] \ No newline at end of file diff --git a/popcorn_gallery/popcorn/models.py b/popcorn_gallery/popcorn/models.py index 53770d7..52e48d0 100644 --- a/popcorn_gallery/popcorn/models.py +++ b/popcorn_gallery/popcorn/models.py @@ -50,6 +50,7 @@ class Template(models.Model): choices=get_templates(extension='html')) config = models.CharField(max_length=255, choices=get_templates(extension='cfg')) + metadata = models.TextField(blank=True) thumbnail = models.ImageField(upload_to="templates", blank=True) is_featured = models.BooleanField(default=False) status = models.IntegerField(choices=STATUS_CHOICES, default=LIVE) @@ -112,7 +113,7 @@ class Project(models.Model): thumbnail = models.ImageField(upload_to="projects", blank=True) template = models.ForeignKey('popcorn.Template', blank=True, null=True) metadata = models.TextField() - html = models.TextField() + html = models.TextField(blank=True) status = models.IntegerField(choices=STATUS_CHOICES, default=HIDDEN) is_shared = models.BooleanField(default=False) is_forkable = models.BooleanField(default=False) diff --git a/popcorn_gallery/popcorn/tests/views_test.py b/popcorn_gallery/popcorn/tests/views_test.py deleted file mode 100644 index e7ba833..0000000 --- a/popcorn_gallery/popcorn/tests/views_test.py +++ /dev/null @@ -1,37 +0,0 @@ -from django.contrib.auth.models import User -from django.test import TestCase -from .fixtures import create_user, create_template -from ..models import Project, Template -from ..views.api import save_project - - -class PopcornViewsAPITest(TestCase): - - def tearDown(self): - for model in [Project, User, Template]: - model.objects.all().delete() - - def test_save_project(self): - template = create_template() - user = create_user('bob') - data = { - 'name': 'Hello World!', - 'template': template.name, - 'data': {"foo": "foo"}, - 'html': '', - } - response = save_project(data, user) - self.assertEqual(response['error'], 'okay') - self.assertEqual(Project.objects.all().count(), 1) - - def test_failed_project(self): - template = create_template() - user = create_user('bob') - data = { - 'name': 'Hello World!', - 'template': template.name, - 'html': '', - } - response = save_project(data, user) - self.assertEqual(response['error'], 'error') - self.assertEqual(Project.objects.all().count(), 0) diff --git a/popcorn_gallery/popcorn/urls/api.py b/popcorn_gallery/popcorn/urls/api.py index dd15ee0..07f397b 100644 --- a/popcorn_gallery/popcorn/urls/api.py +++ b/popcorn_gallery/popcorn/urls/api.py @@ -4,7 +4,7 @@ urlpatterns = patterns( 'popcorn_gallery.popcorn.views.api', url(r'^projects$', 'project_list', name='project_list'), - url(r'^project/null$', 'project_add', name='project_add'), + url(r'^project/$', 'project_add', name='project_add'), url(r'^project/(?P[-\w]+)$', 'project_detail', name='project_detail'), url(r'^publish/(?P[-\w]+)$', 'project_publish', name='project_publish'), url(r'^whoami$', 'user_details', name='user_details'), diff --git a/popcorn_gallery/popcorn/urls/projects.py b/popcorn_gallery/popcorn/urls/projects.py index d64fbb7..fef2e45 100644 --- a/popcorn_gallery/popcorn/urls/projects.py +++ b/popcorn_gallery/popcorn/urls/projects.py @@ -26,6 +26,8 @@ name='template_detail'), url(r'^template/(?P[\w-]+)/config$', 'template_config', name='template_config'), + url(r'^template/(?P[\w-]+)/data$', 'template_metadata', + name='template_metadata'), url(r'^template/(?P[\w-]+)/summary/$', 'template_summary', name='template_summary'), ) diff --git a/popcorn_gallery/popcorn/views/api.py b/popcorn_gallery/popcorn/views/api.py index d88ba0d..2030d1a 100644 --- a/popcorn_gallery/popcorn/views/api.py +++ b/popcorn_gallery/popcorn/views/api.py @@ -2,7 +2,7 @@ from django.conf import settings from django.core.serializers.json import DjangoJSONEncoder -from django.contrib.auth.decorators import login_required +from django.shortcuts import get_object_or_404 from django.views.decorators.http import require_POST, require_GET from django.http import HttpResponse, Http404 @@ -24,26 +24,13 @@ def project_list(request): mimetype='application/json') -def save_project(json_data, user): - """Helper to save the project""" - form = ProjectForm(json_data) - if form.is_valid(): - data = { - 'name': form.cleaned_data['name'], - 'metadata': form.cleaned_data['data'], - 'html': '', - 'author': user, - 'template': form.cleaned_data['template'], - } - project = Project.objects.create(**data) - response = { - 'error': 'okay', - 'project': project.butter_data, - } - else: - response = {'error': 'error', - 'form_errors': form.errors} - return response +def get_project_data(cleaned_data): + return { + 'name': cleaned_data['name'], + 'metadata': cleaned_data['data'], + 'html': '', + 'template': cleaned_data['template'], + } @require_POST @@ -51,7 +38,21 @@ def save_project(json_data, user): @login_required_ajax def project_add(request): """End point for adding a ``Project``""" - response = save_project(request.JSON, request.user) + form = ProjectForm(request.JSON) + if form.is_valid(): + data = get_project_data(form.cleaned_data) + data['author'] = request.user + project = Project.objects.create(**data) + response = { + 'error': 'okay', + 'project': project.butter_data, + 'url': project.get_absolute_url(), + } + else: + response = { + 'error': 'error', + 'form_errors': form.errors + } return HttpResponse(json.dumps(response, cls=DjangoJSONEncoder), mimetype='application/json') @@ -60,14 +61,25 @@ def project_add(request): @login_required_ajax def project_detail(request, uuid): """Handles the data for the Project""" + project = get_object_or_404(Project, uuid=uuid, author=request.user) if request.method == 'POST' and request.JSON: - response = save_project(request.JSON, request.user) + form = ProjectForm(request.JSON) + if form.is_valid(): + project.name = form.cleaned_data['name'] + project.metadata = form.cleaned_data['data'] + project.save() + response = { + 'error': 'okay', + 'project': project.butter_data, + 'url': project.get_absolute_url(), + } + else: + response = { + 'error': 'error', + 'form_errors': form.errors + } return HttpResponse(json.dumps(response, cls=DjangoJSONEncoder), mimetype='application/json') - try: - project = Project.objects.get(uuid=uuid, author=request.user) - except Project.DoesNotExist: - return Http404() response = { 'error': 'okay', # Butter needs the project metadata as a string that can be diff --git a/popcorn_gallery/popcorn/views/projects.py b/popcorn_gallery/popcorn/views/projects.py index 552aada..f8162be 100644 --- a/popcorn_gallery/popcorn/views/projects.py +++ b/popcorn_gallery/popcorn/views/projects.py @@ -291,3 +291,7 @@ def template_config(request, slug): context = {'template': template, 'object': None} return render(request, template.config, context) + +def template_metadata(request, slug): + template = get_template_or_404(slug) + return HttpResponse(template.metadata ,mimetype='application/json') diff --git a/popcorn_gallery/templates/butter/default-butter/base.html b/popcorn_gallery/templates/butter/default-butter/base.html index fb8bcf0..cd842fe 100644 --- a/popcorn_gallery/templates/butter/default-butter/base.html +++ b/popcorn_gallery/templates/butter/default-butter/base.html @@ -49,6 +49,6 @@

Area 2

- + diff --git a/popcorn_gallery/templates/butter/default-butter/config.cfg b/popcorn_gallery/templates/butter/default-butter/config.cfg index 6f62bcd..47f1b95 100644 --- a/popcorn_gallery/templates/butter/default-butter/config.cfg +++ b/popcorn_gallery/templates/butter/default-butter/config.cfg @@ -1,52 +1,5 @@ { "savedDataUrl": "data", - "name": "default-butter", - "snapshotHTMLOnReady": true, - "editor": { - "default": "{{ STATIC_URL }}editors/default-editor.html", - "googlemap": "{{ STATIC_URL }}editors/googlemap-editor.html" - }, - "ui": { - "trackEventHighlight": "click", - "title": "Butter 0.3" - }, - "plugin": { - "plugins": [ - { - "type": "footnote", - "path": "{{ STATIC_URL }}external/popcorn-js/plugins/footnote/popcorn.footnote.js" - }, - { - "type": "attribution", - "path": "{{ STATIC_URL }}external/popcorn-js/plugins/attribution/popcorn.attribution.js" - }, - { - "type": "image", - "path": "{{ STATIC_URL }}external/popcorn-js/plugins/image/popcorn.image.js" - }, - { - "name": "googlemap", - "type": "googlemap", - "path": "{{ STATIC_URL }}external/popcorn-js/plugins/googlemap/popcorn.googlemap.js" - } - ], - "defaults": [ - "footnote", - "image" - ] - }, - "icons": { - "default": "popcorn-icon.png", - "image": "image-icon.png" - }, - "dirs": { - "popcorn-js": "{{ STATIC_URL }}external/popcorn-js/", - "css": "{{ STATIC_URL }}css/", - "dialogs": "{{ STATIC_URL }}dialogs/", - "resources": "{{ STATIC_URL }}resources/" - }, - "mediaDefaults": { - "frameAnimation": true - } + "baseDir": "{{ STATIC_URL }}", + "name": "default-butter" } - diff --git a/popcorn_gallery/templates/template/object_detail.html b/popcorn_gallery/templates/template/object_detail.html index 320f540..384be2e 100644 --- a/popcorn_gallery/templates/template/object_detail.html +++ b/popcorn_gallery/templates/template/object_detail.html @@ -1,6 +1,5 @@ {% extends "base.html" %} {% import "includes/tags.html" as tags %} -{% import "includes/project_list.html" as project_macro %} {% block title %}{{ template.name }} - {{ super() }}{% endblock title %} @@ -56,6 +55,7 @@

Vote

Related Projects

-{{ project_macro.project_list(project_list, request.user, with_author=True) }} +{% set with_author = True %} +{% include "includes/project_list.html" %} {% endblock content %} diff --git a/puppet/modules/nginx/manifests/init.pp b/puppet/modules/nginx/manifests/init.pp index 14d242d..9946198 100644 --- a/puppet/modules/nginx/manifests/init.pp +++ b/puppet/modules/nginx/manifests/init.pp @@ -23,6 +23,17 @@ content => template("nginx/nginx.conf"), } + file { "/etc/nginx/mime.types": + path => "/etc/nginx/mime.types", + mode => 0644, + owner => root, + group => root, + ensure => file, + require => Package["nginx"], + notify => Service["nginx"], + content => template("nginx/mime.types"), + } + exec {"restart-nginx": command => "/etc/init.d/nginx restart", refreshonly => true, diff --git a/puppet/modules/nginx/templates/mime.types b/puppet/modules/nginx/templates/mime.types new file mode 100644 index 0000000..fc36c18 --- /dev/null +++ b/puppet/modules/nginx/templates/mime.types @@ -0,0 +1,76 @@ + +types { + text/html html htm shtml; + text/css css; + text/xml xml rss; + image/gif gif; + image/jpeg jpeg jpg; + application/x-javascript js; + application/atom+xml atom; + + text/mathml mml; + text/plain txt; + text/vnd.sun.j2me.app-descriptor jad; + text/vnd.wap.wml wml; + text/x-component htc; + + image/png png; + image/tiff tif tiff; + image/vnd.wap.wbmp wbmp; + image/x-icon ico; + image/x-jng jng; + image/x-ms-bmp bmp; + + application/java-archive jar war ear; + application/mac-binhex40 hqx; + application/msword doc; + application/pdf pdf; + application/postscript ps eps ai; + application/rtf rtf; + application/vnd.ms-excel xls; + application/vnd.ms-powerpoint ppt; + application/vnd.wap.wmlc wmlc; + application/vnd.wap.xhtml+xml xhtml; + application/x-cocoa cco; + application/x-java-archive-diff jardiff; + application/x-java-jnlp-file jnlp; + application/x-makeself run; + application/x-perl pl pm; + application/x-pilot prc pdb; + application/x-rar-compressed rar; + application/x-redhat-package-manager rpm; + application/x-sea sea; + application/x-shockwave-flash swf; + application/x-stuffit sit; + application/x-tcl tcl tk; + application/x-x509-ca-cert der pem crt; + application/x-xpinstall xpi; + application/zip zip; + + application/octet-stream bin exe dll; + application/octet-stream deb; + application/octet-stream dmg; + application/octet-stream eot; + application/octet-stream iso img; + application/octet-stream msi msp msm; + + audio/midi mid midi kar; + audio/mpeg mp3; + audio/x-realaudio ra; + + video/3gpp 3gpp 3gp; + video/mpeg mpeg mpg; + video/quicktime mov; + video/x-flv flv; + video/x-mng mng; + video/x-ms-asf asx asf; + video/x-ms-wmv wmv; + video/x-msvideo avi; + application/ogg ogx; + audio/ogg oga ogg spx; + video/ogg ogv; + video/webm webm; + audio/webm weba; + video/mp4 mp4; + audio/mpeg m4a; +}