java/code/src/com/redhat/rhn/domain/kickstart/crypto/CryptoKey.hbm.xml | 7 ++ java/code/src/com/redhat/rhn/domain/kickstart/crypto/CryptoKey.java | 4 - java/code/src/com/redhat/rhn/domain/kickstart/crypto/GpgCryptoKey.java | 30 ++++++++++ java/code/src/com/redhat/rhn/domain/kickstart/crypto/SslCryptoKey.java | 30 ++++++++++ java/code/webapp/WEB-INF/pages/keys/key-form.jspf | 18 ++++-- java/spacewalk-java.spec | 7 ++ rel-eng/packages/spacewalk-java | 2 7 files changed, 88 insertions(+), 10 deletions(-)
New commits: commit 9448105bac79ef0cec4ef62a274cb8c8b50205d1 Author: Tomas Lestach tlestach@redhat.com Date: Thu Jan 24 16:53:19 2013 +0100
Automatic commit of package [spacewalk-java] release [1.9.53-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec index 53397db..a0c486f 100644 --- a/java/spacewalk-java.spec +++ b/java/spacewalk-java.spec @@ -28,7 +28,7 @@ Name: spacewalk-java Summary: Spacewalk Java site packages Group: Applications/Internet License: GPLv2 -Version: 1.9.52 +Version: 1.9.53 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -659,6 +659,11 @@ fi %{jardir}/postgresql-jdbc.jar
%changelog +* Thu Jan 24 2013 Tomas Lestach tlestach@redhat.com 1.9.53-1 +- do not allow changing type of an existing crypto key on CryptoKeyEdit.do page +- simplify CryptoKey isSSL() and isGPG() methods +- introducing SslCryptoKey and GpgCryptoKey + * Wed Jan 23 2013 Tomas Lestach tlestach@redhat.com 1.9.52-1 - add extra space to error message - 902673 - tell the user about restricted period, when notifying about diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java index c98dd84..fa95c23 100644 --- a/rel-eng/packages/spacewalk-java +++ b/rel-eng/packages/spacewalk-java @@ -1 +1 @@ -1.9.52-1 java/ +1.9.53-1 java/
commit bfc0ae71a342947e4f24e251303f29f8b05b4c7a Author: Tomas Lestach tlestach@redhat.com Date: Thu Jan 24 16:02:36 2013 +0100
do not allow changing type of an existing crypto key on CryptoKeyEdit.do page
diff --git a/java/code/webapp/WEB-INF/pages/keys/key-form.jspf b/java/code/webapp/WEB-INF/pages/keys/key-form.jspf index 08b472e..06413c3 100644 --- a/java/code/webapp/WEB-INF/pages/keys/key-form.jspf +++ b/java/code/webapp/WEB-INF/pages/keys/key-form.jspf @@ -12,12 +12,18 @@ <bean:message key="keycreate.jsp.type"/> </th> <td> - <html:select property="type"> - <html:options collection="types" - property="value" - labelProperty="label" /> - </html:select> - + <c:choose> + <c:when test="${cryptoKey.id != null}"> + <c:out value="${cryptoKey.cryptoKeyType.label}"/> + </c:when> + <c:otherwise> + <html:select property="type"> + <html:options collection="types" + property="value" + labelProperty="label" /> + </html:select> + </c:otherwise> + </c:choose> </td> </tr> <tr>
commit 213026e87afc2815ed72c484a04e860bb7a8c9be Author: Tomas Lestach tlestach@redhat.com Date: Thu Jan 24 15:54:41 2013 +0100
simplify CryptoKey isSSL() and isGPG() methods
diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/crypto/CryptoKey.java b/java/code/src/com/redhat/rhn/domain/kickstart/crypto/CryptoKey.java index a8fdb5b..295a43c 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/crypto/CryptoKey.java +++ b/java/code/src/com/redhat/rhn/domain/kickstart/crypto/CryptoKey.java @@ -87,7 +87,7 @@ public class CryptoKey implements Identifiable { * @return true if this is a SSL key */ public boolean isSSL() { - return this.getCryptoKeyType().getLabel().equals("SSL"); + return false; }
/** @@ -95,7 +95,7 @@ public class CryptoKey implements Identifiable { * @return if this is a GPG key */ public boolean isGPG() { - return this.getCryptoKeyType().getLabel().equals("GPG"); + return false; }
/** diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/crypto/GpgCryptoKey.java b/java/code/src/com/redhat/rhn/domain/kickstart/crypto/GpgCryptoKey.java index b145ef1..e916b29 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/crypto/GpgCryptoKey.java +++ b/java/code/src/com/redhat/rhn/domain/kickstart/crypto/GpgCryptoKey.java @@ -20,5 +20,11 @@ package com.redhat.rhn.domain.kickstart.crypto; * @version $Rev$ */ public class GpgCryptoKey extends CryptoKey { - + /** + * + * @return if this is a GPG key + */ + public boolean isGPG() { + return false; + } } diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/crypto/SslCryptoKey.java b/java/code/src/com/redhat/rhn/domain/kickstart/crypto/SslCryptoKey.java index 7132e5c..84899b6 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/crypto/SslCryptoKey.java +++ b/java/code/src/com/redhat/rhn/domain/kickstart/crypto/SslCryptoKey.java @@ -20,5 +20,11 @@ package com.redhat.rhn.domain.kickstart.crypto; * @version $Rev$ */ public class SslCryptoKey extends CryptoKey { - + /** + * + * @return true if this is a SSL key + */ + public boolean isSSL() { + return true; + } }
commit 0378f0ea82403c33f0955cac74c21ad2f8ebe170 Author: Tomas Lestach tlestach@redhat.com Date: Thu Jan 24 14:17:08 2013 +0100
introducing SslCryptoKey and GpgCryptoKey
diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/crypto/CryptoKey.hbm.xml b/java/code/src/com/redhat/rhn/domain/kickstart/crypto/CryptoKey.hbm.xml index 031b90d..b3bc625 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/crypto/CryptoKey.hbm.xml +++ b/java/code/src/com/redhat/rhn/domain/kickstart/crypto/CryptoKey.hbm.xml @@ -11,6 +11,7 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" <param name="sequence">RHN_CRYPTOKEY_ID_SEQ</param> </generator> </id> + <discriminator formula="(SELECT type.label FROM rhnCryptoKeyType type WHERE type.id = crypto_key_type_id)" type="java.lang.String" /> <property name="description" column="description" not-null="true" type="string" length="1024" /> <property name="key" column="key" type="binary" />
@@ -22,6 +23,12 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" class="com.redhat.rhn.domain.kickstart.crypto.CryptoKeyType" column="crypto_key_type_id"/>
+ <subclass name="com.redhat.rhn.domain.kickstart.crypto.SslCryptoKey" + discriminator-value="SSL"> + </subclass> + <subclass name="com.redhat.rhn.domain.kickstart.crypto.GpgCryptoKey" + discriminator-value="GPG"> + </subclass> </class> <query name="CryptoKey.findByDescAndOrg"> <![CDATA[from com.redhat.rhn.domain.kickstart.crypto.CryptoKey as c diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/crypto/GpgCryptoKey.java b/java/code/src/com/redhat/rhn/domain/kickstart/crypto/GpgCryptoKey.java new file mode 100644 index 0000000..b145ef1 --- /dev/null +++ b/java/code/src/com/redhat/rhn/domain/kickstart/crypto/GpgCryptoKey.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2013 Red Hat, Inc. + * + * This software is licensed to you under the GNU General Public License, + * version 2 (GPLv2). There is NO WARRANTY for this software, express or + * implied, including the implied warranties of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 + * along with this software; if not, see + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. + * + * Red Hat trademarks are not licensed under GPLv2. No permission is + * granted to use or replicate Red Hat trademarks that are incorporated + * in this software or its documentation. + */ +package com.redhat.rhn.domain.kickstart.crypto; + + +/** + * GpgCryptoKey + * @version $Rev$ + */ +public class GpgCryptoKey extends CryptoKey { + +} diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/crypto/SslCryptoKey.java b/java/code/src/com/redhat/rhn/domain/kickstart/crypto/SslCryptoKey.java new file mode 100644 index 0000000..7132e5c --- /dev/null +++ b/java/code/src/com/redhat/rhn/domain/kickstart/crypto/SslCryptoKey.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2013 Red Hat, Inc. + * + * This software is licensed to you under the GNU General Public License, + * version 2 (GPLv2). There is NO WARRANTY for this software, express or + * implied, including the implied warranties of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 + * along with this software; if not, see + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. + * + * Red Hat trademarks are not licensed under GPLv2. No permission is + * granted to use or replicate Red Hat trademarks that are incorporated + * in this software or its documentation. + */ +package com.redhat.rhn.domain.kickstart.crypto; + + +/** + * SslCryptoKey + * @version $Rev$ + */ +public class SslCryptoKey extends CryptoKey { + +}
spacewalk-commits@lists.fedorahosted.org