java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java |
3
java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml |
4 -
java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java |
2
java/code/src/com/redhat/rhn/manager/channel/repo/EditRepoCommand.java |
31 ++++++++++
4 files changed, 35 insertions(+), 5 deletions(-)
New commits:
commit 1ddd420815cb6b4b8a5869149a240a12d68fd9e5
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Tue May 25 17:04:29 2010 -0400
adding repo edit commands
diff --git a/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java
b/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java
index ed8d74d..0074d40 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java
@@ -125,9 +125,10 @@ public class ChannelFactory extends HibernateFactory {
* @param id the id to lookup
* @return the ContentSource
*/
- public static ContentSource lookupContentSource(Long id) {
+ public static ContentSource lookupContentSource(Long id, Org orgIn) {
Map params = new HashMap();
params.put("id", id);
+ params.put("org", orgIn.getId());
return (ContentSource) singleton.lookupObjectByNamedQuery(
"ContentSource.findById", params);
}
diff --git a/java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml
b/java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml
index e30feb3..f64ac98 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml
@@ -38,8 +38,8 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
</class>
- <query name="ContentSource.findById">
- <![CDATA[from com.redhat.rhn.domain.channel.ContentSource as c where c.id =
:id]]>
+ <query name="ContentSource.findByIdandOrg">
+ <![CDATA[from com.redhat.rhn.domain.channel.ContentSource as c where c.id =
:id and c.org_id = :org]]>
</query>
</hibernate-mapping>
diff --git
a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
index 1e59d9c..7b46e50 100644
---
a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
+++
b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
@@ -42,8 +42,6 @@ import com.redhat.rhn.manager.channel.repo.CreateRepoCommand;
* @version $Rev$
*/
public class RepoDetailsAction extends RhnAction {
- private static final Logger LOG =
- Logger.getLogger(RepoDetailsAction.class);
public static final String ORG = "org";
public static final String CREATE_MODE = "create_mode";
public static final String REPO = "repo";
diff --git a/java/code/src/com/redhat/rhn/manager/channel/repo/EditRepoCommand.java
b/java/code/src/com/redhat/rhn/manager/channel/repo/EditRepoCommand.java
new file mode 100644
index 0000000..fa65f94
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/manager/channel/repo/EditRepoCommand.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright (c) 2009--2010 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.manager.channel.repo;
+
+import com.redhat.rhn.domain.channel.ChannelFactory;
+import com.redhat.rhn.domain.user.User;
+
+/**
+ * CreateRepoCommand - Command to create a repo
+ * @version $Rev: 119601 $
+ */
+public class EditRepoCommand extends BaseRepoCommand {
+
+ public EditRepoCommand(User currentUser, Long repoId) {
+ super();
+ this.repo = ChannelFactory.lookupContentSource(repoId, currentUser.getOrg());
+ }
+
+}