Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-WikiPage Handling #15

Closed
lipkau opened this issue Apr 6, 2017 · 5 comments
Closed

Get-WikiPage Handling #15

lipkau opened this issue Apr 6, 2017 · 5 comments

Comments

@lipkau
Copy link
Member

lipkau commented Apr 6, 2017

Current behavior

Currently there is one function to get pages, one to get child pages and one to get pages by label

Proposition

Allow Get-WikiPage to do all of these by:

# Get a page by object (useful, when you have a page object without all properties (eg: $page.ancestors))
Get-WikiPage -inputObject $somePage.ancestors

# Get a page by id
Get-WikiPage -pageID @(1,2,3)

# Get all pages of space
Get-WikiPage -spaceKey "RD"

# Get all pages with title
Get-WikiPage -Title "Home"

# Get a page with title in space
Get-WikiPage -Title "Home" -SpaceKey "RD"

# Get a page and all it's children (works with all inputs above)
$pageObject | Get-WikiPage -Recurse

# Get all pages with label
Get-WikiPage -label "meeting-notes","foo" [-SpaceKey <string>]

@brianbunke :
please let me know what you think
If you agree, I will make the changes and add them to my refactoring branch

@brianbunke
Copy link
Collaborator

All of that looks pretty good! I have two questions:

  1. Is -InputObject just going to be a bunch of If statements to check for object properties? It's a pretty generic parameter name, and will be a lot tougher to provide documentation if there are multiple different scenarios.
  2. Are you planning on changing the way -Limit behaves?

@lipkau
Copy link
Member Author

lipkau commented Apr 6, 2017

  1. Input object is already implemented in my branch.
    It takes the object and uses the props it can take. I have not implemented a validation, as the return of the invoke returns quite nicely... you can use -ErrorAction to suppress errors in cases you expect it to happen.
  2. Yes. I will implemented pagination on all Get-* functions

@lipkau
Copy link
Member Author

lipkau commented Apr 6, 2017

The -InputObject is good for scenarios like

(Get-WikiPage -title "servers").Ascendents | Get-WikiPage

@brianbunke
Copy link
Collaborator

👍 👍

@brianbunke brianbunke added this to the v2.0 milestone Apr 6, 2017
@lipkau
Copy link
Member Author

lipkau commented Apr 14, 2017

I changed my mind regarding -Recurse

I will favor Get-WikiChildPage, as the behavior will be more similar to up-coming functions (comments and attachments)

lipkau added a commit to lipkau/ConfluencePS that referenced this issue Apr 15, 2017
lipkau added a commit to lipkau/ConfluencePS that referenced this issue Apr 15, 2017
@lipkau lipkau closed this as completed Apr 15, 2017
@lipkau lipkau self-assigned this Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants