Page 1 of 1

Fragment inside ClipboardFragmentInformation

Posted: Mon Feb 26, 2024 1:52 pm
by ralfpeterkorte
When using the interface ClipboardFragmentInformation I asked myself how the fragment / serializeFragmentToXML is composed by Oxygen.

Code: Select all

	  public void process(ClipboardFragmentInformation fragmentInformation) {
		AuthorDocumentFragment frag = fragmentInformation.getFragment();
		String xmlContent = authorAccess.getDocumentController().serializeFragmentToXML(frag);
		...
	}
For example when copying a table cell in full tags author mode <entry>Hello</entry> only the textual information 'Hello' is inside the fragment.
When copying a title <title>Hello</title> the whole markup <title>Hello</title> is inside the fragment.

Is there a documentation about the copy/paste behaviour how Oxygen handles special cases?

Re: Fragment inside ClipboardFragmentInformation

Posted: Mon Mar 04, 2024 12:30 pm
by Radu
Hi,
In general the pasted AuthorDocumentFragment object should contain exactly the copied content.
But there are certain cases like as you said, when an entire table cell is being copied, in this case in our code we retain only the cell content but we also have some metadata which describes that the selection was actually of an entire cell.
Unfortunately this extra information about the original selection is not available to you in the "ro.sync.ecss.extensions.api.content.ClipboardFragmentInformation" API.
Regards,
Radu