TYPO3: export list of pages with info about last editor - typo3

I need to create an export of all pages and get information about the last modification date and who did the last modification.
Last modification date is easy: that's stored in SYS_LASTCHANGED in the pages table. But how can I find the information about who did the change? For changes to pages that's easy as well, as I can check sys_log and sys_history and search the pid in the field recuid in combination with tablename. For tt_content records I can do a select first to get all records for a specific page. And then search recuid and tablename accordingly.
But how about all the other records, e.g. from plugins? Do I really need to iterate over all tables and the pid field to get all possible records?

I think you have a lot of work to do, as the information SYS_LASTCHANGED is not very trustworthy.
Depending on the rendering process multiple records are used for building up a page. and more and more information does not come from records but from files, which are versioned by chance in a git repository (or similar).
Just in case all(!) information is stored in records (tsconfig, typoscript, fluid templates in records (sys_file for files)). There are thousands of ways a page is generated and which information influences the current page rendering.
just some examples:
the typoscript is changed. does it result in a rendering change of the current page?
a record (e.g. tt_content) is deleted. so this record will no longer show in the page. will you consider all invisible (delted, hidden, time restricted) records?
TYPO3 has constructions like: show content from page X, show content records X,Y,Z from other pages
translations: does a change in another language than the current is a change to the current language (a fallback might be possible)
if you consider links in menus or text: if another page which is linked in the current page gets disabled TYPO3 does not generate a link any longer

Related

Migration of tx_news from one TYPO3 to another

I want to migrate existing news from one instance to another one incl. relations to FAL and content elements.
What is the best practise? I tried T3D Export, but it needs too much memory. Is this the only solution or do you have better ones?
1st you can try to export smaller chunks.
2nd you can do the export by hand. But then you must know which records are involved and what files are involved. And you must handle uid-collisions!
Starting with a simple query for your news-records.
Then you need all related records: FAL, tt_content, categories
Depending on your tt_content records you might need further related records - typical: FAL
Then you need to identify all the files.
Before you import all the records: make sure the used uids are unused in your target installation. oherwise you need to modify your uids (e.g.: you can add a constant value of 10000 to all your uids)

REST pagination content duplicates

When creating REST application which will return a collection of items (topic with collection of posts) with sorting from new to old ones.
If there will be HATEOAS principles performed and all content will be chunked on pages client will get a current page id, offset, data limits and links to first, current and next page for example.
There is no problem to get data from next page, but if somebody has been added content while client is reading current page - data will be pushed on the start of collection and last item of current page will be moved to the next page.
If you will just skip posts which already has been loaded before, you will get lower amount of items on the next page. There is a way to get a count of pushed items in start of list and increment offset.
What is a best practices for this?
Not using offsets indexes, but instead skip tokens that indicate the first value not to include (or first value to include) is a good technique provided the value can be unique for every item in your result set and is an orderable field based on the current sort. But it's not flawless. Usually this just doesn't matter.
If it really does matter you have to put IDs of everything that's in the first page in the call to 2nd page, and again and again. HATEOAS helps you do stuff like this...but it can get very messy and still things can pop up on page 1 given the current sorting when you make a request for page 5...what do you do with that?
Another trick to avoid dupes in a UI is to use the self or canonical link relationships to uniquely identify resources in a page and compare those to existing resources in the UI. Updating the UI with the latest matching resources is usually a simple task. This of course puts some burden on the client.
There is not a 1 size fits all solution to this problem. You have to design for the UX you intend to fulfill.

how to put more than 1 record in an oracle apex form?

I have a problem with oracle apex forms.
The problem is that I want to add more than 1 record at the same time in 1 form. I have already read that the best way to do that is to use an csv file but then there is no tutorial to do that.
Oracle is a database, and combining files with databases is always tricky and not extensively supported for obvious reasons. Storing files and presenting them for download is one thing. Getting an Oracle database to open a file and reading and processing the contents is another. It sure it possible, but especially combining this with an Apex application I think you are going to run into a lot of challenges such as security restrictions.
However, stepping away from files does not necessarily mean stepping away from CSV. You could simply offer a large text input on your page in which a user can copy-paste a large CSV string. This can then be submitted and processed by the database. To do this you would probably need to create a process that gets fired after you submit the page. From this process you can parse the CSV data and insert multiple rows in a table. The same can be done for things like XML or JSON.
However, who is generating this CSV? Requiring a user to construct CSV is not very user-friendly. It can be complicated and error prone. If the CSV is generated by another application, isn't there a way to circumvent Apex and pass the CSV to the database directly?
If a single text-based data carrier is not required, which I doubt reading your descriptions, why not simply keep your form but allow the user to submit multiple forms? Would if be sufficient to insert one record per submit, and later using a batch to query these records and start formatting one at a time?
If you simply want the user to be able to enter multiple machines without having to submit the page for each machine, this is also possible, but you will have to leave some standard Apex functionality behind and implement some more custom javascript and PL/SQL functionality. Apex only allows a static amount of page items, which needs to be defined design time. So if you want to dynamically add fields such as text boxes and select lists to your page, you will have to resort to javascript. You could start by defining a region which renders one row of input fields at page load, and create a link under it saying 'add another row', which will render a new row of input fields under the existing one, and repeat this as many times as the user needs to.
That takes care of the UI. Now when the user has entered all the data he wants, we need to submit all this data and get it into the database. So yes, at this point we would probably have to get all this data from the input fields and turn it into one single string. This would all have to be done client side in your javascript code. You can then use the Apex page item API to assign this generated string to a single page item, using the $x(...) or $v(...) functions. Then submit the page, at which point the page processes will be fired. You then define a page process which will parse the data in your page item, and use that data to insert multiple rows in the database.

Typo3 group Records by a DB field

Im using a Page (type Folder) to show all records with this pid. Is it possible group these records somehow? Theres a field in my DB called "vid", which contains the uid of some other records. I want the records in my folder to be grouped by this uid. Any suggestions? (Using Typo3 4.6.3)
Ok, then the simple answer is No. Grouping is not possible with the default backend list view module. You can sort, and search/filter there, but not more. You may write a custom backend module that does the trick for you.
What I could also imagine is to use the export function in the list module (there is a button somewhere) and then do the grouping with your favorite spreadsheet tool (like excel). Depending on how often you need this feature that may be a simple workaround that does not require and additional coding.

Why there is no Tridion page template system metadata published to broker database?

We are using Tridion 2011 SP1 HR1 and New UI.
We would like to generate new UI JSON tags using our Java framework based on the Java content delivery API: Tridion delivery framework (TDF).
The JSON tag for the page should contain the PageTemplateModified parameter.
<!-- Page Settings: {"PageID":"tcm:48-84852-64",
"PageModified":"2013-02-28T15:04:30",
"PageTemplateID":"tcm:48-24343-128",
"PageTemplateModified":"2013-02-27T17:11:31"}
-->
But when a Tridion page or a Tridion page template is published to the broker database, the zip sent to the deployer does not contain any information about the page template. In the broker DB, ITEMS table does not contain any rows for page templates.
It is easy to verify using the following SQL query on the broker DB:
select * from items where item_type = 128
Is there a reason, why?
[edit]
I am speaking about system metadata.
This is very subjective,and not really a fit for Stack Overflow consider asking it at https://tridion.stackexchange.com/grant-beta-access?key=63880f9cbf452c62f726770209533893
I think the only way you will be able to get the modification date of a PT into your rendered page output would be to add the data to your page (or page meta) at publish time.
To answer the Why? Part of your Q, probably nobody thought of a reason for it, so it was never designed that way.
I was going to reply to the thread under Chris' answer, but it became too long...
The Last modified date setting in the XPM JSON cannot be the real last modified date, and I'll explain why.
When you load Experience Manager, it will quickly go through the various ""LastModified" settings in the JSON to compare with what is stored in the CM and determine if your page is up to date. If you published this page in December last year, then modified the template in January, the dates should not match - and XPM will let the editor know that "this page is not up to date, click here to reload".
If you would now change that last modified date "on the fly" to be the real last modified date of the template as opposed to the last modified date of the template at the time this page was published then XPM will not detect that there was a change made to the template on the CM and the editors may have unexpected results, like changing the value of a field, reload, and suddenly their sidebar is on the left instead of being on the right.
Hope this helps