public static List<I18NText> readI18NTextList(ObjectInput in) throws IOException, ClassNotFoundException { int size = in.readInt(); List<I18NText> list = new ArrayList<I18NText>(size); for ( int i = 0; i < size; i++ ) { I18NText item = new I18NText(); item.readExternal( in ); list.add( item ); } return list; }
public static String getLocalText(List<I18NText> list, String prefferedLanguage, String defaultLanguage) { for ( I18NText text : list) { if ( text.getLanguage().equals( prefferedLanguage )) { return text.getText(); } } if ( defaultLanguage == null ) { for ( I18NText text : list) { if ( text.getLanguage().equals( defaultLanguage )) { return text.getText(); } } } return ""; }
public static void writeI18NTextList(List<I18NText> list, ObjectOutput out) throws IOException { out.writeInt( list.size() ); for( I18NText item : list ) { item.writeExternal( out ); } }
names.add(new I18NText(locale, taskName)); task.setNames(names); String subject = subjectText.getText(); List<I18NText> subjects = new ArrayList<I18NText>(); subjects.add(new I18NText(locale, subject)); task.setSubjects(subjects); String comment = commentText.getText(); List<I18NText> descriptions = new ArrayList<I18NText>(); descriptions.add(new I18NText(locale, comment)); task.setDescriptions(descriptions); String priority = priorityText.getText();
protected void updateTask() { this.task = localTaskService.getTask(taskId); this.taskStatusjTextField.setText(task.getTaskData().getStatus().name()); this.taskNamejTextField.setText(task.getNames().get(0).getText()); this.updateTaskActionButonStatus(); }
task.setPriority(1); List<I18NText> names = new ArrayList<I18NText>(); names.add(new I18NText("en-UK", this.txtTaskName.getText())); task.setNames(names); task.setDescriptions(names);
protected void updateTask() { this.task = localTaskService.getTask(taskId); this.taskStatusjTextField.setText(task.getTaskData().getStatus().name()); this.taskNamejTextField.setText(task.getNames().get(0).getText()); Content content = this.localTaskService.getContent(task.getTaskData().getDocumentContentId()); Map<String, Object> contentData = (Map<String, Object>) ContentMarshallerHelper.unmarshall(content.getContent(), null); this.taskParametersTableModel.clear(); for (Map.Entry<String, Object> entry : contentData.entrySet()) { this.taskParametersTableModel.addRow(entry.getKey(), (String)entry.getValue()); } switch (task.getTaskData().getStatus()){ case InProgress: setParameterTableReadOnlyStatus(false); break; default: setParameterTableReadOnlyStatus(true); break; } this.updateTaskActionButonStatus(); }
if (taskName != null) { List<I18NText> names = new ArrayList<I18NText>(); names.add(new I18NText(locale, taskName)); task.setNames(names); descriptions.add(new I18NText(locale, comment)); task.setDescriptions(descriptions); List<I18NText> subjects = new ArrayList<I18NText>(); subjects.add(new I18NText(locale, comment)); task.setSubjects(subjects);
List<I18NText> names = task.getNames(); for (I18NText text: names) { if ("en-UK".equals(text.getLanguage())) { name = text.getText();
if (taskName != null) { List<I18NText> names = new ArrayList<I18NText>(); names.add(new I18NText(locale, taskName)); task.setNames(names); descriptions.add(new I18NText(locale, comment)); task.setDescriptions(descriptions); List<I18NText> subjects = new ArrayList<I18NText>(); subjects.add(new I18NText(locale, comment)); task.setSubjects(subjects);
public static TaskRef task(Task task) { String name = ""; for (I18NText text: task.getNames()) { if ("en-UK".equals(text.getLanguage())) { name = text.getText(); } } return new TaskRef( task.getId(), Long.toString(task.getTaskData().getProcessInstanceId()), task.getTaskData().getProcessId() == null ? "" : task.getTaskData().getProcessId(), name, task.getTaskData().getActualOwner() == null ? null : task.getTaskData().getActualOwner().getId(), !task.getTaskData().isSkipable(), false); }