Hello Hannes, this sounds like quite a project. Overall, your analysis of the situation is sound. I know that the GCI will be producing more documentation regarding these customizations, because as Dennis says, to use a modified resource graph, you must also modify the data entry forms. So, stay tuned for that, but in the meantime I can share a bit of my own experience because your instinct to not plunge into the code blindly is commendable.
I didn't have any experience with Django before working on the Cane River project, but now feel I can answer your "naive" question which is actually a very wise one: Basically, Django is a framework (written in Python) that sits on a server and "creates" a web application a.k.a. website. Arches is an app that is built using the Django framework. In the case of Arches, the app is actually a composite of three directories: "arches" and "arches_hip" (both in the virtual environment site-packages directory), and your own app directory. If you look at the contents of these three directories, you'll see a lot of structural overlap (they all have a "settings.py" file, for example). Django dynamically "aggregates" those three directories, with priority given in the reverse order that I just listed (i.e. your app > arches_hip > arches). So when you go to the Arches website, you are seeing the result of Django pulling code (.htm, .js, .css) from all three directories, and using python (.py) files to do it. I say this is a wise question, because it ties into the method that you have to use to update the forms. With that Django "aggregation" concept in mind, let's say you want to modify the "description" data entry form. Look in the arches_hip directory (ENV/lib/python2.7/site-packages/arches_hip) and go to templates/views/forms. Here you can find the "description.htm" file. The first step is to copy this file and its corresponding javascript file (arches_hip/media/js/views/forms/description.js) to your app directory, making sure to replicate the full directory paths. Once you've done that, Django will no longer use the description.htm and description.js files in arches_hip; it will choose the new corresponding files that you've placed in your app. Now you can modify those files and it will be reflected in your app. I'd recommend starting by just changing a single string in the html file, just to make sure that you've created the correct path structure. (One important note: for any css modifications, just put those in the "media/css/package.css" file that is already in your app, and that will override all the other css rules.) That's the first step. You also have to "supply" the new node information to that html/javascript pair, and this is where you need a bit of Python. You'll want to do the same file copying procedure that I described above with the arches_hip/models/forms.py file. The forms.py file is where you define what node information is available to each form. I hope all of that makes sense and I haven't over-complicated things. Certainly, you've hit upon what was the trickiest part (for me) of the Arches customization, but like I said, the Getty will be providing more documentation in the future. Hopefully this will help get you pointed in the right direction though. On Thursday, July 9, 2015 at 5:18:27 AM UTC-5, H Pirker wrote: > > Dear Developers -- and all you seasoned users :-) > > We are going to use arches3 / arches-hip as a database on archaeological > sites in Greece and Turkey. > For this purpose we need to adapt Resource Graphs in arches-hip to > accomodate new fields. > > Dennis Wuthrich already supplied us with the following hints (thank you, > Dennis). I am putting the question to the forum as I hope it will foster > crowd-intelligence: > > You can modify these graphs, or create new graphs to meet your data >> management demands. This work is done outside Arches. In other words, you >> just need to create the nodes and edges file that are required to define a >> graph that meets your requirements. There are some very simple rules to >> creating graphs for Arches, most of which you can infer simply by looking >> at the nodes/edges files that come with Arches. >> > > This step is quite clear to us (at least we think so, before having really > started) > > One thing to know: once you create new graphs you will need to create new >> data entry forms (or perhaps modify existing forms). You’ll probably also >> want to create or modify Arches’ default graph reports too. This will >> require that you or your project team members are familiar with a bit of >> python, javascript, and html > > > As far as I understand, arches "ends" when it comes to provide / adapt > forms and reports for the business data. > But maybe there is slightly more information available on how actually > proceed with these necessary adaptations in arches' python / javascript and > html code? > In the online-documentation there are some placeholders for "Forms" and > "Reports" -- is there any chance to get some preliminary pieces of > documentation on that already? > > Anybody out there who already made changes to arches' Resource-Graphs and > went through the subsequent adaptations in the code? > > A more specific question: I am not really familar with Django yet, > therefore I have to ask a probably "naive" question: to which extent does > arches rest on Django? Will the necessary adaptations become clear / > obvious / trivial :-) for anybody with a sounder knowledge of Django, or > will we always need to go through the whole source-code of arches in order > to build up the necessary understanding of implementation-details? > > Finally we will have to plunge into the code, I know, but I am still > hoping we won't have to do it blindly :-) > > Many thanks & all the best > > Hannes > > -- -- To post, send email to [email protected]. To unsubscribe, send email to [email protected]. For more information, visit https://groups.google.com/d/forum/archesproject?hl=en --- You received this message because you are subscribed to the Google Groups "Arches Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
