/** * * @param rep * @param id_transformation * @throws KettleException */ public void saveNotePadMeta( NotePadMeta note, ObjectId id_transformation ) throws KettleException { try { Point location = note.getLocation(); int x = location == null ? -1 : location.x; int y = location == null ? -1 : location.y; // Insert new Note in repository note.setObjectId( insertNote( note.getNote(), x, y, note.getWidth(), note.getHeight(), note.getFontName(), note.getFontSize(), note .isFontBold(), note.isFontItalic(), note.getFontColorRed(), note.getFontColorGreen(), note .getFontColorBlue(), note.getBackGroundColorRed(), note.getBackGroundColorGreen(), note .getBackGroundColorBlue(), note.getBorderColorRed(), note.getBorderColorGreen(), note .getBorderColorBlue(), note.isDrawShadow() ) ); } catch ( KettleDatabaseException dbe ) { throw new KettleException( "Unable to save notepad in repository (id_transformation=" + id_transformation + ")", dbe ); } }
/** * Stores a notepad in the CWM model in a CwmSchema. * * @param cwm * @param cwmSchema * @param notePadMeta */ public void storeNotePadMeta( CWM cwm, CwmSchema cwmSchema, NotePadMeta notePadMeta ) { if ( !hasAccess( CwmSchemaFactoryInterface.ACCESS_TYPE_SCHEMA_ADMIN, null ) ) { throw new CwmSchemaFactoryException( Messages .getString( "CwmSchemaFactory.ERROR_0001_SCHEMA_ADMIN_ACCESS_DENIED" ) ); //$NON-NLS-1$ } CwmDescription cwmDescription = cwm.createDescription( notePadMeta.getNote() ); cwmDescription.setType( CWM.DESCRIPTION_TYPE_NOTEPAD ); cwm.setPosition( cwmDescription, notePadMeta.getLocation().x, notePadMeta.getLocation().y ); cwm.setWidth( cwmDescription, notePadMeta.getWidth() ); cwm.setHeight( cwmDescription, notePadMeta.getHeight() ); cwm.setDescription( cwmSchema, cwmDescription ); }