OfficeDev / Office-365-SDK-for-Java

Office 365 client for Java
Other
48 stars 39 forks source link

ID is not exposed #7

Closed dima767 closed 8 years ago

dima767 commented 8 years ago

With the Java SDK, the entity ids do not seem to be exposed. For example, with the following code to create a simple group:

private static void addOneGroup(OrcCollectionFetcher<Group, GroupFetcher, GroupCollectionOperations> groupsFetcher)
            throws Exception {
        Group g = new Group();
        g.setDescription("Group created via REST API");
        //Required
        g.setDisplayName("Test Group");
        //Required
        g.setMailNickname("test_nick");
        //Required
        g.setMailEnabled(false);
        //Required
        g.setSecurityEnabled(true);
        logger.info("Creating test group...");
        Object o = groupsFetcher.add(g);
}

the Group::getObjectId always returns null and there is no other "id" properties on the Group or DirectoryObject. Without the id being exposed, how could one delete or update entities via this SDK API? Since the update and delete methods are only available via OrcEntityFetcher and to obtain it, requires to pass the id value to getById

Ping @marcote

marcote commented 8 years ago

@dima767 can you please tell me what SDK are you working on? Graph?

dima767 commented 8 years ago

@marcote ,

Yes, graph SDK, and I'm specifically interested in Groups API - just need to be able to do all the CRUD operations easily via the SDK. Here's the "tester" app that tries to exercise this SDK: https://github.com/UniconLabs/o365-java-sdk-basic-usage-scratch

marcote commented 8 years ago

@dima767 We're completely rewriting the Graph SDK as we speak. And I have bad news and good news for you:

Bad news: We're not maintaining/supporting this Java Graph SDK anymore, at least until we release the new Graph SDK . The metadata has changed, and the ID property you're looking for is "new" and the codegen is out of sync.

Good news: You can use the newer generated code here: https://github.com/OfficeDev/Microsoft-Graph-SDK-Android/tree/master/sdk/graph-services/src/main/java/com/microsoft/services

Everything under that directory is the same generated code. If you take a look, you will see the ID property in the Entity class. Solution: replace the generated code with the one from the Android repo you'll see the missing ID property.

dima767 commented 8 years ago

OK, thanks. I'll give it a shot. Q1: Do you release this Android SDK to Maven central? Q2: Do you have an approximate timeline when the new Graph SDK might appear?

marcote commented 8 years ago

@dima767 Q1: Most likely Bintray and JCenter but yes, we can try to do MavenCentral Q2: After the Build 2016 Conference (end of March)

dima767 commented 8 years ago

Oh, as long as it's published to jcenter, it fine. Do you happen to know the maven/jcenter 'coordinates'?

marcote commented 8 years ago

of the new packages? Not sure yet. organization and all that stuff will change and it's not defined yet. sorry.