The blog covers various articles and posts on Cloud, Big Data Analytics, Data Science, Machine Learning, DevOps, Full Stack Development, Java and Middleware Technologies
Thursday, July 30, 2015
OIM 11G R2 PS3 (11.1.2.3.0) CreateUserDataSetValidator Request Dataset and Custom Validation
Export /metadata/iam-features-requestactions/model-data/CreateUserDataSet.xml
Attach your dataset validator
<DataSetValidator name="CreateUserDataValidator" classname="oracle.iam.requestactions.plugins.datavalidator.CreateUserDataValidator"/>
<DataSetValidator name="MyValidator" classname="com.deepak.dubey.validator.MyValidator"/>
import oracle.iam.platform.context.ContextManager;
//How to get the currently logged in User
String subjectId = (String)ContextManager.getUserPreference(ContextManager.USERDETAILS.KEY.getKey());
import java.util.List;
import javax.swing.text.html.HTMLDocument.Iterator;
import oracle.iam.identity.exception.NoSuchUserException;
import oracle.iam.identity.exception.UserLookupException;
import oracle.iam.platform.Platform;
import oracle.iam.platform.authz.exception.AccessDeniedException;
import oracle.iam.platform.context.ContextManager;
import oracle.iam.request.exception.InvalidRequestDataException;
import oracle.iam.request.plugins.RequestDataValidator;
import oracle.iam.request.vo.Beneficiary;
import oracle.iam.request.vo.RequestBeneficiaryEntity;
import oracle.iam.request.vo.RequestBeneficiaryEntityAttribute;
import oracle.iam.request.vo.RequestData;
import oracle.iam.requestactions.plugins.datavalidator.CreateUserDataValidator;
public class MyValidator extends CreateUserDataValidator implements RequestDataValidator{
public void validate(RequestData requestdata) throws InvalidRequestDataException {
//How to get the currently logged in User
String subjectId = (String)ContextManager.getUserPreference(ContextManager.USERDETAILS.KEY.getKey());
oracle.iam.request.api.RequestService reqSvc = Platform
.getService(oracle.iam.request.api.RequestService.class);
oracle.iam.identity.usermgmt.api.UserManager usersvc = Platform
.getService(oracle.iam.identity.usermgmt.api.UserManager.class);
java.util.List<oracle.iam.request.vo.RequestEntity> l = requestdata.getTargetEntities();
for( oracle.iam.request.vo.RequestEntity r: l){
java.util.List<oracle.iam.request.vo.RequestEntityAttribute> attributes = r.getEntityData();
for(oracle.iam.request.vo.RequestEntityAttribute attribute : attributes){
System.out.println("** ->"+attribute.getName()+ "---> "+attribute.getValue());
if (attribute.getName().toString().equalsIgnoreCase("First Name"))
{
String firstName = attribute.getValue().toString();
}
if (attribute.getName().toString().equalsIgnoreCase("Last Name"))
{
String lastName = attribute.getValue().toString();
}
if (attribute.getName().toString().equalsIgnoreCase("User Manager"))
{
String managerKey = attribute.getValue().toString();
if(subjectId.equalsIgnoreCase(managerKey)){
throw new InvalidRequestDataException("Manager cannot be Self");
}
oracle.iam.identity.usermgmt.vo.User user = null;
try {
user = usersvc.getDetails(managerKey, null, false);
} catch (NoSuchUserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UserLookupException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (AccessDeniedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("manager login is --->"+user.getLogin());
String contractorManager = user.getLogin();
}
}
}
}
}
plugin.xml
<plugins pluginpoint="oracle.iam.request.plugins.RequestDataValidator">
<plugin pluginclass="com.deepak.dubey.request.MyValidator"
version="1.0"
name="MyValidator">
</plugin>
</plugins>
Sunday, July 19, 2015
OIM 11G R2 PS3 (11.1.2.3.0) Mandatory WebLogic Patches
Oracle Identity Manager OIM 11G R2 PS3 (11.1.2.3.0) Mandatory WebLogic Patches
Windows
From the Start Menu, choose:
Start > Programs > Oracle WebLogic > Smart Update
Or, from an MS-DOS command prompt window:
Go to the MW_HOME\utils\bsu directory, where MW_HOME is the host directory for the product installation that you want to update.
At the prompt, enter the following command:
bsu.cmd
The Smart Update main window is displayed.
UNIX
Note: If you want to run Smart Update on a UNIX system, the console attached to the system on which you are upgrading the software must support a Java-based GUI.
Log in to the UNIX system.
Go to the MW_HOME/utils/bsu directory, where MW_HOME is the host directory for the product installation that you want to update.
At the prompt, enter the following command:
bsu.sh
The Smart Update main window is displayed.
Copy the patch.jar and patch.xml to C:\Oracle2\Middleware\utils\bsu\cache_dir
Launch the Smart Update
Finally after applying all the mandatory patches
Windows
From the Start Menu, choose:
Start > Programs > Oracle WebLogic > Smart Update
Or, from an MS-DOS command prompt window:
Go to the MW_HOME\utils\bsu directory, where MW_HOME is the host directory for the product installation that you want to update.
At the prompt, enter the following command:
bsu.cmd
The Smart Update main window is displayed.
UNIX
Note: If you want to run Smart Update on a UNIX system, the console attached to the system on which you are upgrading the software must support a Java-based GUI.
Log in to the UNIX system.
Go to the MW_HOME/utils/bsu directory, where MW_HOME is the host directory for the product installation that you want to update.
At the prompt, enter the following command:
bsu.sh
The Smart Update main window is displayed.
Copy the patch.jar and patch.xml to C:\Oracle2\Middleware\utils\bsu\cache_dir
Launch the Smart Update
Finally after applying all the mandatory patches
Saturday, July 18, 2015
Subscribe to:
Posts (Atom)