def home(self): provider = atomixapi.Provider.all().filter("host =", request.host).get() if not provider: provider = atomixapi.Provider() provider.host = request.host provider.name = request.host + " Atomix Provider" provider.put() c.provider = provider return render('provider-home.mako')
def terms(self): import server.model.atomixapi as atomixapi key = db.Key.from_path("Item", "mixxim_terms_of_service_sept09_v1") item = db.get(key) if not item: item = atomixapi.Item(key_name="mixxim_terms_of_service_sept09_v1") item.title = "Terms of services for mixxim.com Atomix service, Sept 2009, v1" item.summary = "This item contains the detailed terms of services for the Atomix API of mixxim.com as of September 2009. Version 1." item.dataType = "types.atomix-api.com/api/terms" item.dataLang = "en" item.dataObject["version"] = "1" item.dataObject["locale"] = "en" item.dataObject["text"] = """ Mixxim.com terms of service!!! Lorem ipsum dolor sit amet.... Lorem ipsum dolor sit amet.... Lorem ipsum dolor sit amet.... Lorem ipsum dolor sit amet.... """ item.dataObject["html"] = """ <div> <h1>Mixxim.com terms of service!!!</h1> <p> Lorem ipsum dolor sit amet.... </p> <p> Lorem ipsum dolor sit amet.... </p> <p> Lorem ipsum dolor sit amet.... </p> <p> Lorem ipsum dolor sit amet.... </p> </div> """ item.content = item.dataObject["html"] item.put() c.item = item response.content_type = "application/atom+xml" return render('atomixapi-item.mako')
def accounts_create(self): item = atomixapi.parseItem(request.body) log.debug("item.data.name") log.debug(item.dataObject["name"]) accountname = item.dataObject["name"] newAccount = atomixapi.get_account(accountname) if newAccount: response.status = '400 Bad Request' response.content_type = 'text/plain' return "atomix.provider.createAccount.accountNameNotAvailable" else: newAccount = atomixapi.Account(name=accountname) newAccount.password = item.dataObject["password"] newAccount.put() c.account = newAccount response.content_type = "application/atom+xml" return render('provider-account.mako')
def notfound(self, accountname): log.debug("----------------notfound(self, accountname)") return render('account-notfound.mako')
def home(self, accountname): account = atomixapi.get_account(accountname) return render('account-home.mako')
def serviceDocument(self, accountname): response.content_type = "application/atom+xml" return render('account-serviceDocument.mako')