- name = request.getHttpRequest().getPartAsStringFailsafe("name", 100);
- 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, requestUri, insertUri);
-
- /* log in the new Sone. */
- setCurrentSone(request.getToadletContext(), sone);
- throw new RedirectException("index.html");
- } catch (SoneException se1) {
- logger.log(Level.FINE, "Could not create Sone “%s” at (“%s”, “%s”), %s!", new Object[] { name, requestUri, insertUri, se1.getType() });
- if (se1.getType() == Type.INVALID_SONE_NAME) {
- template.set("errorName", true);
- } else if (se1.getType() == Type.INVALID_URI) {
- template.set("errorUri", true);
+ String id = request.getHttpRequest().getPartAsStringFailsafe("identity", 44);
+ OwnIdentity selectedIdentity = null;
+ for (OwnIdentity ownIdentity : ownIdentitiesWithoutSone) {
+ if (ownIdentity.getId().equals(id)) {
+ selectedIdentity = ownIdentity;
+ break;