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

KB16387: How to modify a user using the Microstrategy Web SDK 10.x


Community Admin

• Strategy


This article describes how to create a UserBean instance to modify user's details programmatically using the Microstrategy Web SDK 10.x

The following code snippet shows how to create a UserBean instance to modify user's details programmatically:
 


package com.Strategy.custom.standalone;

import com.Strategy.web.beans.UserBean;
import com.Strategy.web.beans.WebBeanException;
import com.Strategy.web.beans.WebBeanFactory;
import com.Strategy.web.objects.WebIServerSession;
import com.Strategy.web.objects.WebObjectsException;
import com.Strategy.web.objects.WebObjectsFactory;
import com.Strategy.web.objects.admin.users.WebUser;
import com.Strategy.webapi.EnumDSSXMLAuthModes;

public class standalone {

 public static void main(String[] args) {

  WebIServerSession isess = WebObjectsFactory.getInstance().getIServerSession();
  isess.setServerName("localhost");
  isess.setLogin("administrator");
  isess.setProjectName("Strategy Tutorial");
  isess.setPassword("");
  isess.setServerPort(0);
  isess.setAuthMode(EnumDSSXMLAuthModes.DssXmlAuthStandard);

  try {
   isess.getSessionID();
   UserBean user = null;

   user = WebBeanFactory.getInstance().newUserBean();
   user.setSessionInfo(isess);
   user.setObjectID("F238741E47B8464C2C5EF8ACE915199A");
   WebUser ua = (WebUser) user.getUserEntityObject();

   ua.setFullName("New Full Name");
   user.getObjectInfo().setDescription("New Description");

   user.save();

   System.out.println("Done");

  } catch (WebObjectsException e) {
   e.printStackTrace();

  } catch (WebBeanException e) {
   e.printStackTrace();

  }
 }
}

 
WARNING MESSAGES:
Customization Code 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 may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build
 


Comment

0 comments

Details

Knowledge Article

Published:

June 9, 2017

Last Updated:

June 9, 2017