Slides from IUG 2015 on using Open Refine to grab your permissions from Sierra Passwords and Authorizations.
Demo http://screencast.com/t/YMgY404F
GitHub with JSON code: https://github.com/whitni/IUG2015
3. INSTALL OPEN REFINE
Download & Install OpenRefine
Go to & Download: http://openrefine.org/download.html
**If on Mac change system security settings to: Allow Apps to DL from Anywhere
How to Launch OpenRefine WorkSpace if it doesn’t launch
automatically
Open Browser > Go to http://127.0.0.1:3333/
4. CREATE PROJECT - PASTE CODE FROM III
• Need access to Sierra Admin Corner & User Permission 30
(password & authorizations)
• Search for <span id=“If_40”> in permission source code
• Select/Copy all code from <span id=“If_40”> to <span
id=“For_527>
1. Click “create
project”
2. Select “Clipboard”
3. Paste code copied
from above.
5. SELECT CODE PORTION FOR PROJECT DATA
Selecting XML element for parsing <option…>[code]</option>
6. APPLY A,B,C AND 1,2,3 FOR CLEAN-UP
• Split Permission name & Number
• Select column > edit columns > split into several columns >
• Separator == (
• Split into 2 columns
• Transform cells (GREL replace)
• Edit Cells > Transform > GREL string { value.replace(“)”,” “) }
• Remove unnecessary columns
• Mass edit cells with Text Facet
• Facet > Text Facet
• Selected > edit > Assigned > apply
• Blank > edit > Apply
• Blank > All > Edit Rows > Remove all matching rows
7. EXPORT PROJECT TO COMP
• Close all open facets and filters
• Select Export > Select Format > apply internal formatting
• Open local file listing only assigned permissions
8. EXTRACT JSON CODE
• Click Undo/Redo tab on current project
• Click extract
• Highlight & copy JSON code
• Save in Text Editor
• Paste into New Project
10. OpenRefine Wiki :
https://github.com/OpenRefine/OpenRefine/wiki
GitHub Repos
OpenRefine : https://github.com/OpenRefine/OpenRefine
LODRefine (OpenRefine with Linked Data extension installed):
https://github.com/sparkica/LODRefine
JSON Code used in this Presentation:
https://github.com/whitni/IUG2015
RESOURCES
Hi, I’m Whitni Watkins the Systems and Technical Services librarian at St. Lawrence University. I will be showing you a way to make the viewing/printing of user permissions in Sierra much more user friendly, through the use of OpenRefine.
Prior to working with Sierra, I was the System Administrator for Millennium where I spent a large amount of my time in Telnet. One of the things I loved was the accessibility to print system information like user permissions. They were easily viewed on one screen, easy to share with dept heads, easy to compare to other users, easier to work with all around. This functionality is non-existent in Sierra, there is lots of click and drag and scrolling to see exactly what a user has AND you can’t print them (WHAT?!) and it is highly frustrating so that was my problem and here is my solution. Yes, there is an ability to do this with a SQL query but what if you don’t have significant enough knowledge in SQL then what?
To create our project, we first select Create Project in OpenRefine and then we select the option to paste text/code.
We need to pull the code from our Sierra Admin Corner permissions page. To do this, you need to have access to the Admin Corner and the ability to view authorizations and authentications (Sierra permission 30).
Log into your admin corner, for security and time reasons I am using screen shots instead of live login. Right click on the page, select to view Page Source and once you have the page source hit cmd+f or ctrl+f (depending on device) and search for this string: <span id=“If_40”>
Copy from the top of that code to the last line of permissions, doing this is much easier to parse through in OpenRefine than pasting the entire source code, believe me I tried. Paste this into the Project you are creating in OpenRefine.
Once we have the code in we are now going to select the string of information that will more or less be our individual pieces of data. Doing this will allow OpenRefine to automate the selection by finding similar strings and separating them on to different lines.
Each section of code will be the <option value…> [code]</option>, this will make sure as little unnecessary data is retained in the project file.
It is important to highlight only this section of the XML otherwise your parsed data will not be friendly to work with once you create the project.
I recommend that you title your project with the Username for whom the permissions belong; this will help you identify the user when you export the project.
Now that we have the code separated, we need to apply different parameters to clean it up and retain only the information we care about. In this case the permission number, permissions group and the brief explanation of the permission.
I will quickly walk through these steps
First we want to remove any of the unnecessary data
Then we want to data split the Permission name and Permission number, this currently is optional, however I am working on a linking database that will match on permission number and link to the corresponding page in the reference guide, so I split them.
Now we want to use the transform feature and GREL string value.replace, which is essentially a find and replace; this is saying to find the ) and replace them with nothing.
Now we have the mass editing with the Text Facet.
DEMO:
/Users/wwatkins/Dropbox/Work/SLU 2014 -/Conference Proposals/IUG_demo.swf
I exported the records as Excel and then formatted them to a Word Doc I had created so that is the shot on the left.
Using the JSON code from the project you can extract it and apply it to any future project that you want to have the same steps.
I recommend copying the JSON into your text editor and saving it locally/to the cloud/whatever place outside of LODRefine.
Using the JSON code from the project you can extract it and apply it to any future project that you want to have the same steps.
I recommend copying the JSON into your text editor and saving it locally/to the cloud/whatever place outside of LODRefine.
Using the JSON code from the project you can extract it and apply it to any future project that you want to have the same steps.
I recommend copying the JSON into your text editor and saving it locally/to the cloud/whatever place outside of LODRefine.
I have shared the JSON code and the <database code> on X (decide whether you are going to share it on the website, on google drive, dropbox, IUG clearinghouse)
Feel free to contact me via email and add me on Twitter
Questions?