Hardcode document name for Sone SSKs to “Sone”.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 23 Oct 2010 20:40:39 +0000 (22:40 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 23 Oct 2010 20:40:39 +0000 (22:40 +0200)
src/main/java/net/pterodactylus/sone/core/Core.java
src/main/java/net/pterodactylus/sone/web/CreateSonePage.java
src/main/resources/templates/include/createSone.html

index a3c8dc4..56e60d4 100644 (file)
@@ -322,7 +322,7 @@ public class Core extends AbstractService {
         *             if a Sone error occurs
         */
        public Sone createSone(String name) throws SoneException {
-               return createSone(name, "Sone-" + name, null, null);
+               return createSone(name, "Sone", null, null);
        }
 
        /**
index 901874c..f67cd56 100644 (file)
@@ -61,22 +61,17 @@ public class CreateSonePage extends SoneTemplatePage {
        protected void processTemplate(Request request, Template template) throws RedirectException {
                super.processTemplate(request, template);
                String name = "";
-               String documentName = null;
                String requestUri = null;
                String insertUri = null;
                if (request.getMethod() == Method.POST) {
                        name = request.getHttpRequest().getPartAsStringFailsafe("name", 100);
-                       documentName = request.getHttpRequest().getPartAsStringFailsafe("document-name", 96);
-                       if (documentName.trim().length() == 0) {
-                               documentName = "Sone-" + name;
-                       }
                        if (request.getHttpRequest().getParam("create-from-uri").length() > 0) {
                                requestUri = request.getHttpRequest().getPartAsStringFailsafe("request-uri", 256);
                                insertUri = request.getHttpRequest().getPartAsStringFailsafe("insert-uri", 256);
                        }
                        try {
                                /* create Sone. */
-                               Sone sone = webInterface.core().createSone(name, documentName, requestUri, insertUri);
+                               Sone sone = webInterface.core().createSone(name, "Sone", requestUri, insertUri);
 
                                /* log in the new Sone. */
                                setCurrentSone(request.getToadletContext(), sone);
index f2777c3..d812b1a 100644 (file)
@@ -1,7 +1,6 @@
 <script language="javascript">
        $(document).ready(function() {
                registerInputTextareaSwap("#sone #create-sone input[name=name]", "WebInterface.DefaultText.CreateSoneName", "name", false);
-               registerInputTextareaSwap("#sone #create-sone input[name=document-name]", "WebInterface.DefaultText.CreateSoneDocumentName", "document-name", false);
                registerInputTextareaSwap("#sone #create-sone input[name=insert-uri]", "WebInterface.DefaultText.CreateSoneInsertURI", "insert-uri", true);
                registerInputTextareaSwap("#sone #create-sone input[name=request-uri]", "WebInterface.DefaultText.CreateSoneRequestURI", "request-uri", true);
 
                <input type="text" name="name" value="<% name|html>"/>
        </div>
        <div>
-               <label for="document-name"><%= Page.Login.CreateSone.Label.DocumentName|l10n|html></label>
-               <input type="text" name="document-name" value="<% documentName|html>" />
-       </div>
-       <div>
                <button type="submit" name="create-random" value="1"><%= Page.Login.CreateSone.Button.CreateRandom|l10n|html></button>
        </div>
        <div class="advanced">