/** * Copy a patch element * * @param entry the patch entry * @param patchId the patch id for the element * @param modifications the element modifications * @return the new patch element */ protected static PatchElement createPatchElement(final PatchEntry entry, String patchId, final List<ContentModification> modifications) { final PatchElement patchElement = entry.element; final PatchElementImpl element = new PatchElementImpl(patchId); element.setProvider(patchElement.getProvider()); // Add all the rollback actions element.getModifications().addAll(modifications); element.setDescription(patchElement.getDescription()); return element; }
/** * Copy a patch element * * @param entry the patch entry * @param patchId the patch id for the element * @param modifications the element modifications * @return the new patch element */ protected static PatchElement createPatchElement(final PatchEntry entry, String patchId, final List<ContentModification> modifications) { final PatchElement patchElement = entry.element; final PatchElementImpl element = new PatchElementImpl(patchId); element.setProvider(patchElement.getProvider()); // Add all the rollback actions element.getModifications().addAll(modifications); element.setDescription(patchElement.getDescription()); return element; }
element.get(Constants.TYPE).set(e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER); element.get(Constants.NAME).set(e.getProvider().getName()); element.get(Constants.DESCRIPTION).set(e.getDescription()); list.add(element);
element.get(Constants.TYPE).set(e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER); element.get(Constants.NAME).set(e.getProvider().getName()); element.get(Constants.DESCRIPTION).set(e.getDescription()); list.add(element);
element.get(Constants.NAME).set(e.getProvider().getName()); element.get(Constants.TYPE).set(e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER); element.get(Constants.DESCRIPTION).set(e.getDescription()); elements.add(element);
element.get(Constants.NAME).set(e.getProvider().getName()); element.get(Constants.TYPE).set(e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER); element.get(Constants.DESCRIPTION).set(e.getDescription()); elements.add(element);
} else { final PatchElementBuilder elementBuilder = builder.upgradeElement(cp2El.getId(), provider.getName(), provider.isAddOn()).setDescription(cp2El.getDescription());
} else { final PatchElementBuilder elementBuilder = builder.upgradeElement(cp2El.getId(), provider.getName(), provider.isAddOn()).setDescription(cp2El.getDescription());
writer.writeAttribute(Attribute.ID.name, element.getId()); if(element.getDescription() != null) { writer.writeStartElement(Element.DESCRIPTION.name); writer.writeCharacters(element.getDescription());
writer.writeAttribute(Attribute.ID.name, element.getId()); if(element.getDescription() != null) { writer.writeStartElement(Element.DESCRIPTION.name); writer.writeCharacters(element.getDescription());
private void displayPatchXml(CommandContext ctx, Patch patch) throws CommandException { final Identity identity = patch.getIdentity(); SimpleTable table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", patch.getPatchId()}); table.addLine(new String[]{"Type:", identity.getPatchType().getName()}); table.addLine(new String[]{"Identity name:", identity.getName()}); table.addLine(new String[]{"Identity version:", identity.getVersion()}); table.addLine(new String[]{"Description:", patch.getDescription() == null ? "n/a" : patch.getDescription()}); if (patch.getLink() != null) { table.addLine(new String[]{"Link:", patch.getLink()}); } ctx.printLine(table.toString(false)); if (verbose) { ctx.printLine(""); ctx.printLine("ELEMENTS"); for (PatchElement e : patch.getElements()) { table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", e.getId()}); table.addLine(new String[]{"Name:", e.getProvider().getName()}); table.addLine(new String[]{"Type:", e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER}); table.addLine(new String[]{"Description:", e.getDescription()}); ctx.printLine(""); ctx.printLine(table.toString(false)); } } } }
private void displayPatchXml(CommandContext ctx, Patch patch) throws CommandLineException { final Identity identity = patch.getIdentity(); SimpleTable table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", patch.getPatchId()}); table.addLine(new String[]{"Type:", identity.getPatchType().getName()}); table.addLine(new String[]{"Identity name:", identity.getName()}); table.addLine(new String[]{"Identity version:", identity.getVersion()}); table.addLine(new String[]{"Description:", patch.getDescription() == null ? "n/a" : patch.getDescription()}); if (patch.getLink() != null) { table.addLine(new String[]{"Link:", patch.getLink()}); } ctx.printLine(table.toString(false)); if(verbose.isPresent(ctx.getParsedCommandLine())) { ctx.printLine(""); ctx.printLine("ELEMENTS"); for(PatchElement e : patch.getElements()) { table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", e.getId()}); table.addLine(new String[]{"Name:", e.getProvider().getName()}); table.addLine(new String[]{"Type:", e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER}); table.addLine(new String[]{"Description:", e.getDescription()}); ctx.printLine(""); ctx.printLine(table.toString(false)); } } }
private void displayPatchXml(CommandContext ctx, Patch patch) throws CommandException { final Identity identity = patch.getIdentity(); SimpleTable table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", patch.getPatchId()}); table.addLine(new String[]{"Type:", identity.getPatchType().getName()}); table.addLine(new String[]{"Identity name:", identity.getName()}); table.addLine(new String[]{"Identity version:", identity.getVersion()}); table.addLine(new String[]{"Description:", patch.getDescription() == null ? "n/a" : patch.getDescription()}); if (patch.getLink() != null) { table.addLine(new String[]{"Link:", patch.getLink()}); } ctx.printLine(table.toString(false)); if (verbose) { ctx.printLine(""); ctx.printLine("ELEMENTS"); for (PatchElement e : patch.getElements()) { table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", e.getId()}); table.addLine(new String[]{"Name:", e.getProvider().getName()}); table.addLine(new String[]{"Type:", e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER}); table.addLine(new String[]{"Description:", e.getDescription()}); ctx.printLine(""); ctx.printLine(table.toString(false)); } } } }
private void displayPatchXml(CommandContext ctx, Patch patch) throws CommandLineException { final Identity identity = patch.getIdentity(); SimpleTable table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", patch.getPatchId()}); table.addLine(new String[]{"Type:", identity.getPatchType().getName()}); table.addLine(new String[]{"Identity name:", identity.getName()}); table.addLine(new String[]{"Identity version:", identity.getVersion()}); table.addLine(new String[]{"Description:", patch.getDescription() == null ? "n/a" : patch.getDescription()}); if (patch.getLink() != null) { table.addLine(new String[]{"Link:", patch.getLink()}); } ctx.printLine(table.toString(false)); if(verbose.isPresent(ctx.getParsedCommandLine())) { ctx.printLine(""); ctx.printLine("ELEMENTS"); for(PatchElement e : patch.getElements()) { table = new SimpleTable(2, ctx.getTerminalWidth()); table.addLine(new String[]{"Patch ID:", e.getId()}); table.addLine(new String[]{"Name:", e.getProvider().getName()}); table.addLine(new String[]{"Type:", e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER}); table.addLine(new String[]{"Description:", e.getDescription()}); ctx.printLine(""); ctx.printLine(table.toString(false)); } } }