EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB248761: How To Programmatically Change The Description Of A Project Using MicroStrategy Web SDK


Community Admin

• Strategy


SUMMARY: A project’s description can normally be changed using Strategy Developer. However, this can also be done programmatically using Strategy Web SDK 9.4.1-10
The following sample code demonstrates how this can be done:


    public static void main(String[] args) {
        WebIServerSession isess = null;
        isess = WebObjectsFactory.getInstance().getIServerSession();
        isess.setServerName("localhost");
        isess.setServerPort(0);
        isess.setProjectName("Strategy Tutorial");
        isess.setLogin("administrator");
        isess.setPassword("");
        
        //Get the project object
        WebObjectSource objectSource = isess.getFactory().getObjectSource();
        try {
            WebObjectInfo woi = objectSource.getObject(isess.getProjectID(), EnumDSSXMLObjectTypes.DssXmlTypeProject);
            //Populate the object
            woi.populate();
            //Output the current description
            System.out.println("Description: " + woi.getDescription());
            //Set a new description and save the project
            woi.setDescription("Tutorial");
            objectSource.save(woi);
        } catch (WebObjectsException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

 
Note: To reflect the change, the user will need to disconnect the I-Server from the Web Server and re-attach again.
 
 
CUSTOMIZATION WARNING:
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy Technical Support makes no guarantee that an updated version of this particular customization will be provided. In the event of a code change in future builds, Strategy may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build. For enhancements to this customization or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy Consulting assistance.


Comment

0 comments

Details

Knowledge Article

Published:

June 22, 2017

Last Updated:

June 22, 2017