From 8541780fc48ece14deca9dc81ce637bf4c6beb19 Mon Sep 17 00:00:00 2001 From: "hyeongseok.heo" Date: Tue, 17 Dec 2013 19:28:19 +0900 Subject: [PATCH] CLI : Add message for unimplemented command. 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 --- .../tizen/ncli/ide/shell/CreateCertificateCLI.java | 46 ++++++++++++- .../tizen/ncli/ide/shell/CreateSecProfileCLI.java | 10 ++- .../ncli/ide/shell/CreateSecProfileItemCLI.java | 9 ++- .../src/org/tizen/ncli/ide/shell/HelpCLI.java | 8 ++- .../ide/subcommands/CreateCertificateCommand.java | 76 ++++++++++++++++++++++ 5 files changed, 142 insertions(+), 7 deletions(-) create mode 100644 org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateCertificateCommand.java diff --git a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateCertificateCLI.java b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateCertificateCLI.java index cf431c0..ea10885 100644 --- a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateCertificateCLI.java +++ b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateCertificateCLI.java @@ -24,18 +24,60 @@ */ package org.tizen.ncli.ide.shell; +import org.kohsuke.args4j.Option; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.tizen.ncli.core.TizenSubCommand; + /** * @author Harry Hyeongseok Heo{@literal } (S-core) */ +@TizenSubCommand(name="certificate" , usage="Generate certificate") public class CreateCertificateCLI extends AbstractCLI { + private Logger log = LoggerFactory.getLogger(getClass()); + + @Option(name="--passwd" , aliases="{-pw}", metaVar="password" , usage="Set the password for the certificate" ) + private String password; + + @Option(name="--country" , aliases="" , metaVar="" , usage="Specify country code with two letters.") + private String country; + + + public CreateCertificateCLI(){ + this.isLoggingStartFinish = false; + } + + /* (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(); + } + * */ /* (non-Javadoc) * @see org.tizen.ncli.ide.shell.AbstractCLI#execute() */ @Override public void execute() { - // TODO Auto-generated method stub - + progressLog.info("This command is under developing...\nSorry about your inconvenience."); } } diff --git a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateSecProfileCLI.java b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateSecProfileCLI.java index ce2f0df..d81caed 100644 --- a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateSecProfileCLI.java +++ b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateSecProfileCLI.java @@ -24,18 +24,22 @@ */ package org.tizen.ncli.ide.shell; +import org.tizen.ncli.core.TizenSubCommand; + /** * @author Harry Hyeongseok Heo{@literal } (S-core) */ +@TizenSubCommand(name="security-profile" , usage="Create security profile for signing.") public class CreateSecProfileCLI extends AbstractCLI { - + public CreateSecProfileCLI(){ + this.isLoggingStartFinish = false; + } /* (non-Javadoc) * @see org.tizen.ncli.ide.shell.AbstractCLI#execute() */ @Override public void execute() { - // TODO Auto-generated method stub - + progressLog.info("This command is under developing...\nSorry about your inconvenience."); } } diff --git a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateSecProfileItemCLI.java b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateSecProfileItemCLI.java index 33e47e7..f750f40 100644 --- a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateSecProfileItemCLI.java +++ b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateSecProfileItemCLI.java @@ -24,10 +24,17 @@ */ package org.tizen.ncli.ide.shell; +import org.tizen.ncli.core.TizenSubCommand; + /** * @author Harry Hyeongseok Heo{@literal } (S-core) */ +@TizenSubCommand(name="security-profile-item" , usage="Add security profile item") public class CreateSecProfileItemCLI extends AbstractCLI { + + public CreateSecProfileItemCLI(){ + this.isLoggingStartFinish = false; + } /* (non-Javadoc) * @see org.tizen.ncli.ide.shell.AbstractCLI#execute() @@ -35,7 +42,7 @@ public class CreateSecProfileItemCLI extends AbstractCLI { @Override public void execute() { // TODO Auto-generated method stub - + progressLog.info("This command is under developing...\nSorry about your inconvenience."); } } diff --git a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/HelpCLI.java b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/HelpCLI.java index 6acbc50..26219c7 100644 --- a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/HelpCLI.java +++ b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/HelpCLI.java @@ -35,12 +35,18 @@ public class HelpCLI extends AbstractCLI{ @Argument(index=0 ,required=true , metaVar="") 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 index 0000000..59720fc --- /dev/null +++ b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateCertificateCommand.java @@ -0,0 +1,76 @@ +/* + * IDE + * + * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyeongseok Heo + * Kangho Kim + * + * 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 } (S-core) + */ +public class CreateCertificateCommand extends AbstractSubCommand { + 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; + } + +} -- 2.7.4