Skip to content

Commit d7bcd88

Browse files
author
TanyaEf
committed
Updated Readme.md
1 parent 39b13b8 commit d7bcd88

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -486,23 +486,23 @@ OperationResult<Organization> result = session
486486
.createOrUpdate(organization);
487487
```
488488
Be carefully using this method because you can damage existing organization if the `organizationId` of new organization is already used.
489-
The descriptor sent in the request should contain all the properties you want to set on the new organization. Specify the `parentId` value to set the parent of the organization, not the `tenantUri` or `tenantFolderUri` properties.
489+
The descriptor is sent in the request should contain all the properties you want to set on the new organization. Specify the `parentId` value to set the parent of the organization, not the `tenantUri` or `tenantFolderUri` properties.
490490
However, all properties have defaults or can be determined based on the alias value. The minimal descriptor necessary to create an organization is simply the alias property. In this case, the organization is created as child of the logged-in user’s home organization.
491491
####Modifying Organization Properties
492492
To modify the properties of an organization, use the `update` method and specify the organization ID in the URL. The request must include an organization descriptor with the values you want to change. You cannot change the ID of an organization, only its name (used for display) and its alias (used for logging in).
493493
```java
494494
Organization organization = new Organization();
495495
organization.setAlias("lalalaOrg");
496496

497-
OperationResult<Organization> result = session
497+
OperationResult<ClientTenant> result = session
498498
.organizationsService()
499499
.organization("myOrg1")
500500
.createOrUpdate(organization);
501501
```
502502
####Deleting an Organization
503503
To delete an organization, use the `delete()` method and specify the organization ID in the `organization()` method. When deleting an organization, all of its resources in the repository, all of its sub-organizations, all of its users, and all of its roles are permanently deleted.
504504
```java
505-
OperationResult result = session
505+
OperationResult<ClientTenant> result = session
506506
.organizationsService()
507507
.organization("myOrg1")
508508
.delete();
@@ -603,7 +603,7 @@ ClientUser user = new ClientUser()
603603
client
604604
.authenticate("jasperadmin", "jasperadmin")
605605
.usersService()
606-
.user(user.getUsername())
606+
.user("john.doe")
607607
.createOrUpdate(user);
608608
```
609609
####Deleting a User
@@ -714,10 +714,10 @@ serverAttributes.setProfileAttributes(asList(new HypermediaAttribute(new ClientU
714714
.createOrUpdate(serverAttributes);
715715
```
716716
Be careful with definition of attribute names because the server uses different strategies for creating or updating attributes depending on list of attribute names, list of attributes and existing attributes on the server:
717-
1. if requested attribute name in `attributes()` method matches with attribute name of object defined in `createOrUpdate()` method and the attribute does not exist on the server it will be *created* on the server;
718-
2. if requested attribute name in `attributes()` method matches with attribute name of object defined in `createOrUpdate()` method and the attribute exists on the server it will be *updated* on the server;
719-
3. if requested attribute name in `attributes()` method does not match with any attribute names of object defined in `createOrUpdate()` method and the attribute exists on the server it will be *deleted* on the server;
720-
4. if requested attribute in `createOrUpdate()` method method does not match with any attribute names in `attributes()` it will be *ignored* and will not be sent to the server;
717+
1. if requested attribute name in `attributes()` method matches with attribute name of object defined in `createOrUpdate()` method and the attribute does not exist on the server it will be *created* on the server;
718+
2. if requested attribute name in `attributes()` method matches with attribute name of object defined in `createOrUpdate()` method and the attribute exists on the server it will be *updated* on the server;
719+
3. if requested attribute name in `attributes()` method does not match with any attribute names of object defined in `createOrUpdate()` method and the attribute exists on the server it will be *deleted* on the server;
720+
4. if requested attribute in `createOrUpdate()` method method does not match with any attribute names in `attributes()` it will be *ignored* and will not be sent to the server;
721721

722722
The second way of using the attributes service is adding or replacing individual attribute:
723723
```java
@@ -839,21 +839,20 @@ OperationResult<HypermediaAttributesListWrapper> operationResult = session
839839
####Viewing Server Attributes
840840
We have also provided service to get server attributes. Code below return available server attributes.
841841
```java
842-
List<ServerAttribute> attributes = session
843-
.serverAttributesService()
844-
.attributes()
842+
List<HypermediaAttribute> attributes = session
843+
.attributesService()
844+
.allAttributes()
845845
.get()
846846
.getEntity()
847-
.getAttributes();
847+
.getProfileAttributes();
848848
```
849849
Or you can specify any concrete attribute.
850850
```java
851-
List<HypermediaAttribute> attributes = session
851+
HypermediaAttribute entity = session
852852
.attributesService()
853-
.allAttributes()
853+
.attribute("attribute_name")
854854
.get()
855-
.getEntity()
856-
.getProfileAttributes();
855+
.getEntity();
857856
```
858857
####Setting Server Attributes
859858
It is possible to create new server attributes.
@@ -968,7 +967,7 @@ v2/users service. For details, see section [creating a user](https://github.com/
968967
To delete a role, send the DELETE method and specify the role ID (name) in the URL.
969968
When this method is successful, the role is permanently deleted.
970969
```java
971-
OperationResult operationResult =
970+
OperationResult<ClientRole> operationResult =
972971
client
973972
.authenticate("jasperadmin", "jasperadmin")
974973
.rolesService()

0 commit comments

Comments
 (0)