Search in sources :

Example 1 with OrganizationalUnit

use of com.iplanet.ums.OrganizationalUnit in project OpenAM by OpenRock.

the class DirectoryServicesImpl method createGroupContainer.

private void createGroupContainer(PersistentObject parentObj, Map attributes, String profileName) throws UMSException, AMException {
    AttrSet attrSet = CommonUtils.mapToAttrSet(attributes);
    makeNamingFirst(attrSet, getNamingAttribute(AMObject.GROUP_CONTAINER), profileName);
    TemplateManager tempMgr = TemplateManager.getTemplateManager();
    String orgDN = getOrganizationDN(internalToken, parentObj.getDN());
    CreationTemplate creationTemp = tempMgr.getCreationTemplate("BasicGroupContainer", new Guid(orgDN), TemplateManager.SCOPE_ANCESTORS);
    OrganizationalUnit gc = new OrganizationalUnit(creationTemp, attrSet);
    parentObj.addChild(gc);
}
Also used : CreationTemplate(com.iplanet.ums.CreationTemplate) AMOrganizationalUnit(com.iplanet.am.sdk.AMOrganizationalUnit) OrganizationalUnit(com.iplanet.ums.OrganizationalUnit) TemplateManager(com.iplanet.ums.TemplateManager) Guid(com.iplanet.ums.Guid) AttrSet(com.iplanet.services.ldap.AttrSet)

Example 2 with OrganizationalUnit

use of com.iplanet.ums.OrganizationalUnit in project OpenAM by OpenRock.

the class DirectoryServicesImpl method createOrganizationalUnit.

private void createOrganizationalUnit(SSOToken token, PersistentObject parentObj, Map attributes, String profileName) throws UMSException, AMException {
    // Invoke the Pre Post Plugins
    String orgDN = getOrganizationDN(internalToken, parentObj.getDN());
    String entryDN = getNamingAttribute(AMObject.ORGANIZATIONAL_UNIT) + "=" + profileName + "," + parentObj.getDN();
    attributes = callBackHelper.preProcess(token, entryDN, orgDN, null, attributes, CallBackHelper.CREATE, AMObject.ORGANIZATIONAL_UNIT, false);
    AttrSet attrSet = CommonUtils.mapToAttrSet(attributes);
    makeNamingFirst(attrSet, getNamingAttribute(AMObject.ORGANIZATIONAL_UNIT), profileName);
    TemplateManager tempMgr = TemplateManager.getTemplateManager();
    CreationTemplate creationTemp = tempMgr.getCreationTemplate("BasicOrganizationalUnit", new Guid(orgDN), TemplateManager.SCOPE_ANCESTORS);
    attrSet = combineOCs(creationTemp, attrSet);
    OrganizationalUnit ou = new OrganizationalUnit(creationTemp, attrSet);
    parentObj.addChild(ou);
    // Invoke Post processing impls
    callBackHelper.postProcess(token, ou.getDN(), orgDN, null, attributes, CallBackHelper.CREATE, AMObject.ORGANIZATIONAL_UNIT, false);
}
Also used : CreationTemplate(com.iplanet.ums.CreationTemplate) AMOrganizationalUnit(com.iplanet.am.sdk.AMOrganizationalUnit) OrganizationalUnit(com.iplanet.ums.OrganizationalUnit) TemplateManager(com.iplanet.ums.TemplateManager) Guid(com.iplanet.ums.Guid) AttrSet(com.iplanet.services.ldap.AttrSet)

Aggregations

AMOrganizationalUnit (com.iplanet.am.sdk.AMOrganizationalUnit)2 AttrSet (com.iplanet.services.ldap.AttrSet)2 CreationTemplate (com.iplanet.ums.CreationTemplate)2 Guid (com.iplanet.ums.Guid)2 OrganizationalUnit (com.iplanet.ums.OrganizationalUnit)2 TemplateManager (com.iplanet.ums.TemplateManager)2