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

new data type #2

Open
EnterpriseWide opened this issue Feb 23, 2015 · 6 comments
Open

new data type #2

EnterpriseWide opened this issue Feb 23, 2015 · 6 comments
Assignees

Comments

@EnterpriseWide
Copy link

Hi there,
Is there a way to have the fields currently required for the Data Type entered in the content section. The site I am working on is a multi tennant instance and each tennant has their own authorisation data. It the authorisation was part of the content then creation then the client would first specify the 3 fields and the property would then authorise all in one step rather than creating multiple data types per client app.

@abjerner
Copy link
Owner

Hi again,

Can you elaborate a bit on this one? I'm not sure that I understand.

@EnterpriseWide
Copy link
Author

Sure,

I wanted to create a picker for a content item that allowed a user to pick twitter, facebook or instagram and hide away the need to authorise with those 3rd party api's.
I found that I wanted to authorise once but reuse the authorisation on different content items, so I did the following:

  1. Create a Social Media Application Repository DocType
  2. Create a Social Media Application
  3. Create a Content Item called Social Media Applications based on the Social Media Application Repository DocType
  4. Create a DataType called Social Media Application Picker using the MultiNode Tree Picker which uses the new Social Media Applications Content Item as the root
  5. Add property for a page called Social Media Applications
  6. Create a DataType called Authorise Instagram with Instagram Client Id Data
  7. Create a DataType called Authorise Facebook with Facebook Client Id Data
  8. Create a DataType called Authorise Twitter with Twitter Client Id Data
  9. Create Social Media Application Instagram DocType as a child of Social Media Application with a property called Authorisation of type Authorise Instagram
  10. Create Social Media Application Facebook DocType as a child of Social Media Application with a property called Authorisation of type Authorise Facebook
  11. Create Social Media Application Twitter DocType as a child of Social Media Application with a property called Authorisation of type Authorise Twitter
  12. Update DocType Social Media Application Repository to allow Social Media Application Instagram, Social Media Application Facebook and Social Media Application Twitter DocTypes beneath it.
  13. Create a Content Item for Instagram in Social Media Applications and Authorise
  14. Create a Content Item for Facebook in Social Media Applications and Authorise
  15. Create a Content Item for Twitter in Social Media Applications and Authorise.

What I am thinking about is not having to create so many doc types and data types regardless of the number of Social Media Applications I need to create.
So I was wondering whether I could create a DataType which would replace items 6,7,8,9,10,11 above with the following:

Create a DataType called Inline Authorisation
Add a property called Authorisation to Social Media Application based on Inline Authorisation.
Create a Content Item for Instagram in Social Media Applications with Instagram Client Id Data and Authorise
Create a Content Item for Facebook in Social Media Applications with Facebook Client Id Data and Authorise
Create a Content Item for Twitter in Social Media Applications with Twitter Client Id Data and Authorise.

The functionality of the Inline Authorisation DataType would be as follows:
if Authorisation Property is empty then present Client Id Data Fields and a button to Authorise
if Authorisation Property is not empty then present authorisation view with a button to reset

@EnterpriseWide
Copy link
Author

too much maybe!
Is this any better :)
I would like to create a property called Authorisation that has a Skybrud DataType of Inline Authorisation and in the content section, enter the 3 fields that you currently ask for in the DataType. Once they you have entered that information you can Authorise. So all the data is in the content section and the datatype has no properties.

@abjerner
Copy link
Owner

abjerner commented Mar 5, 2015

Hey. I haven't had the time to look through your latest comments, which is why I haven't replied for a while.

I like to think that this package can do much more than what is currently supported, so your ideas are more than welcome. I do however still find it a bit unclear what the various property editors (data types) should be able to do. If you could describe each desired property editor a bit more, that would help me a lot.

@EnterpriseWide
Copy link
Author

OK, :)
I'm only after 1 DataType. The idea is to keep all the config out of the DataType and move the configuration to the Content Item. So the App Id, App Secret and Redirect URI are content and not datatype config.

DataType:
Skybrud Inline Authorisation

DataType Properties:
None

States of a Content Item Property based on this DataType:

  1. Empty
    Display when a content item is first created
    You see 3 empty fields for this one property that are
    App Id, App Secret, Redirect URI and a Configure Button
  2. Configured
    Displayed after successful entering an App Id, App Secret, Redirect URI, pushing the configure button and receiving a success message
    Display an Authorise Button (same as now)
  3. Authorised
    Displayed after successfully authorising with social media api
    Display profile image and username (same as now)

Usage:
Create / Edit a Doctype for a page and add a property called Authorisation which is set to be of type Skybrud Inline Authorisation
Add Property based on DataType to a DocType
Create / Edit a content item based on that Doctype
Update the App Id, App Secret, Redirect URI for the Property on the Content Item and click Configure
Click the Authorise Button
Click the Save and Publish Button

@abjerner
Copy link
Owner

abjerner commented Mar 6, 2015

Okay. That should be possible. I will look into that when I can find the time for it ;)

@abjerner abjerner self-assigned this Mar 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants