How to document a JSON Schema - jsonschema

I'm working on a Json Schema: https://github.com/andrejellema/GlobalCoffeeDataStandard/blob/master/global-coffee-data-standard.schema.json
I need to document this and am looking at ReadTheDocs.
With it, I can manually create .rst-files, but I want it to be closely linked to my schema.
Meaning it will generate the .rst files based on the title and description in my schema and generate the appropriate TOC and also insert the relevant JSON code.
Later I can manually alter the .rst files and add more descriptive content.
The goal is to let non-developers manage the documentation.
Is that even possible? Or perhaps with a different documenting tool?

Related

Migrating a websites' knowledgebase to PostgreSQL Database for search querying

I've been tasked to create a search function for a websites' knowledgebase (which is stored in a github repo). I'm only really familiar with building databases with Django, so I'm having trouble understanding how I'm supposed to upload a bunch of html files to the database and query them with postgres. Any pointers on how the database can be structured. I've heard that html files can be stored in a text field, but how are the columns structured, does each page get its' own row, etc? and how can I do this with a fairly large knowledge base without having to manually upload each file?
The db hosting platform I am using has a migration utility that says
Uploading will accept data in any of three forms, plain text (SQL), tar archives (uncompressed), or PostgreSQL's own compressed 'custom' format.
That's assuming the database is already structured.
I've heard that html files can be stored in a text field, but how are the columns structured, does each page get its' own row, etc?
Storing html in a column is perfectly acceptable. If you're storing the html in a column, then each new page requires a new row.
and how can I do this with a fairly large knowledge base without having to manually upload each file?
You just said the hosting provider permits "PostgreSQL's own compressed 'custom' format". So install PostgreSQL locally. Get it all up and working. Insert every page locally. Then you can upload to the hosting provider using pg_dump --format=c which is not just a single action, but compressed.

Can we customize Alfresco content replication service?

I want to migrate All content from one alfresco repository to other.
Here my old Alfresco repository contents are in file system and i want to migrate it to other Alfresco repository which is there in S3 Bucket of amazon cloud.
The reason why i want to customize replication service is, i want to do some validation before migration. and i want to bifurcate content based on content type. because some other logic is already written in new alfresco repository to create different folder structure for all content as per the content type.
So in this case i don't want existing folder structure. i just want all content with metadata.
Can i customize the replication service as per my requirement?
Please help me with this.
If we are not able to customize then also provide the alternative way to do the same..
Thanks in Advance..
if you want only the content details, i would suggest you to create a webscript to export all the details and store in excel. Then you can use this excel to create contents in another server according to the content type.
Consider you have two types of contents with 5Properites(Name,Type,Property1,Property2,Property3). So in script, get the content details through search serive and store it in excel sheet(a row for each contents). You can create different xls for different models also. Then in new server write a script which will read each row and create contents in new folder structure according to the content type.

How to create tables in the markLogic by using sql

Good morning all,
How to create employees table in the marklogic by using sql or javascript?
Thanks in advance,
Naveen
You do not create tables in MarkLogic. You insert individual structured documents (XML/JSON) where each document is as close as you would get to the idea of a table row in a relational database.
For use of SQL to query these documents, MarkLogic allows you to create views. These are similiar to views in SQL and expose specific elements/attributes/properties of your documents.
I think you need to read the section on SQL in MarkLogic as a starting point and then come back with more specific questions if you get stuck. https://docs.marklogic.com/guide/sql/intro
MarkLogic is schema agnostic, you can achieve a structure thru a Schema database to enforce document structure. Just create your XSD file and your document can be validated against that.
Check this link for more information:
https://developer.marklogic.com/learn/2007-04-schema
Since MarkLogic is schema-agnostic database, you can restrict the element/attribute or define the XML structure through XSD.
However if you want to create tables using SQL, you actually have to create views.
Please check more on https://docs.marklogic.com/guide/sql/intro.
N.B : If you are creating views, make sure range-index is created for all the elements or attributes that you wish to use.

Grails app: own query language for data stored in DB and files + full text search (Hibernate Search, Compass etc)

I have an application which stored short descriptive data in DB and lots of related textual data in text files.
I would like to add "advanced search" for DB. I was thinking about adding own query language like JIRA does (Jira Query Language). Then I thought about having full text search across those textual files (less priority).
Wondering which tool will better suite me to implement that faster and simpler.
I most of all I want to provide users with ability to write their own queries instead of using elements to specify search filters.
Thanks
UPD. I save dates in DB and most of varchar fields contain one word strings.
UPD2. Apache Derby is used right now.
Take a look at the Searchable plugin for Grails.
http://www.grails.org/plugin/searchable

How can I change the schema of an existing tridion component

I have some component items in tridion which are set up for a particular schema. I'd like to be able to change the schema for those items to a newer schema. The new schema retains all of the existing properties that the old one had, so there would be no data loss. In this situation it is not possible to just alter the existing schema.
Does anyone know if it's possible to do this?
You can change the schema of a component simply by assigning a new value to the Schema property of the component and saving it. Of course, saving the component will require that the component validates against the new schema.
The trivial case for this is when you've just copy-pasted the schema and therefore both schemas are identical. In practice, you generally have a reason for changing the schema, in which case you probably want to use GetXml() and UpdateXml() on the component and have an XSLT transform the XML to something compliant with the new schema. In this scenario, you can simply update the schema reference in your XSLT.
As Jonathon says, you can use a custom page for this, but bear in mind that generally this is a one-time action which should be designed/executed by programmers and administrators, so if you use a custom page, you probably want to remove it afterwards.
There is a reason why the Tridion GUI does not allow you to change the schema on a component: it is very likely that your component will lose its content after such a change, even if the two schemas have some fields in common.
To avoid this, make sure that the schemas have the same target namespace. In that case, if a field is defined in both schemas, the component will retain its values even after the schema has been changed.
The Tridion Content Porter lets you export content and schemas from one CMS to another. It can also be used to move items between publications. This is one option to "duplicate" a schema and its content for re-use (as well as to backup any work before changing live data!).
Be careful not to change the namespace or any XML fields you'd like to keep (descriptions and schema name are okay though). To be sure, especially with live data, do a clean export just in case before using any of these answers.
It is not possible to change the Schema of a Tridion Component through the Content Manager interface. However, this can be achieved using a 'Custom Page' as the API allows the changing of a Component's Schema through code.
Taken from the SDL Tridion 2009 documentation (Templating Implementation Manual (TOM.NET) 2009):
Class: Tridion.ContentManager.ContentManagement.Component
Property: public Schema Schema { get; set; }
Description: Get or set the Schema for the Component's content and metadata.
There is an item (including a code sample) on the Tridion developer forums (TOPIC_ID=2899) about this. However, as this is a closed forum I am unsure about the legalities of reproducing the code here.
I was able to do this by writing some queries to replace the schema names and references directly within the tridion database. It worked fine, but I would only recommend this if the starting schema is EXACTLY like the end schema. Otherwise it'll break the components.