Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos
141

public void addProgramObjectToCms(IEnterpriseSession enterpriseSession,

            String jarPath, int parentFolderId, String programName)

            throws SDKException {

       

      IInfoStore infoStore = (IInfoStore) enterpriseSession

                .getService("InfoStore");

        IPluginMgr pluginMgr = infoStore.getPluginMgr();

        IPluginInfo pluginInfo = pluginMgr

                .getPluginInfo("CrystalEnterprise.Program");

        IInfoObjects newInfoObjects = infoStore.newInfoObjectCollection();

        IInfoObject newProgram = newInfoObjects.add(pluginInfo);

//folder in which you want to add the program

        newProgram.properties().setProperty("SI_PARENTID", parentFolderId);

        newProgram.properties().setProperty("SI_NAME", programName);

        File programFile = new File(jarPath);

        newProgram.getFiles().addFile(programFile);

        IProgram program = (IProgram) newProgram;

        IJavaProgram javaProgram = (IJavaProgram) program.getProgramInterface();

        javaProgram.setUserName("administrator");

        javaProgram.setPassword("password");

      // Give main class

        javaProgram.setMainClass("com.JavaProgram");

     //add arguments

        javaProgram.setArgs("abc");

     //commit the changes

        infoStore.commit(newInfoObjects);

    }

Labels in this area