How to check whether a Document in KM is classified or not using JAVA API

Hello Everyone,
  Can anyone tell me, How to check whether a Document in KM is classified or not, using JAVA API's??
Thanks & Regards,
Adren D'Souza

Hi,
The code is as follows:
IIndexService indexService = null;
try {
   indexService = (IIndexService) ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
} catch (ResourceException e) {
   if (indexService == null) {
     log.errorT("Error on instanciating the index service");
     return this.renderMessage(this.getBundleString(RES_NO_INDEX_SERVICE), StatusType.ERROR);
// get index
IIndex index = null;
try {
   index = indexService.getIndex("YourIndexID");
} catch (WcmException e1) {
   log.errorT("Error when trying to get the index");
   return this.renderMessage(this.getBundleString(RES_NO_INDEX), StatusType.ERROR);
// check if the index is a instance of AbstractClassificationIndex
AbstractClassificationIndex classiIndex = null;
if (index instanceof AbstractClassificationIndex) {
   classiIndex = (AbstractClassificationIndex) index;
} else {
   log.errorT("The index " + index.getIndexName() + " is no classification index");
   return this.renderMessage(this.getBundleString(RES_NO_CLASSIFICATION_INDEX), StatusType.WARNING);
//give your KM Resource here for which you want to know if it is classified or not
boolean classified = classiIndex.isDocClassifiedInAnyTax(resource);
Regards,
Praveen Gudapati

Similar Messages

  • How to check whether a char string is in uppercase or not

    Hi,
    I know how to convert strings to change strings to uppercase or lowercase, but is there any function to check, beforehand, if the field is in uppercase, for instance ? The intention here is simply to spare processing in situations where the string is already in uppercase, and thus not needing any further processing (given I want to turn the string into uppercase.)
    Thanks in advance,
    Avraham

    Hi Avraham ,
    To check whether the string is in upper case or not use CA keyward.
    To check  try the following code  ---
    DATA : W_STRING(5) TYPE C,
    W_ABCDE(26) TYPE C VALUE 'abcdefghijklmnopqrstuvwxyz'.
    w_string = 'abcd'.
    IF W_STRING CA W_ABCDE.
    TRANSLATE w_string TO UPPER CASE.
    ELSE.
    MESSAGE 'It is a uppercase string' TYPE 'S'.
    ENDIF.
    Try this link  this will definitely help you -
    https://wiki.sdn.sap.com/wiki/display/ABAP/Validationofastringintermsof+case
    Regards
    Pinaki

  • How to check whether my iphone 5 is factory unlocked or not??

    how to check whether my iphone 5 is factory unlocked or not??

    Did you buy it unlocked at full, non-subsidised price?  If not, then it's not unlocked.

  • How to find bpel instance in 11g based on the index values using Java APIs

    Hi ,
    In SOA10G we had option to find the instances based on the index value using Java APIs like below.
    WhereCondition criteria= new WhereCondition(SQLDefs.CX_index_1 + " = ?");
    criteria.setString(1, "indexValue");
    Locator mLoc = getLocator();
    IInstanceHandle[] foundInstances = mLoc.listInstancesByIndex(criteria);
    Please tell me how to achieve the same functionality in SOA 11G using Java APIs
    Regards,
    Saba

    I have multiple bpel in my composite. I checked in ci_indexes table and it shows the instance number of the bpel process. But the em console is showing only the composite instance number. when I opened composite instance, I could see all the bpel process with instance number in the audit trail. How can I find the the actual composite instance number that I should search for in the em console ???

  • How to check whether weblogic server is in DEBUG mode or not

    Hi
    I want to check in my OSB proxy whether weblogic server is in Debug mode or not?
    IF abv thing is not possible ,
    I have check whether server is in development mode or production mode from my OSB proxy service?
    I m not able to find any doc on this??Please let me know how it can be done?
    Thanks

    There isnt any other way except for doing a Java Callout. In the callout method you can access the Domain/Server MBean for the information that you seek. Based on the callout result you can go ahead with the logic in your PS..
    Here is a sample Java Code to get the Server Log Level and ascertain whether the server is in Production Mode or not.
    package com.dell.mbean;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.util.Hashtable;
    import javax.management.MBeanServerConnection;
    import javax.management.MalformedObjectNameException;
    import javax.management.ObjectName;
    import javax.management.remote.JMXConnector;
    import javax.management.remote.JMXConnectorFactory;
    import javax.management.remote.JMXServerErrorException;
    import javax.management.remote.JMXServiceURL;
    import javax.naming.Context;
    public class MyConnection {
         private static MBeanServerConnection connection;
         private static JMXConnector connector;
         private static final ObjectName service;
         static {
              try {
              service = new ObjectName("com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean");
              catch (MalformedObjectNameException e) {
              throw new AssertionError(e.getMessage());
         * Initialize connection to the Domain Runtime MBean Server.
         @SuppressWarnings("unchecked")
         public static void initConnection(String hostname, String portString,
         String username, String password) throws IOException,
         MalformedURLException {
         String protocol = "t3";
         Integer portInteger = Integer.valueOf(portString);
         int port = portInteger.intValue();
         String jndiroot = "/jndi/";
         String mserver = "weblogic.management.mbeanservers.domainruntime";
         JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port,
         jndiroot + mserver);
         Hashtable h = new Hashtable();
         h.put(Context.SECURITY_PRINCIPAL, username);
         h.put(Context.SECURITY_CREDENTIALS, password);
         h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,"weblogic.management.remote");
         h.put("jmx.remote.x.request.waiting.timeout", new Long(10000));
         try {
         connector = JMXConnectorFactory.connect(serviceURL, h);
         connection = connector.getMBeanServerConnection();
         } catch(JMXServerErrorException jmxSE)
              jmxSE.printStackTrace();
         catch(Exception ex)
              ex.printStackTrace();
         public static String getLogSeverity(String hostName, String portName, String userName, String password) throws Exception {
              initConnection(hostName, portName, userName,password);
              connector.close();
              ObjectName domainConfig = (ObjectName) connection.getAttribute(service,
              "DomainConfiguration");
              ObjectName logMbean =(ObjectName) connection.getAttribute(domainConfig, "Log");
              String logFileFilter = (String) connection.getAttribute(logMbean, "LogFileSeverity");
              System.out.println("Log File Filter= "+ logFileFilter.toString());
              return logFileFilter;
         public static boolean isProductionModeEnabled(String hostName, String portName, String userName, String password) throws Exception {
              initConnection(hostName, portName, userName,password);
              connector.close();
              ObjectName domainConfig = (ObjectName) connection.getAttribute(service,
              "DomainConfiguration");
              boolean prodEnabled= (Boolean) connection.getAttribute(domainConfig, "ProductionModeEnabled");
              System.out.println("Is Production Mode Enabled=" +prodEnabled);
              return prodEnabled;
    Make sure you have wlclient.jar and wljmxclient.jar as your dependent libraries.

  • How to check whether a SMTP server is supporting Authentication or not

    Hi All,
    We are using Java Mail API 1.3.1/1.3.2 to send the messages. some of the SMTP servers that we use are supporting authentication and some of them are not.
    As the SMTPTransport.supportsAuthentication() is not available only in Java mail API 1.4.1, we are identifying the SMTP server whether it is supporting authentication or not in the following way.
    Socket clientSocket = null;
    InetSocketAddress socketAddress = null;
    OutputStream outStream = null;
    InputStream inStream = null;
    InputStreamReader inReader = null;
    OutputStreamWriter outWritter = null;
    try
    clientSocket = new Socket();
    socketAddress = new InetSocketAddress(host, port);
    clientSocket.connect(socketAddress, timeout*1000); // convert timeout from second to miliseconds
    // 1: now try to execute the given command by passing that on Out-Socket
    outStream = clientSocket.getOutputStream();
    outWritter = new OutputStreamWriter(outStream);
    outWritter.write("ehlo localhost" +"\n");
    outWritter.flush();
    // 2:Read output of above command
    inStream = clientSocket.getInputStream();
    inReader = new InputStreamReader(inStream);
    // This array limit would be fine to get "AUTH" extension of smtp server.
    char[] arr = new char[16384];
    StringBuilder strBuilder = new StringBuilder();
    inReader.read(arr);
    for(int i=0; i< arr.length; i++)
    strBuilder.append(arr);
    System.out.println(METHOD_NAME + "SMTP server response for ehlo localhost command ->"+strBuilder.toString());
    // The output EHLO command comes like below :
    // ehlo localhost
    // 250-ap9058pc.us.oracle.com Hello ap614ses.us.oracle.com [130.35.33.43], pleased to meet you
    // 250-ENHANCEDSTATUSCODES
    // 250-PIPELINING
    // 250-8BITMIME
    // 250-SIZE
    // 250-DSN
    // 250-ETRN
    // 250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
    // Since for XATUH ( like internal IP),
    // we are not sure, so just checking for AUTH capability.
    supported = strBuilder.indexOf("250-AUTH") >=0? true : false;
    As shown in above code, we are issuing 'ehlo localhost' command to SMTP server, if the response i. 'strBuilder' contains '250-AUTH' then we are assuming that it is supporting authentication.
    But for one SMTP server the 'strBuilder' value is showing as '220 mail.durofelguera.com ESMTP Service (Lotus Domino Release 8.5.2) ready at Thu, 16 Feb 2012 13:57:20 +0100' only which is socket connection output but not 'ehlo localhost' command output.
    where as the telnet test output is showing correct only as below
    # telnet mail.durofelguera.com 25
    Trying 172.20.16.65...
    Connected to mail.durofelguera.com.
    Escape character is '^]'.
    220 mail.durofelguera.com ESMTP Service (Lotus Domino Release 8.5.2) ready
    at 0
    ehlo localhost
    250-mail.durofelguera.com Hello localhost ([172.20.15.209]), pleased to meet
    yu
    250-HELP
    250-AUTH LOGIN
    250-SIZE
    250 PIPELINING
    AUTH LOGIN
    The question is why the 'strBuilder' is not showing 'ehlo localhost' conad output where as the telnet test results are showing correctly, what is going wrong here?
    Is there any other way to check that whether SMTP server is supporting authentication or not?
    Edited by: sarojak on Feb 19, 2012 10:11 PM

    There are so many things wrong with your code, it's hard to know where to start...
    Basically, the problem is not as simple as you think it is.
    For example, some servers might not allow authentication until you've issued
    the STARTTLS command.
    These days, essentially all servers allow authentication. You're probably better
    off just assuming the server supports.

  • How to check whether campaign has been uploaded to online server

    Hi,
    How to check whether campaign has been uploaded to online server by using SQL analyzer
    Thanks,
    Rasheed

    Hi Rasheed,
    To quickly check if the campaign has been uploaded from MSA to the server, you can check the TR_STATUS column on the SMOPCCAMPN table for your campaign, if the value is P000 or P*** then it has been uploaded to the server and is waiting for confirmation, if the status is O, it has been uploaded and created in the server.
    Best Regards,
    Ankan

  • How to check whether a Oracle server is installed or not ?

    Hi,
    How cani check whether a Machine has oracle server installed or not ?
    I have a machine where i have the client tools installed but not server. In that case how can i check whether this machine has oracle server is installed or not?
    Thanks in Advance..

    user11000236 wrote:
    Hi,
    How cani check whether a Machine has oracle server installed or not ?
    I have a machine where i have the client tools installed but not server. In that case how can i check whether this machine has oracle server is installed or not?
    Thanks in Advance..http://tinyurl.com/ngunhv
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • How to check whether follow on document is created for sc or po,is there any table or fm available?

    How to check whether follow on document is created for sc or po,is there any table or fm available?

    Hello Venu
    Check FM: BBP_PD_SC_GETDETAIL and BBP_PD_PO_GETDETAIL table E_HEADER_REL
    Check this: SRM Shopping cart and PO tables link
    Regards

  • How to check whether there r new txt files in a folder n file creation date

    How to check whether there r new text files in a specified folder and what is the date of creation of the text file.........?

    Hi
    I have been searching for a solution to find the date of creation of a file for over 6 months now but haven't found it. So I presume that it is not possible though I havent found any authentication of my assumption in any document.
    Cheers!
    Shailesh

  • Check whether the document text is filled in the manual posting document.

    Dear BCS experts,
    Our client would like to have a check whether the document text is filled in the manual posting document.
    Do you have any ideas how it is possible to implement?
    Thanks.

    The probelm is solved. I implemented the validation of document header with a condition function.

  • R12.1.1 staging complete! How to check whether the stage is Good

    Hi Gurusl,
    I have completed staging R12.1.1 for Hp unix B.11.31. I want to know how to check whether the stage is good for installation or whether it is corrupted. Is there any metalink note or script from where we can check it. Ur help will be highly appreciated. Thanks in advance
    regards,

    Hi,
    Please refer to (Note: 802195.1 - MD5 Checksums for R12.1.1 Rapid Install Media).
    Regards,
    Hussein

  • CIN: How to check the material document posted without excise invoice

    Hi Guru,
    Please advise how to check the material document posted without excise invoice.
    I have tried tcode J1I7 but it seems start to collect the excise invoice first and then material document.
    But my case is to find the material document WITHOUT excise invoice for internal tracking purpose.
    At the moment we start from tcode MB51 to get the list of material document and check in J_1IEXCHDR / J_1IEXCDTL
    Best regards,
    Pakorn

    Hi,
    Try creating a Query in Tcode SQVI by combining tables MKPF and J_1IEXCHDR/J_1IEXCDTL for your requirement.
    Check these threads how to create Query.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6018c1ae-8c44-2d10-6ea9-c3fad2c82880?QuickLink=index&…
    http://ptgmedia.pearsoncmg.com/images/9780672329029/samplechapter/0672329026_CH03.pdf
    Regards
    Binoy

  • How to check whether transport path exist between two systems in sld??

    Hi,
         I have two systems namely 'A' and 'B' and created business systems for both of them.Then i created transport path between the two systems.How i check whether what i have done is right in SLD.

    <b>WRT to CMS</b>
    am not sure with this but u can try:
    1. Start CMS: http://<host>:<J2EE Engine http port>/webdynpro/dispatcher/sap.com/tcSLCMS~WebUI/Cms.
    2. Goto lansdscape configurator and check there
    Message was edited by:
            Prabhu  S

  • How to check whether User is alreadylogged in or not

    Hi..I want to check whether Particular User is already logged in or not ?? I had userid,password and status in my database.
    If anybody shows me how to implement it ??
    Reggards
    Chintan

    If you want to prevent multiple logins happening, use a profile on the database server that limits a login to a set number of simultaneous connections.
    If you just ant to check which users are logged in, the v$session table will have that information.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for

  • Keyboard & Trackpad don't work

    The keyboard and trackpad do not work on my 13" Macbook. I've attached a usb keyboard and mouse to get functionality. So far I've repaired permissions, reset pram and smc all with no effect on the keyboard and trackpad. Any ideas?

  • Delete Dialogue not appearing... can't delete songs from hard-drive

    After downloading ver 7.0.2 I can't delete songs from my hard-drive by deleting them in iTunes. There's supposed to be a dialogue(sp?) box that shows up when you delete a song in the main library (not in playlists), that asks you if you want to perma

  • Illustrator CC unexpectedly quits when trying to launch app on macbook pro

    I've had this issue for 3 days. I spoke to adobe support 2 days ago and they still havent gotten back to me. I've tried: - Activating Tahoma and Verdana - Un-intalling Illustrator and re-installing - Accessing Illustrator from a new account - Deletin

  • Mass updating a multi-valued field- to append the new value

    I have a question on multi-valued fields: I have store table with 5 multi-valued fields, say MLB, soccer, college FTBL, college Basketball, etc.  A store can have 4 MLBs, 2 soccer teams, and so on.  Say, there is a new MLB that came out called Mexico

  • How to know the amount of ora 11g page-out  memory (sga and pga)?

    How to know the amount of oracle 11g page-out memory ( sga and pga) in the SunSolaris 10 Unix and Linux. I need to know how many oracle memory are being page-out ( all and for a one oracle server process). thanks