Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9255211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:39:53+00:00 2026-06-18T11:39:53+00:00

I’m trying to use a Java program provided by IBM . See the code

  • 0

I’m trying to use a Java program provided by IBM. See the code below. When I try to compile this program,

C:\Temp>"C:\Program Files (x86)\Java\jdk1.6.0_25\bin\javac.exe" GetOrphanMyFolde
rs.java

I get an error saying

GetOrphanMyFolders.java:96: cannot find symbol
symbol  : variable PropEnum
location: class GetOrphanMyFolders
                                 PropEnum.canBurst      ,
                                 ^
GetOrphanMyFolders.java:97: cannot find symbol
symbol  : variable PropEnum
location: class GetOrphanMyFolders
                                 PropEnum.capabilities   ,
                                 ^

I’m Java noob, what is the cause of this error? The program I’m using is here

/**
 * Licensed Material - Property of IBM
 * © Copyright IBM Corp. 2012
 *
 * GetOrphanMyFolders.java
 *
 * Description: Technote 1340789 - SDK Sample: How to recover the My Folders of users that no longer exist in the Authentication Provider
 *
 * Tested with: IBM Cognos BI 10.1.1, IBM Java 5.0, Axis 1.4
 *
 */

import java.util.Vector;

import javax.xml.namespace.QName;

import org.apache.axis.client.Stub;
import org.apache.axis.message.SOAPHeaderElement;

import com.cognos.developer.schemas.bibus._3.BaseClass;
import com.cognos.developer.schemas.bibus._3.BiBusHeader;
import com.cognos.developer.schemas.bibus._3.ContentManagerService_PortType;
import com.cognos.developer.schemas.bibus._3.ContentManagerService_ServiceLocator;
import com.cognos.developer.schemas.bibus._3.CopyOptions;
import com.cognos.developer.schemas.bibus._3.PropEnum;
import com.cognos.developer.schemas.bibus._3.QueryOptions;
import com.cognos.developer.schemas.bibus._3.SearchPathMultipleObject;
import com.cognos.developer.schemas.bibus._3.SearchPathSingleObject;
import com.cognos.developer.schemas.bibus._3.Sort;
import com.cognos.developer.schemas.bibus._3.UpdateActionEnum;
import com.cognos.developer.schemas.bibus._3.XmlEncodedXML;

public class GetOrphanMyFolders
{
    //TODO: change the following variables depending on your installation and setup

    //--- begin changes ----
    private static String dispatcherURL = "http://localhost:9300/p2pd/servlet/dispatch";

    //Change the next three variables to a valid namespace ID as defined in Cognos Configuration and NOT the namespace name
    //Provide a valid user ID and password if Anonymous is disabled
    private static String nameSpaceID   = "Cognos";
    private static String userName      = "admin";
    private static String password      = "password";

    // define where you are copying the orphaned my folders to
    private static String targetLocation = "/content/folder[@name='OrphanedMyFolders']";
    //--- end changes ---

    //Services to be used in the sample
    private ContentManagerService_PortType cmService = null;

    private String[] getAllMyFoldersSearchPaths(String namespaceID)
    {
        String listOfAccountSP [] = null;
        PropEnum props[] = new PropEnum[] {PropEnum.searchPath, PropEnum.defaultName, PropEnum.portalPage};
        Sort sOpt[] = new Sort[]{}; 
        QueryOptions qOpt = new QueryOptions(); 
        try
        {
            // get the template user's Account object. 
            BaseClass template[] = cmService.query(new SearchPathMultipleObject("//folder"), props, sOpt, qOpt);
            listOfAccountSP = new String [template.length];

            for (int x=0;x<template.length;x++)
            {
                if ( template[x].getSearchPath().getValue().indexOf(")/folder[@name='My Folders']")>0 )
                {
                    listOfAccountSP[x]=template[x].getSearchPath().getValue();
                }
            }
        }
        catch (Exception e)
        {
            System.out.println(e);
            e.printStackTrace();
        }
        return listOfAccountSP;
    }

    private PropEnum[] getAllPropEnum ()
      {
        PropEnum properties[] = new PropEnum[]{
                 PropEnum.active, 
                 PropEnum.actualCompletionTime,
                 PropEnum.actualExecutionTime ,
                 PropEnum.advancedSettings ,
                 PropEnum.ancestors ,
                 PropEnum.asOfTime ,
                 PropEnum.base ,
                 PropEnum.brsAffineConnections, 
                 PropEnum.brsMaximumProcesses ,
                 PropEnum.brsNonAffineConnections, 
                 PropEnum.burstKey ,
                 PropEnum.businessPhone,             
                 PropEnum.canBurst      ,       
                 PropEnum.capabilities   ,          
                 PropEnum.capacity        ,     
                 PropEnum.closeConnectionCommands,             
                 PropEnum.closeSessionCommands    ,         
                 PropEnum.configuration            , 
                 PropEnum.connections             ,
                 PropEnum.connectionString         ,    
                 PropEnum.consumers             ,
                 PropEnum.contact             ,
                 PropEnum.contactEMail         ,    
                 PropEnum.contentLocale         ,    
                 PropEnum.creationTime           ,  
                 PropEnum.credential             ,
                 PropEnum.credentialNamespaces    ,         
                 PropEnum.credentials             ,
                 PropEnum.cubeContentName          ,   
                 PropEnum.dailyPeriod             ,
                 PropEnum.data             ,
                 PropEnum.dataBlocks        ,     
                 PropEnum.dataSize           ,  
                 PropEnum.dataType            , 
                 PropEnum.defaultDescription   ,          
                 PropEnum.defaultName           ,  
                 PropEnum.defaultOutputFormat    ,         
                 PropEnum.defaultScreenTip        ,     
                 PropEnum.defaultTriggerDescription,
                 PropEnum.deployedObject ,
                 PropEnum.deployedObjectAncestorDefaultNames, 
                 PropEnum.deployedObjectClass ,
                 PropEnum.deployedObjectDefaultName, 
                 PropEnum.deployedObjectStatus      ,       
                 PropEnum.deployedObjectUsage        ,     
                 PropEnum.deploymentOptions           ,  
                 PropEnum.description             ,
                 PropEnum.disabled             ,
                 PropEnum.dispatcherID          ,   
                 PropEnum.dispatcherPath         ,    
                 PropEnum.displaySequence         ,    
                 PropEnum.email             ,
                 PropEnum.endDate            , 
                 PropEnum.endType             ,
                 PropEnum.eventID             ,
                 PropEnum.everyNPeriods        ,     
                 PropEnum.executionFormat        ,     
                 PropEnum.executionLocale         ,    
                 PropEnum.executionPageDefinition  ,           
                 PropEnum.executionPageOrientation  ,           
                 PropEnum.executionPrompt            , 
                 PropEnum.faxPhone             ,
                 PropEnum.format             ,
                 PropEnum.gateway             ,
                 PropEnum.givenName            , 
                 PropEnum.governors             ,
                 PropEnum.hasChildren            , 
                 PropEnum.hasMessage             ,
                 PropEnum.hasPrompts             ,
                 PropEnum.height             ,
                 PropEnum.homePhone           ,  
                 PropEnum.horizontalElementsRenderingLimit,
                 PropEnum.identity ,
                 PropEnum.isolationLevel, 
                 PropEnum.lastConfigurationModificationTime, 
                 PropEnum.lastPage ,
                 PropEnum.loadBalancingMode, 
                 PropEnum.locale ,
                 PropEnum.location, 
                 PropEnum.members ,
                 PropEnum.message ,
                 PropEnum.metadataModel ,
                 PropEnum.mobilePhone ,
                 PropEnum.model ,
                 PropEnum.modelName ,
                 PropEnum.modificationTime ,
                 PropEnum.monthlyAbsoluteDay ,
                 PropEnum.monthlyRelativeDay ,
                 PropEnum.monthlyRelativeWeek ,
                 PropEnum.name ,
                 PropEnum.namespaceFormat ,
                 PropEnum.objectClass ,
                 PropEnum.openConnectionCommands ,
                 PropEnum.openSessionCommands ,
                 PropEnum.options ,
                 PropEnum.output ,
                 PropEnum.owner ,
                 PropEnum.ownerPassport ,
                 PropEnum.packageBase ,
                 PropEnum.page ,
                 PropEnum.pageOrientation ,
                 PropEnum.pagerPhone ,
                 PropEnum.parameters ,
                 PropEnum.parent ,
                 PropEnum.paths ,
                 PropEnum.permissions ,
                 PropEnum.policies ,
                 PropEnum.portalPage ,
                 PropEnum.position ,
                 PropEnum.postalAddress ,
                 PropEnum.printerAddress ,
                 PropEnum.productLocale ,
                 PropEnum.qualifier ,
                 PropEnum.recipients ,
                 PropEnum.recipientsEMail ,
                 PropEnum.related ,
                 PropEnum.replacement ,
                 PropEnum.requestedExecutionTime ,
                 PropEnum.retentions ,
                 PropEnum.rsAffineConnections ,
                 PropEnum.rsMaximumProcesses ,
                 PropEnum.rsNonAffineConnections ,
                 PropEnum.rsQueueLimit ,
                 PropEnum.runAsOwner ,
                 PropEnum.runningState ,
                 PropEnum.runOptions ,
                 PropEnum.screenTip ,
                 PropEnum.searchPath ,
                 PropEnum.searchPathForURL ,
                 PropEnum.sequencing ,
                 PropEnum.serverGroup ,
                 PropEnum.source ,
                 PropEnum.specification ,
                 PropEnum.startAsActive ,
                 PropEnum.startDate ,
                 PropEnum.state ,
                 PropEnum.status ,
                 PropEnum.stepObject ,
                 PropEnum.surname ,
                 PropEnum.target ,
                 PropEnum.taskID ,
                 PropEnum.timeZoneID ,
                 PropEnum.triggerDescription ,
                 PropEnum.triggerName ,
                 PropEnum.type ,
                 PropEnum.unit ,
                 PropEnum.uri ,
                 PropEnum.usage ,
                 PropEnum.user ,
                 PropEnum.userCapabilities ,
                 PropEnum.userCapability ,
                 PropEnum.userName ,
                 PropEnum.version ,
                 PropEnum.verticalElementsRenderingLimit ,
                 PropEnum.viewed ,
                 PropEnum.weeklyFriday ,
                 PropEnum.weeklyMonday ,
                 PropEnum.weeklySaturday ,
                 PropEnum.weeklySunday ,
                 PropEnum.weeklyThursday ,
                 PropEnum.weeklyTuesday ,
                 PropEnum.weeklyWednesday ,
                 PropEnum.width ,
                 PropEnum.yearlyAbsoluteDay, 
                 PropEnum.yearlyAbsoluteMonth, 
                 PropEnum.yearlyRelativeDay ,
                 PropEnum.yearlyRelativeMonth, 
                 PropEnum.yearlyRelativeWeek ,

        };
        return properties;
      }

    private String[][] getAllCIs(String namespaceID)
    {
        String listOfCIs [][] = null;

        String searchPath = "CAMID('"+namespaceID+"')//account";
        PropEnum props[] = new PropEnum[] {PropEnum.searchPath, PropEnum.defaultName, PropEnum.portalPage};
        Sort sOpt[] = new Sort[]{}; 
        QueryOptions qOpt = new QueryOptions(); 
        try
        {
            // get the template user's Account object. 
            BaseClass template[] = cmService.query(new SearchPathMultipleObject(searchPath), props, sOpt, qOpt);
            listOfCIs = new String [2] [template.length];

            for (int x=0;x<template.length;x++)
            {
                    listOfCIs[0][x]=template[x].getSearchPath().getValue();
                    listOfCIs[1][x]=template[x].getDefaultName().getValue();
            }
        }
        catch (Exception e)
        {
            System.out.println(e);
            e.printStackTrace();
        }

        return listOfCIs;

    }

    private void moveMF2PF(String path, String targetLocation)
    {
        String userSearchPaths = path ;
        PropEnum props[] = getAllPropEnum();
        String user = path.substring(0, path.indexOf("/folder[@name='My Folders']"));

        try
        {
            //Query the Content Store for all objects in My Folders for user userName
            BaseClass bc[] = cmService.query(new SearchPathMultipleObject(userSearchPaths), props, new Sort[]{}, new QueryOptions());

            if (bc != null && bc.length > 0)
            {
                //copy the folder to Public Folders and rename
                String[] newName={user};
                CopyOptions opt = new CopyOptions();
                opt.setUpdateAction(UpdateActionEnum.replace);
                opt.setRecursive(true);
                cmService.copyRename(bc,new SearchPathSingleObject(targetLocation),newName,opt);
            }
            else
                System.out.println("User " + user+" did not have My Folders. It could be that they have not logged on yet");
        }
        catch (Exception e)
        {
            System.out.println(e);
            e.printStackTrace();
        }
    }

    /**
     * Establish a connection to Cognos BI and initialize the different services
     */
    private void connectToCognos() 
    {
        ContentManagerService_ServiceLocator cmServiceLocator = new ContentManagerService_ServiceLocator();

        try 
        {
            cmService = cmServiceLocator.getcontentManagerService(new java.net.URL(dispatcherURL));
        } 
        catch (Exception e) 
        {
            e.printStackTrace();
        }
    }

    /**
     * Logon to Cognos BI using valid credentials information
     */
    private void logon(String nameSpaceID, String userName, String password) 
    {
        StringBuffer credentialXML = new StringBuffer();

        credentialXML.append("<credential>");
        credentialXML.append("<namespace>").append(nameSpaceID).append("</namespace>");
        credentialXML.append("<username>").append(userName).append("</username>");
        credentialXML.append("<password>").append(password).append("</password>");
        credentialXML.append("</credential>");

        String encodedCredentials = credentialXML.toString();
        XmlEncodedXML xmlCredentials = new XmlEncodedXML();
        xmlCredentials.set_value(encodedCredentials);

        try 
        {
            cmService.logon(xmlCredentials, null);
            getSetHeaders();
        } 
        catch (Exception ex) 
        {
            ex.printStackTrace();
        }
    }

    private void getSetHeaders()
    {
        String BiBus_NS = "http://developer.cognos.com/schemas/bibus/3/";
        String BiBus_H = "biBusHeader";

        BiBusHeader CMbibus = null;

        SOAPHeaderElement temp = ((Stub)cmService).getResponseHeader(BiBus_NS, BiBus_H);

        try 
        {
            CMbibus = (BiBusHeader)temp.getValueAsType(new QName (BiBus_NS, BiBus_H));
        } 
        catch (Exception e) 
        {
            e.printStackTrace();
        }

        if (CMbibus != null)
        {
            ((Stub)cmService).setHeader(BiBus_NS, BiBus_H, CMbibus);
        }
    }

    /**
     * This is the main class, which connects to Cognos BI and calls the
     * method doWork(), containing the specific code for this sample
     */
    public static void main(String args[]) 
    {

        GetOrphanMyFolders mainClass = new GetOrphanMyFolders();

        mainClass.connectToCognos();

        // If Anonymous is disabled, then logon
        if (nameSpaceID.length() > 0) 
        {
            mainClass.logon(nameSpaceID, userName, password);
        }

        //get all the CAMIDs related to the My Folders searchpath
        String[] listOfMyFolders = mainClass.getAllMyFoldersSearchPaths(nameSpaceID);
        String[][] listOfCamIds = mainClass.getAllCIs(nameSpaceID);
        Vector<String> orphanedMyFolders = new Vector<String>();

        // find a my folder that does not have an existing owner from the ldap 
        boolean found = false;
        for (int i = 0; i < listOfMyFolders.length; i++)
        {
            if (listOfMyFolders[i] != null )
            {
                if (listOfMyFolders[i].endsWith("[@name='My Folders']")) 
                {
                    int y = 0;
                    for (y = 0; y < listOfCamIds[0].length - 1; y++) 
                    {
                        String test = listOfCamIds[0][y];
                        if (listOfMyFolders[i].indexOf(test) >= 0) 
                        {
                            found = true;
                        }
                    }
                    if (!found) 
                    {
                        //  String userName = getUserNameFromCamid(listOfMyFolders[i]);
                        System.out.println(listOfMyFolders[i] + " does not have an associated user");
                        orphanedMyFolders.add(listOfMyFolders[i]);
                    }
                    found = false;
                }               
            }
        }

        // Now we need to take the list of orphaned My Folders and move them to the 
        // public folders so that the content can be examined.
        for (int x = 0; x < orphanedMyFolders.size(); x++)
        {
            mainClass.moveMF2PF(orphanedMyFolders.elementAt(x).toString(), targetLocation);
        }
        System.out.println("Done ....");
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:39:54+00:00Added an answer on June 18, 2026 at 11:39 am

    The sample GetOrphanMyFolders.java is using classes defined in external libraries (i.e. jars) that should be available in Cognos 8 SDK (usually under C8_INSTALLATION_DIR/sdk/lib), I believe you should be looking for cognosClient.jar or axisCognosClient.jar

    Since you are new to java, it will be cumbersome to compile this using javac and add external jars to the classpath. I would recommend that you use eclipse

    After downloading/installing it (simply unzip to whatever directory you like), create a New Java Project, add GetOrphanMyFolders.java under the src package (copy/paste or drag/drop).
    Then see this question to know how you can add libraries to your project classpath.

    It will be much easier than figuring out how to do this with javac -cp

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.