<div dir="ltr">Hello Brian,<div><br></div><div>Thank you for your recommendations, they've helped out a lot. I believe I am very close to what I want to do and what I want to achieve, but I've reached a little snag and I can't find the problem.</div><div><br></div><div>I took a little different path that I thought matched a bit closer to what I wanted to accomplish through your suggestions and tried to mimic the preferences/defaults. (a new version of my code at <a href="https://github.com/l3mus/ArchivesSpace-authority-project/tree/master/plugin_settings">https://github.com/l3mus/ArchivesSpace-authority-project/tree/master/plugin_settings</a>)</div><div><br></div><div>At <a href="https://github.com/l3mus/ArchivesSpace-authority-project/blob/master/plugin_settings/frontend/controllers/plugin_settings_controller.rb#L82">https://github.com/l3mus/ArchivesSpace-authority-project/blob/master/plugin_settings/frontend/controllers/plugin_settings_controller.rb#L82</a> I am getting a nil class error because it's not in the json and I can't find the area where it gets added or if there is a step that I'm missing for it to add that setting. I think it would be beneficial if the settings could be edited in a per repository/per user basis like the preferences seem to work. </div><div><br></div><div>{"settings"=>{"ead_loc_text"=>"Findind Aid Location: "}, "global"=>#<JSONModel(:plugin_settings) {"id"=>1, "lock_version"=>22, "json_schema_version"=>1, "repo_id"=>1, "user_uniq"=>"GLOBAL_USER", "settings"=>#<JSONModel(:settings) {"ead_loc_text"=>"Findind Aid Location: ", "jsonmodel_type"=>"settings"}>, "create_time"=>"2015-10-14T21:45:28Z", "system_mtime"=>"2015-10-15T20:13:34Z", "user_mtime"=>"2015-10-15T20:13:34Z", "jsonmodel_type"=>"plugin_settings", "uri"=>"/repositories/1/plugin_settings/1"}>, "settings_global"=>{"ead_loc_text"=>"Findind Aid Location: "}}<br></div><div><br></div><div>it's missing that ['global']['repository']['ref'] value, I'm not sure where it's coming from.</div><div><br></div><div>The json above is coming from the following. It's either in here or somewhere before that that global setting is set.</div><div><a href="https://github.com/l3mus/ArchivesSpace-authority-project/blob/master/plugin_settings/backend/model/plugin_settings.rb#L95">https://github.com/l3mus/ArchivesSpace-authority-project/blob/master/plugin_settings/backend/model/plugin_settings.rb#L95</a><br></div><div><br></div><div>I appreciate the help,</div><div><br></div><div>Thank you,</div><div>Carlos Lemus</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 13, 2015 at 7:11 AM, Carlos Lemus <span dir="ltr"><<a href="mailto:carlos.lemus@unlv.edu" target="_blank">carlos.lemus@unlv.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hello Brian,</p>
<p dir="ltr">Thank you for the response. I will definitely need more values so I'll try taking a look at the defaults controller.<br>
I'll let you know if I get something working.</p>
<p dir="ltr">Thank you,<br>
Carlos Lemus</p><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">On Oct 13, 2015 6:31 AM, "Brian Hoffman" <<a href="mailto:brianjhoffman@gmail.com" target="_blank">brianjhoffman@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Carlos,<div><br></div><div>I think you might want to look at the defaults controller and model, as well as the sequence controller and model. If you really just need a single string value, you may want to dispense with the JSONModel stuff completely and just have your backend endpoint take a single parameter and update the model.</div><div><br></div><div>You can look at the DefaultValues model for an example of how to just have 1 row in the table.</div><div><br></div><div>For the frontend, you’re probably better off not using the handle_crud helper if you don’t use JSONModel, and just have the controller prepare and send an update request to the backend. The default_values example might help here too:</div><div><a href="https://github.com/archivesspace/archivesspace/blob/master/frontend/app/models/default_values.rb" target="_blank">https://github.com/archivesspace/archivesspace/blob/master/frontend/app/models/default_values.rb</a></div><div><br></div><div>Brian</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div><blockquote type="cite"><div>On Oct 12, 2015, at 5:54 PM, Carlos Lemus <<a href="mailto:carlos.lemus@unlv.edu" target="_blank">carlos.lemus@unlv.edu</a>> wrote:</div><br><div><div dir="ltr"><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">Hello,</span><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px">What I want to accomplish is to create a form, possibly in the system_menu_controller, that will allow me to create certain fields/settings with user-input values, save those values, and then let me access them at different points in my plugin. </div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px">What I've tried so far:</div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px">I've tried to mimic a bit of the accessions_summary_reports and the hello_world plugin. However, these seem both to be able to continuously create new objects in the schema database pertaining to it, but I just want to have one empty field for the settings that can just be updated instead of having to create multiple settings. I have tried something similar with the defaults, but I don't think I implemented them correctly.</div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px">Here is a github link to my trial</div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px"><a href="https://github.com/l3mus/ArchivesSpace-authority-project/tree/master/plugin_settings" rel="nofollow" style="margin:0px;padding:0px;border:0px;text-decoration:none;color:rgb(102,17,204)" target="_blank">https://github.com/l3mus/ArchivesSpace-authority-project/tree/master/plugin_settings</a><br></div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px">I hope that was clear enough, please let me know if I need to clarify more.</div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px">I'm just looking for some direction on what I could be doing. How could I approach doing this? I'm I looking in the right direction? Or is there a better example that can help me form this? </div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px">Thank you,</div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></div><div style="margin:0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-size:13px">Carlos Lemus</div></div>
_______________________________________________<br>Archivesspace_Users_Group mailing list<br><a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" target="_blank">Archivesspace_Users_Group@lyralists.lyrasis.org</a><br><a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" target="_blank">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a><br></div></blockquote></div><br></div></div></blockquote></div>
</div></div></blockquote></div><br></div>