CLI : Add message for unimplemented command. 63/13863/2
authorhyeongseok.heo <hyeongseok.heo@samsung.com>
Tue, 17 Dec 2013 10:28:19 +0000 (19:28 +0900)
committerhyeongseok.heo <hyeongseok.heo@samsung.com>
Wed, 18 Dec 2013 07:16:54 +0000 (16:16 +0900)
Add notice message for commands which is not implemented yet.
help , certificate , security-profile , security-profile-item

Change-Id: I6ba984c952b3e8674a7ea88636bed3c7d3a05ddc
Signed-off-by: hyeongseok.heo <hyeongseok.heo@samsung.com>
org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateCertificateCLI.java
org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateSecProfileCLI.java
org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateSecProfileItemCLI.java
org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/HelpCLI.java
org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateCertificateCommand.java [new file with mode: 0644]

index cf431c0..ea10885 100644 (file)
  */\r
 package org.tizen.ncli.ide.shell;\r
 \r
+import org.kohsuke.args4j.Option;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+import org.tizen.ncli.core.TizenSubCommand;\r
+\r
 /**\r
  * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
  */\r
+@TizenSubCommand(name="certificate" , usage="Generate  certificate")\r
 public class CreateCertificateCLI extends AbstractCLI {\r
+       private Logger log = LoggerFactory.getLogger(getClass());\r
+       \r
+       @Option(name="--passwd" , aliases="{-pw}",  metaVar="password" , usage="Set the password for the  certificate" )\r
+       private String password;\r
+       \r
+       @Option(name="--country" , aliases="" , metaVar="" , usage="Specify country code with two letters.")\r
+       private String country;\r
+       \r
+       \r
+       public CreateCertificateCLI(){\r
+               this.isLoggingStartFinish = false;\r
+       }\r
+       \r
+       /* (non-Javadoc)\r
+        * @see org.tizen.ncli.ide.subcommands.AbstractSubCommand#call()\r
+        */\r
+       /*\r
+        * /org.tizen.common.sign/src/org/tizen/common/sign/preferences/SigningPreferencePage.java\r
+        *  try {\r
+                    TizenKeyCertificateGenerator.KeyCertGeneratorFromIde(\r
+                            dialog.getValue( CertDataKey.Country ),\r
+                            dialog.getValue( CertDataKey.State ),\r
+                            dialog.getValue( CertDataKey.City ),\r
+                            dialog.getValue( CertDataKey.Name ),\r
+                            dialog.getValue( CertDataKey.Organization ),\r
+                            dialog.getValue( CertDataKey.Department ),\r
+                            dialog.getValue( CertDataKey.Email ),\r
+                            SigningPathUtil.getCertificateGeneratorPath(),\r
+                            dialog.getValue( CertDataKey.Password ),\r
+                            dialog.getValue( CertDataKey.Alias ),\r
+                            pkcsKeyStorePath );\r
+                } catch (Exception e) {\r
+                    throw new InvocationTargetException( e );\r
+                } finally {\r
+                    monitor.done();\r
+                }\r
+        * */\r
 \r
     /* (non-Javadoc)\r
      * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()\r
      */\r
     @Override\r
     public void execute() {\r
-        // TODO Auto-generated method stub\r
-        \r
+       progressLog.info("This command is under developing...\nSorry about your inconvenience.");\r
     }\r
 \r
 }\r
index ce2f0df..d81caed 100644 (file)
  */\r
 package org.tizen.ncli.ide.shell;\r
 \r
+import org.tizen.ncli.core.TizenSubCommand;\r
+\r
 /**\r
  * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
  */\r
+@TizenSubCommand(name="security-profile" , usage="Create security profile for signing.")\r
 public class CreateSecProfileCLI extends AbstractCLI {\r
-\r
+       public CreateSecProfileCLI(){\r
+               this.isLoggingStartFinish = false;\r
+       }\r
     /* (non-Javadoc)\r
      * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()\r
      */\r
     @Override\r
     public void execute() {\r
-        // TODO Auto-generated method stub\r
-\r
+       progressLog.info("This command is under developing...\nSorry about your inconvenience.");\r
     }\r
 \r
 }\r
index 33e47e7..f750f40 100644 (file)
  */\r
 package org.tizen.ncli.ide.shell;\r
 \r
+import org.tizen.ncli.core.TizenSubCommand;\r
+\r
 /**\r
  * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
  */\r
+@TizenSubCommand(name="security-profile-item" , usage="Add security profile item")\r
 public class CreateSecProfileItemCLI extends AbstractCLI {\r
+       \r
+       public CreateSecProfileItemCLI(){\r
+               this.isLoggingStartFinish = false;\r
+       }\r
 \r
     /* (non-Javadoc)\r
      * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()\r
@@ -35,7 +42,7 @@ public class CreateSecProfileItemCLI extends AbstractCLI {
     @Override\r
     public void execute() {\r
         // TODO Auto-generated method stub\r
-\r
+       progressLog.info("This command is under developing...\nSorry about your inconvenience.");\r
     }\r
 \r
 }\r
index 6acbc50..26219c7 100644 (file)
@@ -35,12 +35,18 @@ public class HelpCLI extends AbstractCLI{
     
     @Argument(index=0 ,required=true , metaVar="<command>")
     String commandName;
+    
+    public HelpCLI(){
+       this.isLoggingStartFinish = false;
+    }
 
     @Override
     public void execute() {
-        output.println("Help command is under developing...\nSorry about your inconvenience.");
+        progressLog.info("This command is under developing...\nSorry about your inconvenience.");
     }
     
     
+    
+    
 
 }
diff --git a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateCertificateCommand.java b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateCertificateCommand.java
new file mode 100644 (file)
index 0000000..59720fc
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * IDE
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
+ * Kangho Kim <kh5325.kim@samsung.com>
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ */
+package org.tizen.ncli.ide.subcommands;
+
+import java.security.cert.Certificate;
+
+
+import org.kohsuke.args4j.Option;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class is for 'certificate' command processing.
+ * 
+ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
+ */
+public class CreateCertificateCommand extends AbstractSubCommand<Certificate> {
+       private Logger log = LoggerFactory.getLogger(getClass());
+       
+       @Option(name="--passwd" , aliases="{-pw}",  metaVar="" , usage="" )
+       private String password;
+       
+       
+       /* (non-Javadoc)
+        * @see org.tizen.ncli.ide.subcommands.AbstractSubCommand#call()
+        */
+       /*
+        * /org.tizen.common.sign/src/org/tizen/common/sign/preferences/SigningPreferencePage.java
+        *  try {
+                    TizenKeyCertificateGenerator.KeyCertGeneratorFromIde(
+                            dialog.getValue( CertDataKey.Country ),
+                            dialog.getValue( CertDataKey.State ),
+                            dialog.getValue( CertDataKey.City ),
+                            dialog.getValue( CertDataKey.Name ),
+                            dialog.getValue( CertDataKey.Organization ),
+                            dialog.getValue( CertDataKey.Department ),
+                            dialog.getValue( CertDataKey.Email ),
+                            SigningPathUtil.getCertificateGeneratorPath(),
+                            dialog.getValue( CertDataKey.Password ),
+                            dialog.getValue( CertDataKey.Alias ),
+                            pkcsKeyStorePath );
+                } catch (Exception e) {
+                    throw new InvocationTargetException( e );
+                } finally {
+                    monitor.done();
+                }
+        * */
+       @Override
+       protected Certificate call() {
+                
+               return null;
+       }
+
+}