Skip to content

196 extend annotation tool - #336

Open
astappiev wants to merge 2 commits into
mainfrom
196-extend-annotation-tool
Open

astappiev wants to merge 2 commits into
mainfrom
196-extend-annotation-tool

Conversation

@astappiev

Copy link
Copy Markdown
Member

No description provided.

@astappiev
astappiev force-pushed the main branch 5 times, most recently from 7653212 to 4e87d86 Compare October 18, 2023 10:00
@astappiev
astappiev force-pushed the 196-extend-annotation-tool branch from 49a3daf to f58f16d Compare January 22, 2024 11:25
@astappiev
astappiev force-pushed the main branch 4 times, most recently from 337a511 to a143260 Compare March 24, 2025 15:09
@astappiev
astappiev force-pushed the main branch 3 times, most recently from 7ac5344 to 731576c Compare April 8, 2025 20:07
@astappiev
astappiev force-pushed the 196-extend-annotation-tool branch from f58f16d to 9e2ccf0 Compare October 9, 2026 17:20
Copilot AI balanced review requested due to automatic review settings October 9, 2026 17:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Submission can erase transcripts, while authorization, XSS, logging, and stale-client issues remain unresolved.

15 open findings
What changed in this PR

Generalizes TED transcript annotation for text resources through a shared annotator, persistence model, and logging infrastructure.

Changes:

  • Adds reusable annotation UI and JavaScript.
  • Introduces annotation persistence and administration.
  • Migrates TED transcript annotation to the shared implementation.
File Description
embedded.xhtml Uses the text annotation template.
embedded_text.xhtml Adds text-resource annotation UI.
ted-transcript.js Removes the legacy annotator.
annotator.js Implements the shared annotation client.
ted_transcript.xhtml Integrates the shared annotator.
detailed_transcript_log.xhtml Adapts annotation log fields.
V14__Add_Resource_Annotation.sql Creates annotation storage.
TedTranscriptLogBean.java Reads generalized annotation logs.
TedTranscriptDao.java Removes legacy detailed-log persistence.
TedTranscriptBean.java Delegates annotation commits.
ResourceAnnotationBean.java Adds annotation operations.
AnnotationDao.java Adds annotation persistence queries.
Annotation.java Generalizes the transcript log model.
DaoProvider.java Registers the annotation DAO.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

resource = Beans.getInstance(ResourceDetailBean.class).getResource();
}

public void convert() {
Object.values(this.tags).forEach((value) => {
const listNode = document.createElement('li');
listNode.classList.add('ui-widget-content');
listNode.innerHTML = String(value);
submitTranscript() {
this.disableJQueryContextMenu();
const update = this.containerEl.innerHTML;
commandSubmitResource([{ name: 'transcript', value: update }]);
@RegisterRowMapper(AnnotationDao.AnnotationMapper.class)
public interface AnnotationDao extends SqlObject, Serializable {

@SqlQuery("SELECT a.* FROM lw_transcript_log a JOIN lw_resource USING(resource_id) WHERE user_id IN(<userIds>) and deleted = 0 ORDER BY user_id, created_at DESC")
resource.save();

getUser().clearCaches();
addGrowl(FacesMessage.SEVERITY_INFO, "Changes_saved");
</p:contextMenu>
<h:outputScript target="body">
const annotator = new Annotator('#transcript', {
readOnly: '#{!tedTranscriptBean.tedResource.canEditResource(userBean.user) or tedTranscriptBean.tedResource.readOnlyTranscript}' === 'true',
start = selection.anchorNode.parentNode.getAttribute('data-start');
}
selection.anchorNode.parentNode.replaceWith(...selection.anchorNode.parentNode.childNodes);
} else if (selection.focusNode.id !== this.containerEl.id && selection.focusNode.parentNode.id !== this.containerEl.id) {
const listNode = document.createElement('li');
listNode.classList.add('ui-widget-content');
listNode.innerHTML = String(value);
document.getElementById('selectable').appendChild(listNode);
}
}

addGrowl(FacesMessage.SEVERITY_ERROR, "Unfortunately, we could not extract the text from the file.");
],

locale: {
deleteSelection: 'Are you sure yo want to delete this selection?',

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants