Learn, todo and done 15-19/3/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc Postman for testing API, YouTube Todo - Project repo, doc Local Taverna Study Taverna Rest Service Could use beanshell to retrieve webapp Done - Project Update Prototype link Todo Add-additional-info-to-preview-#428 Pass unit test for FormattedDatasetLinkPreview Try to pass the acceptance test Done BlockerRetrieve citation detail in text in dataset page Fix Text cross browser performance problem by changing it to <a></a> tag Pass the behat test by triggering onClick event. /** * @When /^I click "([^"]*)"$/ * To trigger onclick event */ public function iClick($arg1) { $element = $this->minkContext->getSession()->getPage()->find('css', "a[id='$arg1']" ); $element->click(); } Add-delete-button-#457 When press Save, it will return `Non-type error' To fix it by changing FindByAttribute to FindByPk in AdminFileController Add File Attribute Id row in adminFile/view/id to visualize <?php $sample_id = FileSample::model()->find('file_id=:file_id', array(':file_id'=>$model->id)); if(isset($sample_id)) { $sample_name= Sample::model()->find('id=:id',array(':id'=>$sample_id->sample_id)); $attributes = FileAttributes::model()->findAll('file_id=:file_id', array(':file_id'=>$sample_id->file_id)); } $name="Not Set"; if(isset($sample_id)&&isset($sample_name)) { $name=$sample_name->name; } if(isset($sample_id)&&isset($attributes)) { $attribute_id = ""; foreach ($attributes as $attribute) { $attribute_id .= $attribute->id." "; } } $this->widget('zii.widgets.CDetailView', array( 'data'=>$model, 'attributes'=>array( 'id', 'dataset_id', 'name', 'location', 'extension', 'size', 'description', 'date_stamp', 'format_id', 'type_id', array( 'name'=>'Sample', 'value'=> $name, ), array( 'name'=>'FileAttributeID', 'value'=>$attribute_id, ) ), )); ?> Show all file attributes, if more than one, into that row Implement two acceptance tests I should see field with value and I should see field without value /** * @Then I should see field :arg1 with value :arg2 */ public function iShouldSeeFieldWithValue($arg1, $arg2) { PHPUnit_Framework_Assert::assertNotNull( $row = $this->minkContext->getSession()->getPage()->find('css', sprintf('table tr:contains("%s""$s")', $arg1, $arg2)) ); } /** * @Then I should see field :arg1 without value :arg2 */ public function iShouldSeeFieldWithoutValue($arg1, $arg2) { $row = $this->minkContext->getSession()->getPage()->find('css', sprintf('table tr:contains("%s""$s")', $arg1, $arg2)); $value = preg_match('/<td>\d*\s<\/td>/', $row->getHtml()); PHPUnit_Framework_Assert::assertEquals(0, $value); } Reference ...

March 15, 2021 · 2 min · 284 words · Ken Cho

Learn, todo and done 8-12/3/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc Postman for testing API, YouTube Todo - Project repo, doc Local Taverna Use REST service to return DOI Taverna image make the Dockerfile working Done - Project Mint DOI Interface/Prototype Todo Done Add-additional-info-to-preview-#428 Pass the unit tests for the StoredDataLinksPreview and CachedDatasetLinksPreview Retrieve citation detail in text in dataset page Dropdown Text display differently, cross browser performance problem. Reference

March 8, 2021 · 1 min · 73 words · Ken Cho

Learn, todo and done 1-5/3/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc Todo - Project repo, doc Done - Project The taverna workflow can take spreadsheet input, and output formatted url. 1.1 Deduplication, remove newline and replace space with %20 Update the Dockerfile by hardcoding the file path and exclude Python but return error: OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=200m; support was removed in 8.0 Exception from method net.sf.taverna.raven.launcher.Launcher.main(String[]) java.lang.NullPointerException at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264) at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219) at sun.awt.FontConfiguration.init(FontConfiguration.java:107) at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774) at sun.font.SunFontManager$2.run(SunFontManager.java:431) at java.security.AccessController.doPrivileged(Native Method) at sun.font.SunFontManager.<init>(SunFontManager.java:376) at sun.awt.FcFontManager.<init>(FcFontManager.java:35) at sun.awt.X11FontManager.<init>(X11FontManager.java:57) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83) at java.security.AccessController.doPrivileged(Native Method) at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) at sun.font.SunFontManager.getInstance(SunFontManager.java:250) at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:264) at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1107) at javax.swing.JComponent.getFontMetrics(JComponent.java:1617) at javax.swing.plaf.basic.BasicProgressBarUI.getPreferredSize(BasicProgressBarUI.java:821) at javax.swing.JComponent.getPreferredSize(JComponent.java:1653) at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:729) at java.awt.Container.preferredSize(Container.java:1799) at java.awt.Container.getPreferredSize(Container.java:1783) at javax.swing.JComponent.getPreferredSize(JComponent.java:1655) at javax.swing.JRootPane$RootLayout.preferredLayoutSize(JRootPane.java:920) at java.awt.Container.preferredSize(Container.java:1799) at java.awt.Container.getPreferredSize(Container.java:1783) at javax.swing.JComponent.getPreferredSize(JComponent.java:1655) at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:719) at java.awt.Container.preferredSize(Container.java:1799) at java.awt.Container.getPreferredSize(Container.java:1783) at java.awt.Window.pack(Window.java:809) at net.sf.taverna.raven.SplashScreen.<init>(SplashScreen.java:118) at net.sf.taverna.raven.SplashScreen.<init>(SplashScreen.java:105) at net.sf.taverna.raven.SplashScreen.getSplashScreen(SplashScreen.java:88) at net.sf.taverna.raven.launcher.Launcher.prepareSplashScreen(Launcher.java:225) at net.sf.taverna.raven.launcher.Launcher.launchMain(Launcher.java:127) at net.sf.taverna.raven.launcher.Launcher.main(Launcher.java:64) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.sf.taverna.raven.prelauncher.PreLauncher.runLauncher(PreLauncher.java:115) at net.sf.taverna.raven.prelauncher.PreLauncher.launchArgs(PreLauncher.java:69) at net.sf.taverna.raven.prelauncher.PreLauncher.main(PreLauncher.java:47) Todo Add-additional-info-to-preview-#428 1.1 Fix the getPreviewDataForLinks array and the pass the unit test 1.2 What information from webClient returned need to store in that array? Done Add-additional-info-to-preview-#428 1.1 Update getPreviewDataForLinks return array: Array ( [0] => Array ( [short_doi] => 100249 [external_url] => http://foo6.com [type] => 3D Models [title] => Exercise generates immune cells in bone [description] => Mechanosensing stem-cell niche promotes lymphocyte production. [imageUrl] => https://media.nature.com/lw1024/magazine-assets/d41586-021-00419-y/d41586-021-00419-y_18880568.png ) ) 1.2 Pass unittest for getPreviewDataForLinks if the url is hardcoded. 1.3 Try to mock the webClient response. ...

March 1, 2021 · 2 min · 261 words · Ken Cho

Learn, todo and done 22-26/2/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc Todo - Project repo, doc Use beanshell to strip line break Done - Project Optimize the Dockerfile using openjdk:8-jdk-alpine, link Todo Done Add-delete-button-#457 1.1 Add non published test data to CSV files and pass the behat test Add-additional-info-to-preview-#428 2.1 Add external_url, typeand response the array in StoredDatasetLinksPreview 2.2 Add webClient to StoredDatasetLinksPreview Reference

February 22, 2021 · 1 min · 67 words · Ken Cho

Learn, todo and done 18-19/2/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc Todo - Project repo, doc Taverna to generate doi from CrossRef Done - Project Learning Bean Shell Todo Done Add-delete-button-#457 1.1 Rebase develop branch and able to add the required test data into the relevant CSV file(s) Reference

February 22, 2021 · 1 min · 52 words · Ken Cho