Quantcast
Channel: SCN : Document List - Java SDK Application Development
Viewing all articles
Browse latest Browse all 39

Java program for adding a java program object to CMS using plateform SDK

$
0
0

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);

 

    }


Viewing all articles
Browse latest Browse all 39

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>