Page tree
Skip to end of metadata
Go to start of metadata

The "space" query returns a specific Space. The query requires a mandatory attribute for the id of the Space to retrieve.

The org.opencode4workspace.builders.SpaceGraphQLQuery class has a simple static helper method, buildSpaceGraphQueryWithSpaceId(String). Similar methods are also available from WWClient and WWGraphQLEndpoint.

For greater control, create an ObjectDataSenderBuilder for the Space.ONE_SPACE_QUERY_OBJECT_NAME object, adding the Space id attribute, passing in Space fields and children. Instantiate a new SpaceGraphQLQuery passing in the ObjectDataSenderBuilder as the parameter. Then pass this to WWClient.getSpaceWithQuery().

Space Members

While developing the SDK, it was expected that getting members for a Space would be a common requirement. Consequently the org.opencode4workspace.builders.SpaceMembersGraphQLQuery class has a simple static helper method, buildSpaceMembersGraphQueryWithSpaceId(String). Similar methods are also available from WWClient and WWGraphQLEndpoint.

For greater control, create an ObjectDataSenderBuilder for the Space.ONE_SPACE_QUERY_OBJECT_NAME object, adding the Space id attribute, passing in Space fields and children. Instantiate a new SpaceMembersGraphQLQuery passing in the ObjectDataSenderBuilder as the parameter. Then pass this to WWClient.getSpaceMembersWithQuery().

Examples

Basic getSpace
    Space space = client.getSpaceById(spaceId);
    assert (space.getMembers().size() > 0);
getSpaceWithQuery
    ObjectDataSenderBuilder query = new ObjectDataSenderBuilder();
    query.setObjectName(Space.ONE_SPACE_QUERY_OBJECT_NAME);
    query.addAttribute(SpaceAttributes.ID, spaceId);
    query.addField(SpaceFields.ID);
    query.addField(SpaceFields.TITLE);
    query.addField(SpaceFields.DESCRIPTION);

	Space spaceResult = client.getSpaceWithQuery(new SpaceGraphQLQuery(query));
basic getSpaceMembers
    List<Person> members = client.getSpaceMembersById(spaceId);
    assert (members.size() > 0);
getSpaceMembers
    ObjectDataSenderBuilder query = new ObjectDataSenderBuilder();
    query.setObjectName(Space.ONE_SPACE_QUERY_OBJECT_NAME);
    query.addAttribute(SpaceAttributes.ID, spaceId);
    ObjectDataSenderBuilder members = new ObjectDataSenderBuilder(SpaceChildren.MEMBERS.getLabel(), true);
    members.addField(PersonFields.ID);
    members.addField(PersonFields.PHOTO_URL);
    members.addField(PersonFields.EMAIL);
    members.addField(PersonFields.DISPLAY_NAME);
    members.addChild(new BasicCreatedByUpdatedByDataSenderBuilder(PersonChildren.CREATED_BY));
    members.addChild(new BasicCreatedByUpdatedByDataSenderBuilder(PersonChildren.UPDATED_BY));
    query.addChild(members);

	List<Person> members = client.getSpaceMembersWithQuery(new SpaceMembersGraphQLQuery(query));

17 Comments

  1. Anonymous

    A question is a one-page letter presenting yourself and your novel. By and by, I'd abstain from packing an excessive amount of data into your question letter, so single-separating so as to make it fit on one page shouldn't be essential. Assignment Service

  2. Anonymous

    For greater control, create an ObjectDataSenderBuilder for the Space. Btw if you are looking for best PPC Services in Australia, visit PPC Services Australia.

  3. Anonymous

    Instantiate a new SpaceGraphQLQuery passing in the ObjectDataSenderBuilder as the parameter. And if you are looking for the best web development services please visit Web Development USA

  4. Anonymous

    It was actually best website for IT learners as they can get useful information regarding SQL, database and java script. Keep sharing good content.

    Alex,

    http://www.qualityassignment.co.uk/services/assignment-writing-service/

  5. Anonymous

    Very informative blog regarding space. I’ll sure it been very helpful for all people.

    Regards,

    http://www.assignmenthelpfolks.com/nursing/

  6. Anonymous

    Full of informative post which have explanation on the "space" query which returns a specific Space as it requires a compulsory attribute for the id of the Space to retrieve. Thanks for sharing it with us.

    Jack,

    http://www.qualitydissertation.co.uk/dissertation-writers

  7. Anonymous

    You wonderfully explained here space query in depth with the examples. I would like to share it with my regular students who taking personal statement writing service from Persona Statement Folks.

    Caroline, http://www.personalstatementfolks.co.uk/law-personal-statement/

  8. Anonymous

    We are providing the best Modular Kitchen Manufacturer in Delhi. For more details call us: 9868333789 or visit our website

  9. Anonymous

    We are providing the best Architects in Delhi. We are artists, we are designers, and we are here to make your space better than you could have ever imagined. For more details call us: 7011210410 or visit our website: 

  10. Anonymous

    We are offer the one of the best Xerox machine on rent on Delhi. For more Details call: 9999924096 

  11. Anonymous

    Best Dermatologist in Noida. Dermanext Skin & Hair Clinic is a boutique clinic specialising in dermatology, trichology and aesthetics. For more details call: 8860523726

  12. Anonymous

    The best Permanent Tattoo Artist in Delhi. A tattoo is a lifelong investment, and we at The Ink Boy Tattoo Studio understand that. In order to provide our customers with the best tattooing experience we devote time to designing and customizing tattoos according to our client’s needs. For more details call: 8745801112 or visit our website- 

  13. Anonymous

    Itconcept is one of the leading laptop repair service in Ghaziabad. We provide all kinds of computer/laptop repair services to all the people living and working in Ghaziabad. . For more details call: 9205059199

  14. Anonymous

    We are offer the best service Destination Wedding in Ghaziabad. We are the budget arrange destination weddings in India. For more details call: 8287954880

  15. Anonymous

    Goa is a romantic place for a couple to enjoy parties, birthday, honeymoon, anniversary. Get the best couple tour packages for Goa at Republic Holidays Travel Services. Book 4 Nights 5 Days Goa Package for couples and explore the most beautiful beaches. Goa tour will be a lifetime experience. Call now, the best services guaranteed.

    https://www.republicholidays.in/goa-tour-package

  16. Anonymous

    Webograph is the Best web designing company in Noida. Web design is the process of initiate websites, planning, and building a number of voltaic files that determine the layout, colors, text styles, structure, graphics, images, and use of connected features that deliver pages to your site visitors.Call me at @8860886596. http://www.webograph.in/

  17. Anonymous

    OMAC Provides Best industrial automation Training in Noida. Omac is one of the most authoritative industrial automation training institutes in Noida offering hands-on practical education and full job support with basic as well as excellent level industrial automation training courses.Call@9015516908. https://www.omac.in

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.