java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java | 25 +++++++++-
1 file changed, 23 insertions(+), 2 deletions(-)
New commits:
commit 2e9f629c03dee742385f4e85c53d905e1cb9c4cf
Author: Dimitar Yordanov <dyordano(a)redhat.com>
Date: Tue Jul 23 14:51:28 2013 +0200
new api call updateRepoLabel(key, label, new_label
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
index 1fe66d5..9f30026 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
@@ -2543,7 +2543,7 @@ public class ChannelSoftwareHandler extends BaseHandler {
* @xmlrpc.doc Updates repository source URL
* @xmlrpc.param #session_key()
* @xmlrpc.param #param_desc("int", "id", "repository id")
- * @xmlrpc.param #param_desc("string", "url", "repository url")
+ * @xmlrpc.param #param_desc("string", "url", "new repository url")
* @xmlrpc.returntype $ContentSourceSerializer
**/
public ContentSource updateRepoUrl(String sessionKey, Integer id, String url) {
@@ -2564,7 +2564,7 @@ public class ChannelSoftwareHandler extends BaseHandler {
* @xmlrpc.doc Updates repository source URL
* @xmlrpc.param #session_key()
* @xmlrpc.param #param_desc("string", "label", "repository label")
- * @xmlrpc.param #param_desc("string", "url", "repository url")
+ * @xmlrpc.param #param_desc("string", "url", "new repository url")
* @xmlrpc.returntype $ContentSourceSerializer
**/
public ContentSource updateRepoUrl(String sessionKey, String label, String url) {
@@ -2596,6 +2596,27 @@ public class ChannelSoftwareHandler extends BaseHandler {
return repo;
}
+ /**
+ * Updates repository label
+ * @param sessionKey Session containing user information.
+ * @param id ID of the repo
+ * @param label new label
+ * @return the updated repo
+ *
+ * @xmlrpc.doc Updates repository label
+ * @xmlrpc.param #session_key()
+ * @xmlrpc.param #param_desc("string", "label", "repository label")
+ * @xmlrpc.param #param_desc("string", "label", "new repository label")
+ * @xmlrpc.returntype $ContentSourceSerializer
+ **/
+ public ContentSource updateRepoLabel(String sessionKey, String label, String new_label) {
+ User user = getLoggedInUser(sessionKey);
+ ContentSource repo = lookupContentSourceByLabel(label, user.getOrg());
+ setRepoLabel(repo, new_label);
+ ChannelFactory.save(repo);
+ return repo;
+ }
+
/**
* Updates a repository
* @param sessionKey Session containing user information.