tag:blogger.com,1999:blog-62449303883258133542024-03-17T03:53:41.395-04:00Coding. Development. Solutions. Other Stuff.Tutorials and guides about Spring, Java, Angular JS and other topics.Unknownnoreply@blogger.comBlogger32125tag:blogger.com,1999:blog-6244930388325813354.post-75701589853145583952019-12-22T00:47:00.001-05:002019-12-22T00:47:47.984-05:00New Personal WebsiteJust built my new personal website using GatsbyJS(<a href="https://www.gatsbyjs.org/">https://www.gatsbyjs.org/</a>)
Very cool framework that allows a backend services engineer like myself to use all the slick, new front-end tech(react, graphql, webpack etc) out of the box.
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2bdGQtEOPh86YEdS5Jh2XI_Xq3mz1woJx0ATK4Oa-6L_cxO025AHQfSL4wHYMAOgbR5mT2sg9hFfX4Eki7Hie8NWTA7wj2CIB7gRk5KppH9H5HLuCADNfaxd5d_qs2QBbZRxd7OvXBkI/s1600/new-site.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2bdGQtEOPh86YEdS5Jh2XI_Xq3mz1woJx0ATK4Oa-6L_cxO025AHQfSL4wHYMAOgbR5mT2sg9hFfX4Eki7Hie8NWTA7wj2CIB7gRk5KppH9H5HLuCADNfaxd5d_qs2QBbZRxd7OvXBkI/s320/new-site.png" width="320" height="137" data-original-width="1600" data-original-height="686" /></a></div>
<b>Check it out.</b>
<a href="https://chris-anatalio.dev/">http://chris-anatalio.dev</a> 😁😁😁Unknownnoreply@blogger.com62tag:blogger.com,1999:blog-6244930388325813354.post-43122877384056418562018-06-07T18:22:00.001-04:002018-06-07T18:22:39.466-04:00Building Microservices with JHipster<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSkAGbz38rAwIEVADGVsg707zAR0qtiabzn87ySK3T6l0Iux4rTe6Xu68nackPqt5Vsgs4XuOgGs2w20JslpM4ef0TLLcYuW6BhV3b19zGYoM0lpvq8CJOVLd5f_szLXLaHXnY-16sBas/s1600/jhipster-linkedin-learning.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSkAGbz38rAwIEVADGVsg707zAR0qtiabzn87ySK3T6l0Iux4rTe6Xu68nackPqt5Vsgs4XuOgGs2w20JslpM4ef0TLLcYuW6BhV3b19zGYoM0lpvq8CJOVLd5f_szLXLaHXnY-16sBas/s400/jhipster-linkedin-learning.jpeg" width="400" height="225" data-original-width="1200" data-original-height="675" /></a></div>
Check out this article on Medium and LinkedIn Pulse, for a brief overview of microservices as a primer for working with JHipster to build web applications with a Microservices backend.
<br/><br/>
<b><a href="https://medium.com/@anataliocs/microservices-architecture-primer-for-building-microservices-with-jhipster-ea037c6bbfb9">Building microservices with Jhipster</a></b>
<br/><br/>
JHipster is sponsored by Ippon Technologies(https://www.ippon.tech/).Unknownnoreply@blogger.com101tag:blogger.com,1999:blog-6244930388325813354.post-24930098919842080752017-12-13T18:32:00.000-05:002017-12-13T18:36:29.888-05:00Setup Local AWS SQS Service with Elastic MQ and Spring Cloud<br/>
<h2>Introduction</h2>
<a href="https://aws.amazon.com/sqs/">Amazon Simple Queue Service (SQS)</a> is a service on <a href="https://aws.amazon.com/">Amazon Web Services</a> that provides a scalable message queuing service for loosely-coupled and reliable communication among distributed software components and microservices.
In this article, we will setup a local Elastic MQ service, which will simulate a SQS service and use Spring Cloud to push messages to that queue. With a minimal amount of configuration, this service can be deployed to a EC2 instance and integrate with an actual SQS service.
<br/><br/>
We will be focusing on the standard SQS queue. The other option, a <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html">FIFO Queue</a> is limited to 300TPS(300 transactions per second) and is not a valid use-case for many high-throughput applications.
<br/><br/>
<h3>Characteristics of a Standard SQS Queue</h3>
<br/>
<b>Fully-managed, high throughput messaging queue</b>. Standard queues have nearly-unlimited transactions per second (TPS).
<br/><br/>
<b>Designed for concurrency with multiple message producers and consumers</b>. Multiple parts of your system can send or receive messages at the same time.
<br/><br/>
<h2>Add Dependencies to Gradle</h2>
First let's add the dependencies.
We will be using the standard dependency here. Add the following dependencies to your build.gradle.
<br/><br/>
<strong>build.gradle</strong>
<pre class="prettyprint linenums"><code class="language-java">
dependencies {
compile('org.elasticmq:elasticmq-rest-sqs_2.11:0.10.1')
compile group: 'org.springframework.cloud', name: 'spring-cloud-aws-messaging', version: '1.1.3.RELEASE'
compile group: 'com.amazonaws', name: 'aws-java-sdk-sqs', version: '1.11.49'
testCompile('org.elasticmq:elasticmq-rest-sqs_2.11:0.10.1')
}
</code>
</pre>
<br/><br/>
<h2>Set up our Properties</h2>
Next let's set up our properties to configure our local ElasticMQ SQS service and Spring Cloud.
<br/><br/>
<strong>sqs-services.yaml</strong>
<pre class="prettyprint linenums"><code class="">
awsConfig:
accessKey: x
secretKey: x
sqsQueueName: sqs-queue-name
queueBuffer:
maxBatchOpenMs: 200 #Maximum amount of time, in milliseconds, that an outgoing call waits for other calls of the same type to batch with
maxBatchSize: 10 #The maximum number of messages that will be batched together in a single batch request
maxInflightOutboundBatches: 5 #The maximum number of active receive batches that can be processed at the same time
elasticMqLocalSqsUri:
scheme: http
host: localhost
path:
port: 9324
awsSqsUri:
scheme: https
host: sqs.us-east-1.amazonaws.com
path: /1234567890/
port: 80
echoSqsMessagesLocal: false
</code>
</pre>
Let's also add some flags to our application properties.
<br/><br/>
<strong>sqs-services.yaml</strong>
<pre class="prettyprint linenums"><code class="">
#Local SQS Config
aws.local.sqs.localElasticMq.enable=true
aws.local.sqs.localElasticMq.startServer=false
</code>
</pre>
<br/><br/>
<h2>Create POJOs to capture our Configuration Properties</h2>
Next, since we are working with a lot of properties, let's create a way to deal with them in a manageable way. We will create POJOs(Plain old Java Objects) that will contain various properties from our configuration.
Here is the first POJO to capture Queue Buffer Mapped Properties:
<br/><br/>
<strong>QueueBufferMappedProperties.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
public class QueueBufferMappedProperties {
/*
The maximum amount of time, in milliseconds, that an outgoing call waits for other calls of the same type to batch with.
The higher the setting, the fewer batches are required to perform the same amount of work.
Of course, the higher the setting, the more the first call in a batch has to spend waiting.
If this parameter is set to zero, submitted requests do not wait for other requests, effectively disabling batching.
The default value of this setting is 200 milliseconds.
*/
private Long maxBatchOpenMs;
/*
The maximum number of messages that will be batched together in a single batch request.
The higher the setting, the fewer batches will be required to carry out the same number of requests.
The default value of this setting is 10 requests per batch, which is also the maximum batch size currently allowed by Amazon SQS.
*/
private Integer maxBatchSize;
/*
The maximum number of active outbound batches that can be processed at the same time.
The higher the setting, the faster outbound batches can be sent (subject to other limits, such as CPU or bandwidth).
The higher the setting, the more threads are consumed by the AmazonSQSBufferedAsyncClient. The default value is 5 batches.
*/
private Integer maxInflightOutboundBatches;
public Long getMaxBatchOpenMs() {
return maxBatchOpenMs;
}
public Integer getMaxBatchSize() {
return maxBatchSize;
}
public Integer getMaxInflightOutboundBatches() {
return maxInflightOutboundBatches;
}
public void setMaxBatchOpenMs(Long maxBatchOpenMs) {
this.maxBatchOpenMs = maxBatchOpenMs;
}
public void setMaxBatchSize(Integer maxBatchSize) {
this.maxBatchSize = maxBatchSize;
}
public void setMaxInflightOutboundBatches(Integer maxInflightOutboundBatches) {
this.maxInflightOutboundBatches = maxInflightOutboundBatches;
}
}
</code>
</pre>
Next, here is a POJO to capture the URI of our local Elastic MQ Service:
<br/><br/>
<strong>LocalServiceUri.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
public class LocalServiceUri {
private String scheme;
private String host;
private String path;
private String port;
public String getScheme() {
return scheme;
}
public String getHost() {
return host;
}
public String getPath() {
return path;
}
public String getPort() {
return port;
}
public void setScheme(String scheme) {
this.scheme = scheme;
}
public void setHost(String host) {
this.host = host;
}
public void setPath(String path) {
this.path = path;
}
public void setPort(String port) {
this.port = port;
}
}
</code>
</pre>
Next, here is a POJO to capture various AWS config properties:
<br/><br/>
<strong>AwsMappedProperties.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
public class AwsMappedProperties {
private String accessKey;
private String secretKey;
private String sqsQueueName;
public String getAccessKey() {
return accessKey;
}
public String getSecretKey() {
return secretKey;
}
public String getSqsQueueName() {
return sqsQueueName;
}
public void setAccessKey(String accessKey) {
this.accessKey = accessKey;
}
public void setSecretKey(String secretKey) {
this.secretKey = secretKey;
}
public void setSqsQueueName(String sqsQueueName) {
this.sqsQueueName = sqsQueueName;
}
}
</code>
</pre>
<br/><br/>
<h2>Enable Configuration Properties</h2>
Next up, let's configure a Spring Configuration class which will automatically read in parameters from our configuration YAML into our POJO objects.
<br/><br/>
<strong>AwsMappedProperties.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
@Configuration
@EnableConfigurationProperties
@ConfigurationProperties(locations = "classpath:sqs-services.yaml")
public class SqsConfigMappingProperties {
private LocalServiceUri elasticMqLocalSqsUri;
private LocalServiceUri awsSqsUri;
private AwsMappedProperties awsConfig;
private QueueBufferMappedProperties queueBuffer;
private Boolean echoSqsMessagesLocal;
public LocalServiceUri getElasticMqLocalSqsUri() {
return elasticMqLocalSqsUri;
}
public LocalServiceUri getAwsSqsUri() {
return awsSqsUri;
}
public AwsMappedProperties getAwsConfig() {
return awsConfig;
}
public QueueBufferMappedProperties getQueueBuffer() {
return queueBuffer;
}
public Boolean getEchoSqsMessagesLocal() {
return echoSqsMessagesLocal;
}
public void setElasticMqLocalSqsUri(LocalServiceUri elasticMqLocalSqsUri) {
this.elasticMqLocalSqsUri = elasticMqLocalSqsUri;
}
public void setAwsSqsUri(LocalServiceUri awsSqsUri) {
this.awsSqsUri = awsSqsUri;
}
public void setAwsConfig(AwsMappedProperties awsConfig) {
this.awsConfig = awsConfig;
}
public void setQueueBuffer(QueueBufferMappedProperties queueBuffer) {
this.queueBuffer = queueBuffer;
}
public void setEchoSqsMessagesLocal(Boolean echoSqsMessagesLocal) {
this.echoSqsMessagesLocal = echoSqsMessagesLocal;
}
}
</code>
</pre>
<br/><br/>
<h2>Create AWS Spring Config</h2>
We will set up our SQS queue such that it will be able to use ElasticMQ locally and AWS SQS when deployed.
<br/><br/>
<strong>AwsMappedProperties.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
@Configuration
@EnableConfigurationProperties(SqsConfigMappingProperties.class)
public class AwsConfig {
@Value("${aws.local.sqs.localElasticMq.enable}")
Boolean enableLocalElasticMq;
@Value("${aws.local.sqs.localElasticMq.startServer}")
Boolean startLocalElasticMq;
@Autowired
SqsConfigMappingProperties sqsConfigMappingProperties;
@Bean
public UriComponents elasticMqLocalSqsUri() {
LocalServiceUri elasticMqLocalSqsUri = sqsConfigMappingProperties.getElasticMqLocalSqsUri();
return UriComponentsBuilder.newInstance()
.scheme(elasticMqLocalSqsUri.getScheme())
.host(elasticMqLocalSqsUri.getHost())
.port(elasticMqLocalSqsUri.getPort())
.build()
.encode();
}
@Bean
public SQSRestServer sqsRestServer(UriComponents elasticMqLocalSqsUri) {
SQSRestServer sqsRestServer = SQSRestServerBuilder
.withPort(Integer.valueOf(elasticMqLocalSqsUri.getPort()))
.withInterface(elasticMqLocalSqsUri.getHost())
.start();
return sqsRestServer;
}
@Lazy
@Bean(name = "amazonSqsLocal")
@DependsOn("sqsRestServer")
@ConditionalOnExpression("${aws.local.sqs.localElasticMq.enable}")
public AmazonSQSAsync amazonSqsLocal(AWSCredentials amazonAWSCredentials) {
AmazonSQSAsyncClient awsSQSAsyncClient = new AmazonSQSAsyncClient(amazonAWSCredentials);
awsSQSAsyncClient.setEndpoint(createURI(sqsConfigMappingProperties.getElasticMqLocalSqsUri()));
awsSQSAsyncClient.createQueue(sqsConfigMappingProperties.getAwsConfig().getSqsQueueName());
QueueBufferMappedProperties queueBufferMappedProperties = sqsConfigMappingProperties.getQueueBuffer();
QueueBufferConfig config = new QueueBufferConfig()
.withMaxBatchOpenMs(queueBufferMappedProperties.getMaxBatchOpenMs())
.withMaxBatchSize(queueBufferMappedProperties.getMaxBatchSize())
.withMaxInflightOutboundBatches(queueBufferMappedProperties.getMaxInflightOutboundBatches());
AmazonSQSBufferedAsyncClient amazonSQSBufferedAsyncClient = new AmazonSQSBufferedAsyncClient(awsSQSAsyncClient,config);
return amazonSQSBufferedAsyncClient;
}
@Lazy
@Bean(name = "amazonSqs")
@ConditionalOnExpression("!${aws.local.sqs.localElasticMq.enable}")
public AmazonSQSAsync amazonSqs(AWSCredentials amazonAWSCredentials) {
AmazonSQSAsyncClient awsSQSAsyncClient = new AmazonSQSAsyncClient(amazonAWSCredentials);
awsSQSAsyncClient.setEndpoint(createURI(sqsConfigMappingProperties.getAwsSqsUri()));
awsSQSAsyncClient.createQueue(sqsConfigMappingProperties.getAwsConfig().getSqsQueueName());
QueueBufferMappedProperties queueBufferMappedProperties = sqsConfigMappingProperties.getQueueBuffer();
QueueBufferConfig config = new QueueBufferConfig()
.withMaxBatchOpenMs(queueBufferMappedProperties.getMaxBatchOpenMs())
.withMaxBatchSize(queueBufferMappedProperties.getMaxBatchSize())
.withMaxInflightOutboundBatches(queueBufferMappedProperties.getMaxInflightOutboundBatches());
AmazonSQSBufferedAsyncClient amazonSQSBufferedAsyncClient = new AmazonSQSBufferedAsyncClient(awsSQSAsyncClient,config);
return amazonSQSBufferedAsyncClient;
}
@Bean
public QueueMessagingTemplate queueMessagingTemplate(AmazonSQSAsync amazonSqs, AmazonSQSAsync amazonSqsLocal, SQSRestServer sqsRestServer) {
QueueMessagingTemplate queueMessagingTemplate;
if(enableLocalElasticMq)
queueMessagingTemplate = new QueueMessagingTemplate(amazonSqsLocal);
else
queueMessagingTemplate = new QueueMessagingTemplate(amazonSqs);
queueMessagingTemplate.setDefaultDestinationName(sqsConfigMappingProperties.getAwsConfig().getSqsQueueName());
if(!startLocalElasticMq)
sqsRestServer.stopAndWait();
return queueMessagingTemplate;
}
@Bean
public AWSCredentials amazonAWSCredentials() {
if ("local".equals(ApplicationInfo.getEnvironment())) {
return new BasicAWSCredentials(sqsConfigMappingProperties.getAwsConfig().getAccessKey(),
sqsConfigMappingProperties.getAwsConfig().getSecretKey());
}
return new DefaultAWSCredentialsProviderChain().getCredentials();
}
private static String createURI(LocalServiceUri localServiceUri) {
return UriComponentsBuilder.newInstance()
.scheme(localServiceUri.getScheme())
.host(localServiceUri.getHost())
.port(localServiceUri.getPort())
.path(localServiceUri.getPath())
.build()
.encode().toUriString();
}
}
</code>
</pre>
<br/><br/>
<h2>SQS Service Implementation</h2>
<br/><br/>
<strong>SqsService.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
public interface SqsService {
void sendSqsMessage(DomainObject domainObject);
}
</code>
</pre>
<br/><br/>
<strong>SqsService.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
@Service
@EnableConfigurationProperties(SqsConfigMappingProperties.class)
public class SqsServiceImpl implements SqsService {
@Autowired
SqsConfigMappingProperties sqsConfigMappingProperties;
@Autowired
QueueMessagingTemplate queueMessagingTemplate;
@Override
public void sendSqsMessage(DomainObject domainObject) {
queueMessagingTemplate.convertAndSend(sqsConfigMappingProperties.getAwsConfig().getSqsQueueName(), pricingChanges);
}
}
</code>
</pre>
<br/><br/>
<h2>Using the SQS Service in a Controller</h2>
Using the SQS Service in a controller to make a REST API call to put a serialized JSON message in the queue.
<br/><br/>
<strong>DomainObjectIngestController.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
@RestController
@RequestMapping("/domainObject")
public class DomainObjectIngestController {
@Autowired
SqsService sqsService;
/**
*
* @return version information about the application.
*/
@RequestMapping(value = "", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Void> postDomainObject(@RequestBody DomainObject input) {
sqsService.sendSqsMessage(input);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
}
</code>
</pre>
<br/><br/>
<h2>Testing your Service</h2>
<br/><br/>
<strong>SqsServiceImplTest.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
@Profile("local")
public class SqsServiceImplTest {
private static final String QUEUE_NAME = "sqs-queue-name";
private static final int SQS_PORT = 9324;
private static final String SQS_HOSTNAME = "localhost";
private static final String EXPECTED_SELLING_PRICE = "100";
private SQSRestServer sqsRestServer;
private SqsServiceImpl classUnderTest;
private QueueMessagingTemplate queueMessagingTemplate;
private SqsConfigMappingProperties sqsMappingProperties;
@Before
public void setUp() {
//Run local ElasticMQ SQS queue
try {
sqsRestServer = SQSRestServerBuilder
.withPort(SQS_PORT)
.withInterface(SQS_HOSTNAME)
.start();
} catch (BindFailedException e) {
e.printStackTrace();
}
AmazonSQSAsyncClient awsSQSAsyncClient = new AmazonSQSAsyncClient(new BasicAWSCredentials("x", "x"));
awsSQSAsyncClient.setEndpoint("http://" + SQS_HOSTNAME + ":" + SQS_PORT);
awsSQSAsyncClient.createQueue(QUEUE_NAME);
SqsConfigMappingProperties sqsMappingProperties = new SqsConfigMappingProperties();
sqsMappingProperties.setAwsConfig(buildAwsConfig());
queueMessagingTemplate = new QueueMessagingTemplate(awsSQSAsyncClient);
queueMessagingTemplate.setDefaultDestinationName(QUEUE_NAME);
classUnderTest = new SqsServiceImpl();
ReflectionTestUtils.setField(classUnderTest, "sqsConfigMappingProperties", sqsMappingProperties, SqsConfigMappingProperties.class);
ReflectionTestUtils.setField(classUnderTest, "queueMessagingTemplate", queueMessagingTemplate, QueueMessagingTemplate.class);
}
@After
public void tearDown() throws Exception {
if(sqsRestServer != null)
sqsRestServer.stopAndWait();
}
@Test
public void givenValidPriceChange_whenSendSqsMsg_theVerifyReceivedMsg() throws Exception {
classUnderTest.sendSqsMessage(buildPricingChange());
PricingChange actualResponse = queueMessagingTemplate.receiveAndConvert(QUEUE_NAME,PricingChange.class);
assertEquals(EXPECTED_SELLING_PRICE, actualResponse.getSellingPrice().getAmount());
}
public AwsMappedProperties buildAwsConfig() {
AwsMappedProperties awsConfig = new AwsMappedProperties();
awsConfig.setSqsQueueName(QUEUE_NAME);
return awsConfig;
}
}
</code>
</pre>Unknownnoreply@blogger.com35tag:blogger.com,1999:blog-6244930388325813354.post-88521848781686905922016-09-26T18:00:00.000-04:002016-10-03T19:21:31.193-04:00Integrate Wiremock into Spring Boot Java Web Application for Mocking External Dependencies
<br/>
<h3>Introduction</h3>
WireMock is a mock server for HTTP-based APIs. Some might consider it a service virtualization tool or a mock server. It enables you to stub out an API or other external dependency you depend on to expedite local development. It supports testing of edge cases and failure modes that the real API won't reliably produce. It also is useful in mocking out external dependencies in unit and integration tests. It has excellent integration with jUnit.
<br/><br/>
<h3>Add Wiremock Dependency</h3>
First you will want to add the Wiremock dependency. You can download the regular dependency or the fat JAR stand-alone version that contains all it's dependencies.
We will be using the standard dependency here. Add the following dependency to your build.gradle
<br/><br/>
<b>build.gradle</b>
<pre class="prettyprint linenums"><code class="language-java">
dependencies {
testCompile('com.github.tomakehurst:wiremock:2.1.12')
}
</code>
</pre>
<br/><br/>
<h3>Add Wiremock Unit test</h3>
Here is the complete unit test that you can use for testing your integration with Wiremock. This unit test uses a jUnit4 rule to spin up a Wiremock server on port 8089 and shut it down after each test.
We use the <i>stubFor</i> method to define a mocked end point and the response.
We use a Spring <i>RestTemplate</i> to create a HTTP request to our mock server and capture the result.
<br/><br/>
<b>WiremockTests.java</b>
<pre class="prettyprint linenums"><code class="language-java">
public class WiremockTests {
RestTemplate restTemplate;
ResponseEntity response;
@Rule
public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().port(8089).httpsPort(8443));
@Before
public void setup() throws Exception {
restTemplate = new RestTemplate();
response = null;
}
@Test
public void givenWireMockAdminEndpoint_whenGetWithoutParams_thenVerifyRequest() {
RestTemplate restTemplate = new RestTemplate();
response = restTemplate.getForEntity("http://localhost:8089/__admin", String.class);
assertThat("Verify Response Body", response.getBody().contains("mappings"));
assertThat("Verify Status Code", response.getStatusCode().equals(HttpStatus.OK));
}
@Test
public void givenWireMockEndpoint_whenGetWithoutParams_thenVerifyRequest() {
stubFor(get(urlEqualTo("/api/resource/"))
.willReturn(aResponse()
.withStatus(HttpStatus.OK.value())
.withHeader("Content-Type", TEXT_PLAIN_VALUE)
.withBody("test")));
response = restTemplate.getForEntity("http://localhost:8089/api/resource/", String.class);
assertThat("Verify Response Body", response.getBody().contains("test"));
assertThat("Verify Status Code", response.getStatusCode().equals(HttpStatus.OK));
verify(getRequestedFor(urlMatching("/api/resource/.*")));
}
}
</code>
</pre>
<br/><br/>
<h3>Drill down into Unit Test</h3>
Here are some static imports you can use for readability and conciseness in your test.
<br/><br/>
<strong>WiremockTests.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.springframework.http.MediaType.TEXT_PLAIN_VALUE;
</code>
</pre>
<br/><br/>
<h4>jUnit4 Rule</h4>
This jUnit4 <i>@rule</i> will automatically manage the Wiremock server lifecycle and startup and shutdown Wiremock for each test case. You would also be able to implement this using a <i>setup()</i> and <i>teardown()</i> method but the jUnit4 rule is cleaner and more concise.
<br/><br/>
<strong>WiremockTests.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
@Rule
public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().port(8089).httpsPort(8443));
</code>
</pre>
<br/><br/>
<h4>Stubbed Endpoint and Response</h4>
This code uses the <i>stubFor()</i> method which has been statically imported to define an endpoint, <b>/api/resource/</b> and the plain text response body <i>"test"</i> You could return a JSON or XML response using this method as well by changing the Content-Type and response body
<br/><br/>
<strong>WiremockTests.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
stubFor(get(urlEqualTo("/api/resource/"))
.willReturn(aResponse()
.withStatus(HttpStatus.OK.value())
.withHeader("Content-Type", TEXT_PLAIN_VALUE)
.withBody("test")));
</code>
</pre>
<br/><br/>
<h4>Spring RestTemplate</h4>
We use a Spring <i>RestTemplate</i> class to execute a GET HTTP request to <b>http://localhost:8089/api/resource/</b> hitting the stubbed endpoint of the wiremock server. We are expecting a String.class entity response in this case because that is what we defined in the <i>stubFor()</i> method.
You would need to define a POJO object to capture a JSON response from your stubbed out method if that is what you configured.
We capture the response in a <i>ResponseEntity<String></i> object which captures the response body, headers and status code as well as other information about the request.
<br/><br/>
<strong>WiremockTests.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
response = restTemplate.getForEntity("http://localhost:8089/api/resource/", String.class);
</code>
</pre>
<br/><br/>
<h3>Starting and Stopping the Wiremock Server Manually</h3>
You can start and stop a Wiremock server manually without using a jUnit4 rule to manage the lifecycle. You may want to do this is a bootstrap method when your application starts up.
<br/><br/>
<strong>ServiceClass.java</strong>
<pre class="prettyprint linenums"><code class="language-java">
WireMockServer wireMockServer = new WireMockServer(wireMockConfig().port(8089)); //No-args constructor will start on port 8080, no HTTPS
wireMockServer.start();
WireMock.reset();
wireMockServer.stop();
</code>
</pre>
<br/><br/>
<h3>Conclusion</h3>
You now have Wiremock setup in your project. You can use Wiremock in unit and integration tests to stub externally dependencies and also to speed up development in your local environment.
You can read more about setting up Wiremock here: <a href="http://wiremock.org/docs/getting-started/">http://wiremock.org/docs/getting-started/</a>
Unknownnoreply@blogger.com17tag:blogger.com,1999:blog-6244930388325813354.post-72131333720127284472016-08-29T18:38:00.000-04:002016-09-28T02:32:55.648-04:00Error with Gradle Build SonarQube Plugin Registering Findbugs Plugin<h2>
How to Fix the Error: Unable to register extension org.sonar.plugins.findbugs.FindbugsConfiguration when Running Gradle sonarqube task</h2>
<br />
<br />
Using Gradle, Sonarqube and Findbugs you may get the following error when you try to execute the command:<br />
<br />
<blockquote class="tr_bq">
./gradlew clean build sonarqube</blockquote>
<br />
<h3>
<br /><span class="s1"><b>Here is the error:</b></span></h3>
<blockquote>
<span class="s1">FAILURE: Build failed with an exception.</span><br /><span class="s1">* What went wrong:</span><span class="s1">Execution failed for task ':sonarqube'.</span><span class="s2">> </span><span class="s1">Unable to register extension org.sonar.plugins.findbugs.FindbugsConfiguration</span><br /><span class="s1">* Try:</span><span class="s1">Run with <b>--stacktrace</b> option to get the stack trace. Run with <b>--info</b> or <b>--debug</b> option to get more log output.</span><br /><span class="s1">BUILD FAILED</span></blockquote>
<h3>
<br /><b>Root Cause</b></h3>
<br />
This bug seems to occur when there is a mismatch of versions that don't play nice together. <br />
<br />
For instance here are the versions of our stack:<br />
<br />
<ul>
<li>Sonar Version: 5.3</li>
<li>SonarQube Gradle Plugin: 2.0.1</li>
</ul>
<div>
<br /></div>
<h3>
<b>Update Findbugs plugin on Sonar:</b></h3>
<div>
<br /></div>
<div>
First, we had to update our Sonar server:</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Navigate to the Update Center</b></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-fKmLtcLQdfcVbfQCyFrVNJSJsc2mkPapbWvOlLA_PUBf-9idfCZLcGtcT5ulFkZ57m5t3NksHED8nna4YGDsry3d_60kCfiBk3ofdFArgDbqgexvic4E4efN197hpi06UBZdYMBUTmg/s1600/sonar-update-center.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Navigate to the Sonar Update Center to update the findbugs plugin" border="0" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-fKmLtcLQdfcVbfQCyFrVNJSJsc2mkPapbWvOlLA_PUBf-9idfCZLcGtcT5ulFkZ57m5t3NksHED8nna4YGDsry3d_60kCfiBk3ofdFArgDbqgexvic4E4efN197hpi06UBZdYMBUTmg/s640/sonar-update-center.png" title="Navigate to the Sonar Update Center to update the findbugs plugin" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Navigate to the Sonar Update Center</td></tr>
</tbody></table>
<div>
<br /></div>
<br />
<br />
<b>Update the findbugs plugin and restart the sonar instance</b><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijCOnophHTJFLcHyRMVYgqWRLSjqlSK6kgqZkI_WAgzpwuN9GVKH7H-H37d7n1YMFrbphgzLBngjOQy6mQkM9jdFDW-rEPRSugampAxVLz165G-1fAlvL8FR9AzDGEf-R2nHteAW3KaBs/s1600/find-bugs-plugin.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Update findbugs plugin and restart sonar" border="0" height="46" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijCOnophHTJFLcHyRMVYgqWRLSjqlSK6kgqZkI_WAgzpwuN9GVKH7H-H37d7n1YMFrbphgzLBngjOQy6mQkM9jdFDW-rEPRSugampAxVLz165G-1fAlvL8FR9AzDGEf-R2nHteAW3KaBs/s640/find-bugs-plugin.png" title="Update findbugs plugin and restart sonar" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Update findbugs plugin</td></tr>
</tbody></table>
<b><br /></b>
<h3>
<b>Update your Gradle Dependencies:</b></h3>
<div>
<b><br /></b></div>
<div>
<b><br /></b></div>
<div>
<b>Update the sonarqube Gradle Plugin</b></div>
<div>
<b><br /></b></div>
<div>
Update sonarqube dependency</div>
<div>
<br /></div>
<div>
<pre class="brush: java">
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.1-rc1"
}
</pre>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Update sonar version</div>
<div>
<pre class="brush: java">
sonarqube {
version='2.1-rc1'
}
</pre>
</div>
<div>
<br /></div>
<div>
Update sonar-findbugs-plugin</div>
<div>
<br /></div>
<div>
<pre class="brush: java">
dependencies {
compile: 'org.codehaus.sonar-plugins.java', name: 'sonar-findbugs-plugin', version: '3.2'
}
</pre>
</div>
<div>
<b><br /></b></div>
<div>
<b><br /></b></div>
<div>
<b><br /></b></div>
<div>
<b>Update Findbugs</b></div>
<div>
<br /></div>
<div>
Update findbugs dependency</div>
<div>
<pre class="brush: java">
dependencies {
compile: 'com.google.code.findbugs', name: 'findbugs', version: '3.0.1'
}
</pre>
</div>
<div>
<br /></div>
<div>
Update Findbugs version</div>
<div>
<pre class="brush: java">
findbugs {
toolVersion = "3.0.1"
ignoreFailures = true
sourceSets = [ project.sourceSets.main ]
}</pre>
</div>
<br />
<div class="p2">
<span class="s1"></span></div>
<div class="p2">
<span class="s1"></span></div>
<div class="p2">
<span class="s1"></span></div>
Unknownnoreply@blogger.com10tag:blogger.com,1999:blog-6244930388325813354.post-19338164820620236472016-08-22T14:40:00.001-04:002017-05-19T12:18:16.301-04:00Install a Local Instance of AWS DynamoDB<br />
<br />
<strong>STEP 1:</strong> Press <em>Command+Space</em> and type Terminal and press <em>enter/return key</em>.<br />
<div>
<strong>STEP 2:</strong> Install Brew(If you don't already have it installed.) Run this command in the Terminal app.</div>
<div>
<br /></div>
<div>
<pre class="prettyprint linenums"><code class="">
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
</code>
</pre>
<br />
</div>
<div>
</div>
<div>
<em>Then press enter and wait for the command to finish.</em></div>
<div>
</div>
<div>
<strong>STEP 3:</strong> Use Brew to install and download dynamoDB so that you can run it locally.</div>
<div>
<pre class="prettyprint linenums"><code class="">
brew install dynamodb-local
</code>
</pre>
</div>
<br />
<strong>Launch your DynamoDB local instance like this:</strong><br />
<div class="p1">
<span class="s1">To have start dynamodb-local now and restart at login as a background service using brew services:</span></div>
<pre class="prettyprint linenums"><code class="">
brew services start dynamodb-local
</code>
</pre>
<div class="p1">
<span class="s1">Or, if you don't want/need a background service you can just run:</span></div>
<pre class="prettyprint linenums"><code class="">
/usr/local/bin/dynamodb-local
</code>
</pre>
<br />
<strong>You can then access a JS Shell in a browser such as Chrome:</strong><br />
URL to hit the Javascript shell for your locally running DynamoDB instance:<br />
<pre class="prettyprint linenums"><code class="">
http://localhost:8000/shell/
</code>
</pre>
<br />
This is what you will see what you load up your DynamoDB Shell. If you see this, then you are successfully running a local instance of DynamoDB!<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdDXhhTdnoCqBR3Xen9Cf8k7ybXkbAjiE0peMqe81jBt6Kpc_dqh5M23Xu8bZtT-wj_IptOnj04IQeu3186EHB3VFQc5RM8B9KcgOzaFlKoDnoDbTukp5zsfG2Q6CLGVL6ALKfYeasP5U/s1600/aws-js-dynamoDB-schell.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="AWS Local DynamoDB Javascript Shell in Browser" border="0" height="275" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdDXhhTdnoCqBR3Xen9Cf8k7ybXkbAjiE0peMqe81jBt6Kpc_dqh5M23Xu8bZtT-wj_IptOnj04IQeu3186EHB3VFQc5RM8B9KcgOzaFlKoDnoDbTukp5zsfG2Q6CLGVL6ALKfYeasP5U/s640/aws-js-dynamoDB-schell.png" title="AWS Local DynamoDB Javascript Shell in Browser" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">AWS Local DynamoDB Javascript Shell in Browser</td></tr>
</tbody></table>
<br />
<br />
<strong>Common DynamoDB Concepts</strong><br />
<ul>
<li><strong>Table:</strong> A collection of data</li>
<li><strong>Items:</strong> An item is a group of attributes that is uniquely identifiable among all of the other items.</li>
<li><strong>Attributes:</strong> An attribute is a fundamental data element, something that does not need to be broken down any further.</li>
<li><strong>Primary Key</strong><ul>
<li><strong>Partition Key:</strong> Composed of one attribute known as the partition key</li>
<li><strong>Partition Key and Sort Key:</strong> Composite primary key, composed of two attributes.</li>
</ul>
</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9fnMl7lGGCWqsBMNF8Oi1nw4ksHjEqwJGCZ4_XxCoxWerYMvDAB-gku4ovIMcpXbWZidn9X-9pUKgSClmmco-R1zzbNegja3aPfXZNtRDgBP834kkd6eyEcPdN7OH5106jCDfNO_KMn4/s1600/4-28-dynamodb-basics.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="368" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9fnMl7lGGCWqsBMNF8Oi1nw4ksHjEqwJGCZ4_XxCoxWerYMvDAB-gku4ovIMcpXbWZidn9X-9pUKgSClmmco-R1zzbNegja3aPfXZNtRDgBP834kkd6eyEcPdN7OH5106jCDfNO_KMn4/s640/4-28-dynamodb-basics.jpeg" width="640" /></a></div>
<br />
<br />
<strong>Datatypes</strong><br />
<em>Scalar</em><br />
<ul>
<li class="section"><strong>Number: </strong>String<ul>
<li class="section"><strong>Example:</strong> <em>"N": "123.45"</em></li>
</ul>
</li>
<li class="section"><strong>String: </strong>String<ul>
<li class="section"><strong>Example:</strong> <em>"S": "Hello"</em></li>
</ul>
</li>
<li class="section"><strong>Binary:</strong> Base64-encoded binary data<ul>
<li class="section"><strong>Example:</strong> <em>"B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"</em></li>
</ul>
</li>
<li class="section"><strong>Boolean:</strong> Boolean<ul>
<li class="section"><strong>Example:</strong> <em>"BOOL": true</em></li>
</ul>
</li>
<li class="section"><strong>Null:</strong> Boolean<ul>
<li class="section"><strong>Example:</strong> <em>"NULL": true</em></li>
</ul>
</li>
</ul>
<div class="section">
</div>
<div class="section">
</div>
<div class="section">
<em>Multi-value</em></div>
<ul>
<li class="section"><strong>String Set:</strong> Array of Strings<ul>
<li class="section"><strong>Example:</strong> <em>"SS": ["Giraffe", "Hippo" ,"Zebra"]</em></li>
</ul>
</li>
</ul>
<ul>
<li class="section"><strong>Number Set:</strong> Array of Strings<ul>
<li class="section"><strong>Example:</strong> <em>"NS": ["42.2", "-19", "7.5", "3.14"]</em></li>
</ul>
</li>
</ul>
<ul>
<li class="section"><strong>Binary Set:</strong> Array of Base64-encoded binary data<ul>
<li class="section"><strong>Example:</strong> <em>"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]</em></li>
</ul>
</li>
</ul>
<br />
<em>Document</em><br />
<ul>
<li class="section"><strong>List:</strong> array of AttributeValue objects<ul>
<li class="section"><strong>Example:</strong> <em>"L": ["Cookies", "Coffee", 3.14159]</em></li>
</ul>
</li>
</ul>
<ul>
<li class="section"><strong>Map:</strong> String to AttributeValue object map</li>
<ul>
<li class="section"><strong>Example:</strong> <em>"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}</em></li>
</ul>
</ul>
<div>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<strong>Partition Key Hashing</strong><br />
<br />
Partition key uniquely identifies a item<br />
Partition key is used for building an unordered hash index<br />
Allows table to be partitioned for scale<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt0Hr-pOYyGUiuDJnYepePpLWrgufV7fwnkwU-AOLPn9VzbYyM7W1xFt5RvbVAGBBFVoVveC-5s7q-KFmtxj1LVe5LuL02m-CsMsoGvoc76e6iETcRt_E7xj6KHUqtzaOjYVt0CpxkFRg/s1600/DynamoDB-hashing-partition.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt0Hr-pOYyGUiuDJnYepePpLWrgufV7fwnkwU-AOLPn9VzbYyM7W1xFt5RvbVAGBBFVoVveC-5s7q-KFmtxj1LVe5LuL02m-CsMsoGvoc76e6iETcRt_E7xj6KHUqtzaOjYVt0CpxkFRg/s1600/DynamoDB-hashing-partition.gif" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<i><br /></i>
<strong>Some further reading on DynamoDB</strong><br />
<ul>
<li><a href="https://aws.amazon.com/dynamodb/getting-started/">https://aws.amazon.com/dynamodb/getting-started/</a></li>
<li><a href="https://aws.amazon.com/nosql/">What is noSQL and how is it implemented on AWS?</a></li>
<li><a class="ulink" href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.html" target="_blank">Amazon DynamoDB: How It Works</a> in the <span class="emphasis"><em>Amazon DynamoDB Developer Guide</em></span></li>
<li>Sign up for a monthly webinar series: <a href="https://aws.amazon.com/about-aws/events/monthlywebinarseries/?trkCampaign=WEBINARSERIES&trk=juneseries16homepage">https://aws.amazon.com/about-aws/events/monthlywebinarseries/?trkCampaign=WEBINARSERIES&trk=juneseries16homepage</a></li>
</ul>
</div>
<div>
<i><br /></i>
<strong>References:</strong><br />
<ol>
<li><em><a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html">http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html</a></em></li>
<li><em><a href="http://docs.aws.amazon.com/amazondynamodb/latest/gettingstartedguide/Welcome.html">http://docs.aws.amazon.com/amazondynamodb/latest/gettingstartedguide/Welcome.html</a></em></li>
<li><em><a href="http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/">http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/</a></em></li>
<li><em><a href="https://en.wikipedia.org/wiki/Amazon_DynamoDB">https://en.wikipedia.org/wiki/Amazon_DynamoDB</a></em></li>
<li><em><a href="https://github.com/derjust/spring-data-dynamodb">https://github.com/derjust/spring-data-dynamodb</a></em></li>
<li><em><a href="https://github.com/michaellavelle/spring-data-dynamodb">https://github.com/michaellavelle/spring-data-dynamodb</a></em></li>
<li><em><a href="http://projects.spring.io/spring-data/">http://projects.spring.io/spring-data/</a></em></li>
<li><em><a href="https://aws.amazon.com/nosql/">https://aws.amazon.com/nosql/</a></em></li>
<li><em><a href="http://cloudacademy.com/blog/amazon-dynamodb-ten-things/">http://cloudacademy.com/blog/amazon-dynamodb-ten-things/</a></em></li>
<li><em><a href="http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html">http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html</a></em></li>
<li><em><a href="http://www.slideshare.net/InfoQ/amazon-dynamodb-design-patterns-best-practices">http://www.slideshare.net/InfoQ/amazon-dynamodb-design-patterns-best-practices</a></em></li>
</ol>
</div>
Unknownnoreply@blogger.com33tag:blogger.com,1999:blog-6244930388325813354.post-10219619782300447362016-08-02T18:48:00.001-04:002016-08-02T18:56:33.501-04:00Suppress FindBugs Warnings in a Java and Spring Boot Web Application using Gradle<h2>
How to Suppress FindBugs Warnings using Annotations in a <a class="g-profile" href="https://plus.google.com/109970428231307622681" target="_blank">+Spring</a> Boot and <a class="g-profile" href="https://plus.google.com/105864854338131698025" target="_blank">+Java</a> Application</h2>
<br />
<br />
If your build is breaking because of a FindBugs issue and it is a false-positive or you are unable to resolve the issue because of other considerations, you can add an Annotation to ignore the Findbugs warning.<br />
<br />
<br />
<h3>
Update your Gradle Dependencies</h3>
<br />
<div class="p1">
You will want to add the following compile time dependency to your build.gradle file.</div>
<div class="p2">
<br /></div>
<div class="p1">
compile group: 'findbugs', name: 'findbugs', version: '1.0.0'</div>
<div class="p1">
<br /></div>
<pre style="background-color: #2b2b2b; color: #a9b7c6; font-family: 'Menlo'; font-size: 9.0pt;">dependencies {
<span style="color: #6a8759;">
</span><span style="color: #6a8759;"> </span>compile <span style="color: #6a8759;">group</span>: <span style="color: #6a8759;">'findbugs'</span>, <span style="color: #6a8759;">name</span>: <span style="color: #6a8759;">'findbugs'</span>, <span style="color: #6a8759;">version</span>: <span style="color: #6a8759;">'1.0.0'</span><span style="color: #6a8759;">
</span>}</pre>
<div class="p2">
<br /></div>
<div class="p2">
<br /></div>
<h3>
Get the Findbugs Issue ID</h3>
<div class="p2">
You will need a specific ALL_CAPS identifier so that FindBugs knows what bug to ignore.</div>
<div class="p2">
<br /></div>
<div class="p2">
<br /></div>
<h4>
Locate the FindBugs Report</h4>
<div class="p2">
<br /></div>
<div class="p2">
In your build message, you will see a link to the findbugs report:</div>
<div class="p2">
<br /></div>
<div class="p2">
</div>
<div class="p1">
<a href="file:///Users/canata/IdeaProjects/rcjiinventorymsrp/build/reports/findbugs/main.html">file:///Users/canata/IdeaProjects/projectname/build/reports/findbugs/main.html</a></div>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
<div class="p1">
You can also find the report in your build artifact. Right-click and open in your preferred browser to view file.</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_VELLwXnf99M0DnYwTRwuosE9Q4rzWshX_PZFjM-zulUdIlBH9dQjViTEAF7zmQIa6aWJwI5uGdAdSUjoTcnJ82YCN543ChUizH1cRQrWXAtI7PqoSlyN8Z9jLMZXTpzammgyBsA0oxo/s1600/find-bugs-in-build-artifact.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="find bugs html report in build artifact" border="0" height="293" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_VELLwXnf99M0DnYwTRwuosE9Q4rzWshX_PZFjM-zulUdIlBH9dQjViTEAF7zmQIa6aWJwI5uGdAdSUjoTcnJ82YCN543ChUizH1cRQrWXAtI7PqoSlyN8Z9jLMZXTpzammgyBsA0oxo/s320/find-bugs-in-build-artifact.png" title="find bugs html report in build artifact" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Open the findbugs html report from the build directory</td></tr>
</tbody></table>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
<h4>
Open the FindBugs Report</h4>
<div class="p1">
<br /></div>
<div class="p1">
Once you have it, open the Findbugs HTML report in a browser. It should look like the following.</div>
<div class="p1">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo3egPtyz9919sMmWx9lZXBCoulpd6WJlQ1fMvi11GeS1FJNzBfeRA5C2u8RI2RcGG0imgltl-T6CwFE2JK-QOB-QLZvRUrgfFiXaK7npMWRkybwVY-GMirAelU-UGqliDKtKhsksApuo/s1600/find-bugs.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="findbugs html report for java issues" border="0" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo3egPtyz9919sMmWx9lZXBCoulpd6WJlQ1fMvi11GeS1FJNzBfeRA5C2u8RI2RcGG0imgltl-T6CwFE2JK-QOB-QLZvRUrgfFiXaK7npMWRkybwVY-GMirAelU-UGqliDKtKhsksApuo/s640/find-bugs.png" title="findbugs html report for java issues" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Find Bugs HTML Report</td></tr>
</tbody></table>
<h4>
</h4>
<h4>
Get the FindBugs identifier</h4>
<div class="p1">
<br /></div>
<div class="p1">
Copy and paste the FindBugs identifier. It should be in ALL_CAPS.</div>
<div class="p1">
<br /></div>
<div class="p1">
You will use the annotation like this:</div>
<blockquote class="tr_bq">
<i>@SuppressWarnings("OUT_OF_RANGE_ARRAY_INDEX")</i></blockquote>
<div class="p1">
<br /></div>
<h3>
Add the Annotation to Your Code</h3>
<div class="p2">
<br /></div>
<div class="p2">
Be sure that the correct findbugs SuppressWarnings annotation is being used.</div>
<div class="p2">
<br /></div>
<pre style="background-color: #2b2b2b; color: #a9b7c6; font-family: 'Menlo'; font-size: 9.0pt;"><span style="background-color: #344134; color: #cc7832;">import</span><span style="color: #cc7832;"> </span><span style="color: #bbb529;">edu.umd.cs.findbugs.annotations.SuppressWarnings</span><span style="color: #cc7832;">;</span></pre>
<div class="p2">
<br /></div>
<div class="p2">
<br /></div>
<h4>
Add Suppress warnings annotation</h4>
<div class="p2">
<br />
Add this Suppress warnings annotation above the offending line of code. There are multiple versions of this annotation. <br />
<br />Be sure to use the specific FindBugs issue ID as a parameter in the annotation.<br />
<br /></div>
<div class="p2">
<br /></div>
<div class="p2">
Be sure to use the annotation specific to findbugs in the package edu.umd.cs.findbugs.annotations.</div>
<div class="p2">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Qo9-b2Cm9LcJbwmikqwAu7vjCBq4WExSvwcq6FmWwlYX4TpqMkWOMJ2jrM78U_KHgTJEZ-0ZkmSYQtihVZJZH8o4RcTO3hgCm8c4jKQ3GvfAGO88NhyphenhyphenI_hYxOAdfbF62JGaD9yi6Srw/s1600/findbugs-annotation.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Suppress warnings annotation" border="0" height="107" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Qo9-b2Cm9LcJbwmikqwAu7vjCBq4WExSvwcq6FmWwlYX4TpqMkWOMJ2jrM78U_KHgTJEZ-0ZkmSYQtihVZJZH8o4RcTO3hgCm8c4jKQ3GvfAGO88NhyphenhyphenI_hYxOAdfbF62JGaD9yi6Srw/s640/findbugs-annotation.png" title="Suppress warnings annotation" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Use the edu.umd.cs.findbugs.annotation version of @SuppressWarnings</td></tr>
</tbody></table>
<div class="p2">
<br /></div>
<div class="p2">
<br /></div>
<div class="p2">
This is the annotation you will want to add above the offending line of code.</div>
<div class="p2">
<br /></div>
<pre style="background-color: #2b2b2b; color: #a9b7c6; font-family: 'Menlo'; font-size: 9.0pt;"><span style="color: #bbb529;">@SuppressWarnings</span>(<span style="color: #6a8759;">"OUT_OF_RANGE_ARRAY_INDEX"</span>)</pre>
<br />
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
<h3>
Re-run the Build to Verify that the Warning is being Suppressed</h3>
<div>
<br /></div>
<div>
You want to ensure that the warning is being ignored correctly. You may want to add a TODO as well if you intend to fix the issue at a later point as well or at least track the issues you are suppressing in some way.</div>
<div>
<br /></div>
<div>
Your build should run successfully without issuesmoving forward now.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Further info:</b></div>
<div>
<ul>
<li><a href="http://findbugs.sourceforge.net/manual/annotations.html">http://findbugs.sourceforge.net/manual/annotations.html</a></li>
<li><a href="http://findbugs.sourceforge.net/api/edu/umd/cs/findbugs/annotations/package-summary.html">http://findbugs.sourceforge.net/api/edu/umd/cs/findbugs/annotations/package-summary.html</a></li>
</ul>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div class="p1">
<br /></div>
Unknownnoreply@blogger.com23tag:blogger.com,1999:blog-6244930388325813354.post-80678989137444290342015-12-05T17:07:00.000-05:002015-12-28T14:25:08.865-05:00Whirlwind Tour of JavaOne and Oracle Openworld 2015 <h2>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">JavaOne 2015 Roundups and Summary Articles</span></h2>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">I recently had the wonderful opportunity of attending JavaOne and Oracle Openworld 2015 and have extensively blogged about the social and technical aspects of the conference!</span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Get a taste of the many events and exhibits on display and an insider's view on the conference. I will also be presenting the most important takeaways regarding the future direction of Java including an in-depth discussion of changes coming in Java 9 and how to best prepare for those upcoming changes.</span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">If you are local to the Richmond,VA then check out our meetup on the topic!</span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><a href="http://www.meetup.com/Richmond-Java-Users-Group/events/225877596/">http://www.meetup.com/Richmond-Java-Users-Group/events/225877596/</a></span></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<h2>JavaOne 2015 Day 1 Roundup</h2><hr/><br/>
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/hashtag/JavaOne?src=hash">#JavaOne</a> Day 1 roundup: <a href="https://t.co/1UpcvxZuIz">https://t.co/1UpcvxZuIz</a> - Keynote, Welcome event, <a href="https://twitter.com/hashtag/jdk9?src=hash">#jdk9</a> <a href="https://twitter.com/hashtag/java?src=hash">#java</a> 10/11 previews <a href="https://twitter.com/hashtag/JavaOne2015?src=hash">#JavaOne2015</a> <a href="https://t.co/NynOszVTuf">pic.twitter.com/NynOszVTuf</a></p>— Ippon USA (@IpponUSA) <a href="https://twitter.com/IpponUSA/status/658716389922893824">October 26, 2015</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
<br/>
<h2>JavaOne 2015 Day 2 Roundup</h2><hr/><br/>
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/hashtag/JavaOne?src=hash">#JavaOne</a> Day 2 roundup: Focus on <a href="https://twitter.com/hashtag/JDK9?src=hash">#JDK9</a> and project <a href="https://twitter.com/hashtag/jigsaw?src=hash">#jigsaw</a> - <a href="https://t.co/ljYuDMEA49">https://t.co/ljYuDMEA49</a> <a href="https://twitter.com/hashtag/JavaOne2015?src=hash">#JavaOne2015</a> <a href="https://twitter.com/hashtag/java9?src=hash">#java9</a> <a href="https://t.co/ZiyfV3eBq7">pic.twitter.com/ZiyfV3eBq7</a></p>— Ippon USA (@IpponUSA) <a href="https://twitter.com/IpponUSA/status/659436476367634432">October 28, 2015</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
<br/>
<h2>JavaOne 2015 Day 3/4 Roundup</h2><hr/><br/>
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Ippon at <a href="https://twitter.com/hashtag/javaone?src=hash">#javaone</a> Day 3 and 4 roundup - <a href="https://t.co/dtgeXlVvmM">https://t.co/dtgeXlVvmM</a> <a href="https://twitter.com/hashtag/javaone2015?src=hash">#javaone2015</a> <a href="https://twitter.com/hashtag/java9?src=hash">#java9</a> <a href="https://twitter.com/hashtag/java?src=hash">#java</a> <a href="https://t.co/TIET6bUG1H">pic.twitter.com/TIET6bUG1H</a></p>— Ippon USA (@IpponUSA) <a href="https://twitter.com/IpponUSA/status/681554670796574720">December 28, 2015</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
<br/>
<br/>
<h2>More Pictures of JavaOne 2015</h2><hr/><br/>
You can find more pictures of the event in our JavaOne 2015 Album here: <a href="http://on.fb.me/1RPajzP" target="_blank">JavaOne 2015</a>
<script>window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : 'v2.4'
});
}; (function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div id="fb-root"></div><script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3"; fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script><div class="fb-post" data-href="https://www.facebook.com/media/set/?set=a.888918787812783.1073741833.626124897425508&type=3" data-width="500"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/media/set/?set=a.888918787812783.1073741833.626124897425508&type=3"><p>We had a great time celebrating 20 years of #java at the JavaOne Conference and Oracle OpenWorldBig thanks to Atlassian for providing refreshments at Duke's Cafe and Buzzhouse#JavaOne #JavaOne2015 #oow15</p>Posted by <a href="https://www.facebook.com/IpponUSA/">Ippon Technologies USA</a> on <a href="https://www.facebook.com/media/set/?set=a.888918787812783.1073741833.626124897425508&type=3">Tuesday, November 3, 2015</a></blockquote></div></div>
<br/>
<h2>Whirlwind tour of Javaone Meetup</h2><hr/><br/>
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/hashtag/JavaOne2015?src=hash">#JavaOne2015</a> Recap at <a href="https://twitter.com/richmondjug">@richmondjug</a> Lots of good info on <a href="https://twitter.com/hashtag/java9?src=hash">#java9</a> and the future of <a href="https://twitter.com/hashtag/java?src=hash">#java</a> - <a href="https://t.co/RqY3rwQmdd">https://t.co/RqY3rwQmdd</a> <a href="https://t.co/6M2aK2Iv6e">pic.twitter.com/6M2aK2Iv6e</a></p>— Ippon USA (@IpponUSA) <a href="https://twitter.com/IpponUSA/status/676794703497592832">December 15, 2015</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
<br/><br/>
<h3>Slides</h3><hr/><br/>
<iframe id="iframe_container" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" width="550" height="400" src="https://prezi.com/embed/oxvox6peqiaa/?bgcolor=ffffff&lock_to_path=0&autoplay=0&autohide_ctrls=0&landing_data=bHVZZmNaNDBIWnNjdEVENDRhZDFNZGNIUE43MHdLNWpsdFJLb2ZHanI5a2pmL2xHay9SMkVNaVF3MDdoWGZhM2xnPT0&landing_sign=_QJMYu7qfshotNOp-3hrXVIMUsW8PnMoCsnzrcdj4Zo"></iframe>
<br/><br/>
Link to slides: <a href="https://prezi.com/oxvox6peqiaa/javaone-2015/#" target="_blank">Slides for RJUG JavaOne meetup</a>Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-6244930388325813354.post-87005278349474805682015-09-11T16:48:00.002-04:002015-09-11T16:48:39.205-04:00Running a new jHipster Application using Compass and the main CSS file is not loading<h2>
How to fix a Newly Created jHipster Application not Loading the Main CSS File </h2>
<br />
If you see an error similar to the following upon first startup of a jHipster application you have just created:<br />
<br />
<span style="color: red;">Failed to load resource: the server responded with a status of 404 (Not Found) http://127.0.0.1:8080/assets/styles/main.css </span><br />
<span style="color: red;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF2Iw1zBj4TxpCOGgXtaqw3E7Ku0-MdU-pIKv3HtekvHvUTTCm0s-OyIQEKCzbe5zQJ2qTIMHzNuFP_cc29jC6VZcmZddmSBOVFGLWaJAy60ZVaKhyphenhypheniXWIvA34u6jDszh1Luyz2MCCQqM/s1600/jHipster-no-css.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Issue loading main.css on jHipster application" border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF2Iw1zBj4TxpCOGgXtaqw3E7Ku0-MdU-pIKv3HtekvHvUTTCm0s-OyIQEKCzbe5zQJ2qTIMHzNuFP_cc29jC6VZcmZddmSBOVFGLWaJAy60ZVaKhyphenhypheniXWIvA34u6jDszh1Luyz2MCCQqM/s640/jHipster-no-css.png" title="Issue loading main.css on jHipster application" width="534" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">jHipster with CSS not loaded</td></tr>
</tbody></table>
<br />
<br />
Then you will need to run the grunt task, grunt compass.<br />
<br />
<br />
<h3>
Install Compass</h3>
<div>
You will need to first install Compass, an open-source CSS Authoring Framework before you can run the Grunt task to create the main.css file which is missing.</div>
<div>
<br /></div>
<div>
Using node:</div>
<div>
<br /></div>
<div>
<span style="background-color: #f0f0f0; font-family: monospace, sans-serif; font-size: 16px; letter-spacing: -0.48px; line-height: 25px; white-space: pre;">npm install compass</span></div>
<div>
<br /></div>
<div>
Reference the following link for more info about installing compass using npm</div>
<div>
<a href="https://www.npmjs.com/package/compass">https://www.npmjs.com/package/compass</a></div>
<h3>
<br /></h3>
<h3>
Run Grunt Task</h3>
<div>
<br /></div>
<div>
After you install Compass, you will then need to run the grunt task. In in IntelliJ you can click the grunt task runner at the bottom of your screen or go to Tools -> Open Grunt Console.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8Kg3ZaZxBMqKvBrGUENoVOKLi9didr2RdiG1VuPcwYNLZnIYwlmZezijZ-s3oCUj-OeVFvGrCPQunRP3DyawKjwec_PmCtCztpGvVz7Pt04P-c_zlMEkbjYtm3cEFd0cTEiiKUx07ZxY/s1600/jhipster-grunt-compass.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Use grunt task runner console to create Main CSS file" border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8Kg3ZaZxBMqKvBrGUENoVOKLi9didr2RdiG1VuPcwYNLZnIYwlmZezijZ-s3oCUj-OeVFvGrCPQunRP3DyawKjwec_PmCtCztpGvVz7Pt04P-c_zlMEkbjYtm3cEFd0cTEiiKUx07ZxY/s640/jhipster-grunt-compass.png" title="Use grunt task runner console to create Main CSS file" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Run grunt compass task to create main.css file</td></tr>
</tbody></table>
<div>
<br /></div>
<h3>
Restart your Application</h3>
<div>
<br /></div>
<div>
Try refreshing and restarting your application and the styling should now display correctly.</div>
<div>
<br /></div>
<div>
<span style="font-family: monospace, sans-serif;"><span style="background-color: #f0f0f0; letter-spacing: -0.48px; line-height: 25px; white-space: pre;">mvn spring-boot:run</span></span></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6244930388325813354.post-5418349960592450932015-08-15T20:32:00.002-04:002016-08-02T18:51:00.629-04:00Spring Scheduler to Create Background Process to make Async Calls to Update Cache in Spring Boot<br />
<h2>
Using Spring Scheduler to Create a Scheduled Task that hits your Endpoints to Update a Spring Cache for a Spring Boot Application</h2>
<br />
<br />
I used Spring Scheduler to execute a process on a regular basis to make separate async calls to several endpoints to keep the Spring cache updated and also as a health monitor.<br />
<br />
This serves two purposes for us, we monitor all the endpoints to ensure correct data is coming back and it keeps the caches fresh and up to date even when there hasn't been traffic on that endpoint recently.<br />
<br />
Guides on how to setup Spring caching:<br />
<br />
<ul>
<li><a href="https://spring.io/guides/gs/caching/">https://spring.io/guides/gs/caching/</a></li>
<li><a href="http://codedevstuff.blogspot.com/2015/07/add-guava-cache-to-spring-boot-to-cache.html">http://codedevstuff.blogspot.com/2015/07/add-guava-cache-to-spring-boot-to-cache.html</a></li>
</ul>
<div>
<br /></div>
<div>
Guide on Spring Scheduler: <a href="http://spring.io/guides/gs/scheduling-tasks/">http://spring.io/guides/gs/scheduling-tasks/</a></div>
<div>
<br /></div>
<div>
<b><br /></b>
<div>
<b>View all the code used in this article on Github here:</b></div>
<div>
<br />
<ul>
<li><a href="https://gist.github.com/anataliocs/61291ea9a96f8a642a61">https://gist.github.com/anataliocs/61291ea9a96f8a642a61</a></li>
</ul>
<br />
<br />
<br />
The Spring Framework is maintained by <a href="https://projects.spring.io/spring-framework/">Pivotal</a><br />
<a class="g-profile" href="https://plus.google.com/104461546009919508503" target="_blank">+Spring by Pivotal</a> </div>
</div>
<h3>
<br /></h3>
<h3>
Spring Scheduler</h3>
<hr />
<br />
<div>
You will want to add 3 annotations to your Application.java class. You will need to add annotations for caching, async method calls and scheduling.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibPS3r_cIwBd68mG-dzITvDZtdFx57j2D0cHTg1277TseoNHW-JfJE6QZ2mAq95Kn-eOsgMUYNjTM3LTyTSa5e0BxfRGJaPoaJIVp3bNKzx8zsK8wVbc2E2jvsh52v-JeswpL6I879oWQ/s1600/add-annotations-spring.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Add annotations to your Application.Java class for caching, async and scheduling" border="0" height="440" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibPS3r_cIwBd68mG-dzITvDZtdFx57j2D0cHTg1277TseoNHW-JfJE6QZ2mAq95Kn-eOsgMUYNjTM3LTyTSa5e0BxfRGJaPoaJIVp3bNKzx8zsK8wVbc2E2jvsh52v-JeswpL6I879oWQ/s640/add-annotations-spring.png" title="Add annotations to your Application.Java class for caching, async and scheduling" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Add annotations to your Application.Java class</td></tr>
</tbody></table>
<div>
<br /></div>
<h3>
Create Scheduled Task</h3>
<hr />
<br />
<div>
I created a scheduled task here and set the interval that it runs on using Spring Scheduler and the @Scheduled annotation.</div>
<div>
<br /></div>
<div>
The task calls a method which is async and cached which allowed me to call multiple endpoints concurrently. The results of the method call were cached and the success was logged.</div>
<div>
<br /></div>
<div>
I also injected the service to call the async method we are using to get the status of various endpoints.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXH9rARZeJF70_oKw1KcF1Ydrviz7KhWACT9CdssMiWUMoSq26jiWNyQt1QmsQfyO8v-R-KzQOaRMZ1ovAxBH1MZ6DVVz7op5kzoXXfA3wz7y1lKbTET6aXNoxfYhbxPtasjzHf7j2Q7g/s1600/scheduled-task-spring-service.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="572" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXH9rARZeJF70_oKw1KcF1Ydrviz7KhWACT9CdssMiWUMoSq26jiWNyQt1QmsQfyO8v-R-KzQOaRMZ1ovAxBH1MZ6DVVz7op5kzoXXfA3wz7y1lKbTET6aXNoxfYhbxPtasjzHf7j2Q7g/s640/scheduled-task-spring-service.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<h3>
Create Service for Scheduled Task to use</h3>
<hr />
<br />
<div>
Get endpoint status is the method called directly from the scheduled task. You can pass in a constant or enum to indicate which endpoint you want to check. Each endpoint will be cached separately because the parameters in the method call are different.</div>
<div>
<br /></div>
<div>
You will need to setup caching in a separate config file. You can view this article on how to setup Spring caching: <a href="http://codedevstuff.blogspot.com/2015/07/add-guava-cache-to-spring-boot-to-cache.html">http://codedevstuff.blogspot.com/2015/07/add-guava-cache-to-spring-boot-to-cache.html</a></div>
<div>
<br /></div>
<div>
Get endpoint status will then call the correct getStatus() method to check the results of the endpoint. These results will be cached.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHtz-l4F0qT33ypFvQ7Ezx-MVvPVmNpxRyPRhIY0oWzu3sjzaaGoCEd-djiRPjMbN9V_7oBRz_No8aTL5GYHFYnHrKdegf-fjD79pFUsC5DB0sLWw9eDcieWi-sbhyK89XVoeFhLhudhI/s1600/cache-service-spring.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="462" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHtz-l4F0qT33ypFvQ7Ezx-MVvPVmNpxRyPRhIY0oWzu3sjzaaGoCEd-djiRPjMbN9V_7oBRz_No8aTL5GYHFYnHrKdegf-fjD79pFUsC5DB0sLWw9eDcieWi-sbhyK89XVoeFhLhudhI/s640/cache-service-spring.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
This scheduled task can be used with an API or service to regularly check the status and response of various endpoints for health checking or as a regular running integration test of sorts.</div>
<div>
<br /></div>
<h3>
View full code below</h3>
<hr />
<br />
<div>
View the code on Github here:</div>
<div>
<a href="https://gist.github.com/anataliocs/61291ea9a96f8a642a61">https://gist.github.com/anataliocs/61291ea9a96f8a642a61</a></div>
<div>
<br /></div>
<div>
Code snippets below:</div>
<div>
<br /></div>
<div>
<br /></div>
<script src="https://gist.github.com/anataliocs/61291ea9a96f8a642a61.js"></script>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6244930388325813354.post-86779795329343782002015-07-29T17:31:00.004-04:002016-12-08T23:20:23.295-05:00Add Guava Cache to Spring Boot to Cache Method Calls<br />
<h2>
Add Google Guava Cache to Spring Boot to Cache the Results of Method Calls using Java Config and Spring Annotations</h2>
<div>
<br /></div>
<div>
<br /></div>
<div>
If you have a time-intensive method that is slowing down your application and the results of that method don't change very often, it is a good candidate for caching. This guide will show you how to implement caching in your Spring Boot application using Google Guava cache. </div>
<div>
<br /></div>
<div>
Guava cache is a simple, lightweight in-memory cache that has more configuration options then the default In-Memory Spring Cache. Guava cache is not for clustered systems, for that you will want to use Hazelcast <a href="http://hazelcast.com/">http://hazelcast.com/</a></div>
<div>
<br /></div>
<div>
So if you just need a simple cache but you want more config options such as cache expiration time, then this approach may fit your use case. Alternatively, you could use EhCache.</div>
<div>
<br /></div>
<div>
Full source code references can be found at the bottom of the article.<br />
<br />
More info on Guava Cache:<br />
<a href="https://code.google.com/p/guava-libraries/wiki/CachesExplained">https://code.google.com/p/guava-libraries/wiki/CachesExplained</a><br />
<br />
More info on Spring Cache:<br />
<a href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/cache.html">http://docs.spring.io/spring/docs/current/spring-framework-reference/html/cache.html</a></div>
<div>
<br /></div>
<h4>You can view the complete source code here: <a href="https://gist.github.com/anataliocs/1074e7004b2c99320b7a" target="_blank">https://gist.github.com/anataliocs/1074e7004b2c99320b7a</a></h4>
<br />
<h3>
Add dependencies to your Maven pom.xml file</h3>
<hr />
<div>
<br />
Add the two following dependencies to your maven pom file and clean and package your dependencies. You will need to add Guava and a Spring library that contains helper methods and classes for configuring the cache.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkIwLL-rqTYmaafBAGVDS0AAueeV_ZkxF0hAja86Zf_QfOyCN7NyQvnPlx3pOnc0R1iFY01UNJ93WO0M7XeadPUFRXhGF4Z069OOv6w9GxcBjdbNwNMpn_8a6g5cQsE0JGKgYyjticJ4k/s1600/guava-cache-pom.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Add dependencies to your pom.xml for google guava cache and helper spring methods" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkIwLL-rqTYmaafBAGVDS0AAueeV_ZkxF0hAja86Zf_QfOyCN7NyQvnPlx3pOnc0R1iFY01UNJ93WO0M7XeadPUFRXhGF4Z069OOv6w9GxcBjdbNwNMpn_8a6g5cQsE0JGKgYyjticJ4k/s1600/guava-cache-pom.PNG" title="Add dependencies to your pom.xml for google guava cache and helper spring methods"></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Add dependencies to your pom.xml for guava cache</td></tr>
</tbody></table>
<br />
<h3>
Create CacheConfig file</h3>
<hr />
<div>
<br />
You need to create a CacheConfig file to configure the cache using Java config. Create this config file as a separate class implementing CachingConfigurer and place it in your config folder with your other Java config classes.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWDbiXGZpoQG1HMqr59rtT30bAWuPBhHYnljzCoc_t5akTuzVxXpZGhaKHcTlWjzoG18bHP2xQwRiZvARaanz_NDFhahQhuS8BntA-xCYw4j0qMwzbirpU5SMpRy2s88-ypZvgq0I_jps/s1600/cache-manager.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Add Cache Manager and setup Guava Cache" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWDbiXGZpoQG1HMqr59rtT30bAWuPBhHYnljzCoc_t5akTuzVxXpZGhaKHcTlWjzoG18bHP2xQwRiZvARaanz_NDFhahQhuS8BntA-xCYw4j0qMwzbirpU5SMpRy2s88-ypZvgq0I_jps/s1600/cache-manager.png" title="Add Cache Manager and setup Guava Cache"></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Add Cache Manager and setup Guava Cache</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<br /></div>
<br />
<h3>
Add Cacheable annotation to method to be cached</h3>
<hr />
<div>
<br /></div>
<div>
You will need to add the @Cacheable annotation and pass in the name of the cache which will be used for that method. <br />
<br />
If your method has a passed in parameter, results for each different parameter will be cached. So, each time a new parameter is passed in, this will execute the method and place the results in the cache. Future calls using that parameter will pull results from the cache and skip execution of the method.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip1OX9qNmoTu3CZWvMSM8m8ZdAxQidyCqd7jQCTTzzPNgtoConKnCs6ujxbIqBFpmF6lACte02_BBho94zox3lZqhSj4QfHmYu0WnRj7tq3PmdUR44raL1PtaCOta_AAlcTb8__0MBAzo/s1600/cached-method.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Add Cacheable annotation to the method to be cached" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip1OX9qNmoTu3CZWvMSM8m8ZdAxQidyCqd7jQCTTzzPNgtoConKnCs6ujxbIqBFpmF6lACte02_BBho94zox3lZqhSj4QfHmYu0WnRj7tq3PmdUR44raL1PtaCOta_AAlcTb8__0MBAzo/s1600/cached-method.png" title="Add Cacheable annotation to the method to be cached"></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Add Cacheable annotation to the method to be cached</td></tr>
</tbody></table>
<br />
<br />
<br />
<div>
<br /></div>
<div>
<br />
<h3>
Add Endpoint to Clear Cache on Demand</h3>
<hr />
</div>
<div>
<br /></div>
<div>
You will also probably want to add an endpoint to easily refresh the cache. You can do this by adding an endpoint to a controller with the @CacheEvict annotation.<br />
<br />
This method will completely clear the cache. All future requests will execute the method until the cache is populated again.<br />
<br />
You may want to protect this endpoint using basic security implemented through Spring Security</div>
<div>
<br /></div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4K6ZygmD5m3VQQuM5fEtD-y_T8o6CbliHWlhSEJkj8mcQO7MePqG6TeeJnxUnONtTBANp0gf20ZBBqbQaiur2M4FPFPJvq2j8vSK-vQWXWHojfwR117fRs9iHqbAsedN4wFRX_UHUPkY/s1600/clear-cache-controller.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Add an endpoint to clear the cache" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4K6ZygmD5m3VQQuM5fEtD-y_T8o6CbliHWlhSEJkj8mcQO7MePqG6TeeJnxUnONtTBANp0gf20ZBBqbQaiur2M4FPFPJvq2j8vSK-vQWXWHojfwR117fRs9iHqbAsedN4wFRX_UHUPkY/s1600/clear-cache-controller.png" title="Add an endpoint to clear the cache"></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Add an endpoint to clear the cache</td></tr>
</tbody></table>
<br />
<h3>
Other considerations and Source Code</h3>
<hr />
<br />
You may want to initially warm the cache and call the method with all possible parameters such that even initial users access the cached version.<br />
<br />
<br />
You can view the complete source code here: <a href="https://gist.github.com/anataliocs/1074e7004b2c99320b7a">https://gist.github.com/anataliocs/1074e7004b2c99320b7a</a><br />
<div>
<br /></div>
<div>
<br />
<br /></div>
<br />
<script src="https://gist.github.com/anataliocs/1074e7004b2c99320b7a.js"></script>Unknownnoreply@blogger.com7tag:blogger.com,1999:blog-6244930388325813354.post-13379475212860805282015-05-15T15:44:00.000-04:002017-07-12T21:32:29.366-04:00Spring Boot Internationalization with Default Locale for Message Strings<h2>
How to add Spring Boot Internationalization with Default Locale for Storing Message Strings such as Validation Messages in a message.properties file </h2>
<br />
This article will show you how to use a properties file to define static text in your application such as for validation message.<br />
<br />
<b>All the code is appended at the bottom of the article. </b><br />
<br />
You can also view all the code here:
<a href="https://gist.github.com/anataliocs/715cb36c3604a467d38d">Link to Github Gist here</a>
<br />
<hr />
<h3>
Add Default locale and Message Source beans to your Application class </h3>
<div>
<br /></div>
<br />
Add these classes to set your default locale and configure the location of your message properties file<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9WCvXn4fAT1_vRdU_XmqhNNVULquDWZWdo8gBxxIEmPgLXbsqbVxtcQ-E5kxB2myS7g_vTC-_lM8xYqt1uiWuOBfYmLKnhQPNKhpIl97Nn2qB8lgyKwdXGz2OmgPotuHVyloO5xj540k/s1600/spring-boot-i18n-msg.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Add beans to your Spring Boot Application class" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9WCvXn4fAT1_vRdU_XmqhNNVULquDWZWdo8gBxxIEmPgLXbsqbVxtcQ-E5kxB2myS7g_vTC-_lM8xYqt1uiWuOBfYmLKnhQPNKhpIl97Nn2qB8lgyKwdXGz2OmgPotuHVyloO5xj540k/s1600/spring-boot-i18n-msg.png" title="Add beans to your Spring Boot Application class" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Add locale and MessageSource beans to your Application Class</td></tr>
</tbody></table>
<br />
<hr />
<h3>
Add a Service and Interface to retrieve message text </h3>
<br />
This service will pull the default locale from the session and then get the message text from your properties file using the messageSource.
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghMMZM9uD9z2x0LG_69SJg7SI4Nu2u6kCDLwDiqVxcBEDy0v3K-q6JwRzpzH3MYAxoIQqNz-U_TP0qcqkEwfawcVG9kZPPNEQnix-25UNZNfkqRn7j80ggHIbxig0sFwpb-LKPTaCGS1E/s1600/i18n-spring-boot-svc.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Create Service to get messages by locale" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghMMZM9uD9z2x0LG_69SJg7SI4Nu2u6kCDLwDiqVxcBEDy0v3K-q6JwRzpzH3MYAxoIQqNz-U_TP0qcqkEwfawcVG9kZPPNEQnix-25UNZNfkqRn7j80ggHIbxig0sFwpb-LKPTaCGS1E/s1600/i18n-spring-boot-svc.png" title="Create Service to get messages by locale" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Add a service to get the msgs in your props file</td></tr>
</tbody></table>
<br />
<hr />
<h3>
In your controller, use the Message service to get the message text </h3>
<br />
You will inject the message service in the controller and then pass in the id to get the value from the props file
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0PVG8m5elDKvSEpAElzJLun0MSViIP4DbPuBqXebQ-rRn1u9eD61SwE4AzNwaHKku3YbwgCekMCO9cr93i7U6v0Y7iclLtjLibbvELRMPGKTes5BeBOUaB_aNL6N-EfuoLHNiReaeohE/s1600/spring-boot-i18n-svc.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Inject svc and get message from i18n props file" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0PVG8m5elDKvSEpAElzJLun0MSViIP4DbPuBqXebQ-rRn1u9eD61SwE4AzNwaHKku3YbwgCekMCO9cr93i7U6v0Y7iclLtjLibbvELRMPGKTes5BeBOUaB_aNL6N-EfuoLHNiReaeohE/s1600/spring-boot-i18n-svc.png" title="Inject svc and get message from i18n props file" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Inject service into your controller and get the message</td></tr>
</tbody></table>
<br />
<br />
<hr />
<h3>
Create the message.properties file in the locale folder </h3>
<br />
In resources, create the locale folder and then create a file called messages_en_US.properties
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipHTDcZ_ulmU3X6jnhvIhAE5Bzu2V3H021_PLoLNh778WJBM7AclrUe0UJVw3QCKaXoBjz4LMbZrTUPmWMwj_HP8ZCOv8WQvvAir0yOapNQSsfSntq-nkhxPaokOB1IGQKKbV2yWS7iR8/s1600/msg-props-i18n.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Create localized message props file" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipHTDcZ_ulmU3X6jnhvIhAE5Bzu2V3H021_PLoLNh778WJBM7AclrUe0UJVw3QCKaXoBjz4LMbZrTUPmWMwj_HP8ZCOv8WQvvAir0yOapNQSsfSntq-nkhxPaokOB1IGQKKbV2yWS7iR8/s1600/msg-props-i18n.PNG" title="Create localized message props file" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Create message properties file</td></tr>
</tbody></table>
<br />
<br />
<hr />
<h3>
Review the code here</h3>
<br />
You can view all the code here:
<a href="https://gist.github.com/anataliocs/715cb36c3604a467d38d">Link to Github Gist here</a>
<script src="https://gist.github.com/anataliocs/715cb36c3604a467d38d.js"></script>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6244930388325813354.post-89335926328647086852015-05-07T14:37:00.003-04:002015-05-07T14:37:55.254-04:00Change Port on a Spring Boot Application when using intelliJ <h2>
Change Port on a Spring Boot Application when using intelliJ </h2>
<div>
<br /></div>
<div>
<br /></div>
<div>
Two ways to change the port that the embedded Tomcat is using in a Spring Boot Application.</div>
<div>
<br /></div>
<div>
The first way is to modify the application properties in the resources folder:</div>
<div>
<br /></div>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp7WKdlYvBIOKYcXMFdKBcTcokfgbzZFbLLyAjIoh4zosJDLi9Ev9fCkACNlv7XIel9E2okjDGKY6DalfCmMXHQnR7_krhCzvDF5d5GdXpafbOdqiKrHxRuKhZdK-fkyBeQrOWN3rtfRI/s1600/edit-application-props-spring-boot.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Update application properties to change port" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp7WKdlYvBIOKYcXMFdKBcTcokfgbzZFbLLyAjIoh4zosJDLi9Ev9fCkACNlv7XIel9E2okjDGKY6DalfCmMXHQnR7_krhCzvDF5d5GdXpafbOdqiKrHxRuKhZdK-fkyBeQrOWN3rtfRI/s1600/edit-application-props-spring-boot.PNG" title="Update application properties to change tomcat port" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Update application props in Spring Boot Application</td></tr>
</tbody></table>
<span id="goog_101774917"></span><span id="goog_101774918"></span><br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br /></div>
<div>
There are a couple issues with this approach. You might only want this port change in your local environment and if you check it in by accident you might break things.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Alternatively, you can use a command line parameter.</div>
<div>
<br /></div>
<div>
Go to Run -> Edit Configurations -> VM options</div>
<div>
<br /></div>
<div>
Then enter in the following argument:</div>
<div>
<br /></div>
<blockquote class="tr_bq">
-Dserver.port=8090</blockquote>
<br />
<br />
Then click apply and OK and attempt to run the application again.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg2W3ZBTrVYY9udpcMGOf6g-mdiub6-cVEgmIDwoEve3j-G1yy1z96Cl1-eyOWmMGGEQkQw-hJflK0hfRqp7bWGAabrpzC-S37oJONWG1Y7KsBSIaCzkI15EUXcOYU1umhowJTedX-DZA/s1600/vm-update-args.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Update port on Spring Boot application using VM option" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg2W3ZBTrVYY9udpcMGOf6g-mdiub6-cVEgmIDwoEve3j-G1yy1z96Cl1-eyOWmMGGEQkQw-hJflK0hfRqp7bWGAabrpzC-S37oJONWG1Y7KsBSIaCzkI15EUXcOYU1umhowJTedX-DZA/s1600/vm-update-args.png" title="Update port on Spring Boot application using VM option" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Update port using VM option</td></tr>
</tbody></table>
<br />
<br />
<div>
<br /></div>
Unknownnoreply@blogger.com235tag:blogger.com,1999:blog-6244930388325813354.post-17065085549309005082015-04-07T16:36:00.000-04:002015-09-23T14:32:56.560-04:00Convert Multiple Tasks to Sub-Tasks in JIRA similar to Bulk Update using Script Runner<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
<style type="text/css">
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:300px;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnZ0ewiLSSHFBej1JR6l9hNfnEGQcjjUlmDZIJLfXj7taT9Nt6nh5_oYCS5rNwI1e5rsQ7HIlCpS7v5IAXlSUWduAXKXEJkRM9pZMhyp99C2cQkf-zk0cI77Fmu8uQyg4CALsrrW5MQb2h/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
</style>
<br />
<h2>
How to Convert A Large Number of JIRA Tasks into Sub-Tasks using the Adaptavist Script Runner Plugin with JIRA</h2>
<br />
<br />
In JIRA, there is no way to convert Tasks into Sub-Tasks using the built-in Bulk Update functionality. The lack of the feature is described in many JIRA tickets and Confluence posts on the official Atlassian site such as the two listed below:<br />
<br />
<br />
<ul>
<li><a href="https://jira.atlassian.com/browse/JRA-13245">https://jira.atlassian.com/browse/JRA-13245</a></li>
</ul>
<ul>
<li><a href="https://answers.atlassian.com/questions/37825/is-there-a-way-to-en-mass-convert-subtask-to-issues">https://answers.atlassian.com/questions/37825/is-there-a-way-to-en-mass-convert-subtask-to-issues</a></li>
</ul>
<div>
<br /></div>
<div>
There are many potential workarounds to this such as using selenium scripting to automate the conversion process using browser automation. The best solution I have found is to use scripting within JIRA.</div>
<div>
<br /></div>
<div>
<br />
<br />
<br /></div>
<br />
<h3>
Backup your System</h3>
<hr />
<br />
<br />
<div>
Before you attempt this, you should backup your JIRA instance because you potentially can make changes to tasks you did not intend.</div>
<div>
<br /></div>
<div>
Go to System settings and scroll down to the IMPORT & EXPORT section:</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggrCf9LUjJHuIQZCp1PlDHXofNNzho8Z8WobJeGJ3jD7J3TKsowtmJh4Ycx9KB-36fhd5-UfzPtFq2OEkTEAfNUhr1VVsFRuzRSvPc6-fL7OPcVRd26KSAFEZ5kexXc7eKo_h1MyZXPGc/s1600/backup-jira.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Use JIRA Backup functionality" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggrCf9LUjJHuIQZCp1PlDHXofNNzho8Z8WobJeGJ3jD7J3TKsowtmJh4Ycx9KB-36fhd5-UfzPtFq2OEkTEAfNUhr1VVsFRuzRSvPc6-fL7OPcVRd26KSAFEZ5kexXc7eKo_h1MyZXPGc/s1600/backup-jira.png" title="Use JIRA Backup functionality" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Backup your JIRA instance</td></tr>
</tbody></table>
<div>
<br />
<br /></div>
<div>
<br /></div>
<div>
<br />
<h3>
Install JIRA Adaptavist Scriptrunner</h3>
<hr />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk5RU0KS1lcFMZ8D7Tu0B3JWjyuTt6JF8w4TH5FaVQnoqYVGlysztO7lj8jhSzaCFKbP4vbVT6YHnOAfwUp_4VvPbGHPkJLxR8NTKCleB_7cb9jV_svyRB4y5XquAQB6RdMr0byAO5SQ0/s1600/adaptavist-logo.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Scriptrunner by Adaptavist" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk5RU0KS1lcFMZ8D7Tu0B3JWjyuTt6JF8w4TH5FaVQnoqYVGlysztO7lj8jhSzaCFKbP4vbVT6YHnOAfwUp_4VvPbGHPkJLxR8NTKCleB_7cb9jV_svyRB4y5XquAQB6RdMr0byAO5SQ0/s1600/adaptavist-logo.png" title="Scriptrunner by Adaptavist" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Scriptrunner by Adaptavist</td></tr>
</tbody></table>
<br />
<br />
<b>Download Adaptavist</b> <b>Scriptrunner</b><br />
<b><br /></b>
Get Adaptavist Scriptrunner:<br />
<br />
<a href="https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner">https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner</a><br />
<br />
<br />
<a href="http://www.adaptavist.com/w/">http://www.adaptavist.com/w/</a><br />
<br />
The file will be named something like this: groovyrunner-3.0.6.jar...
<br />
<br />
<b>Upload and Install Scriptrunner</b><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDYplz1rDYk2sJm4uxPE1MvUIzXM-Boa0_piCBuAQBE-MhQgY4qkaTGdRZTuimZZ5eh84mggFjNCHLe0qlSTPJ_WxHU1sriyCUzKfzPK6InT_ku9qDP2ufZgEeXvjdf0iNQ_uwgd97IxY/s1600/Upload-JIRA-Plugin.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Upload your downloaded JIRA plugin as a JAR File" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDYplz1rDYk2sJm4uxPE1MvUIzXM-Boa0_piCBuAQBE-MhQgY4qkaTGdRZTuimZZ5eh84mggFjNCHLe0qlSTPJ_WxHU1sriyCUzKfzPK6InT_ku9qDP2ufZgEeXvjdf0iNQ_uwgd97IxY/s1600/Upload-JIRA-Plugin.PNG" title="Upload your downloaded JIRA plugin as a JAR File" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Upload your downloaded JIRA plugin as a JAR File</td></tr>
</tbody></table>
<br />
<br />
<br />
<br />
<br /></div>
<br />
<h3>
Open up Scriptrunner and run the script</h3>
<hr />
<br />
<br />
Here is the script you want to run.
This version uses a custom JQL query to find a comma delimited list of items that have certain values in a custom Functional Requirement field.
It then loops through the list of issues and converts them to a subtasks then links the task to the parent task.
<br />
<pre class="prettyprint">
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchProvider
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.security.Permissions
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.user.ApplicationUser;
import com.atlassian.jira.issue.UpdateIssueRequest;
//Examples, 8 is my subtask issue type id. Will be different for others
//changeToSubTaskAndLink("AXDIS-509", "AXDIS-1045", "8")
//changeToSubTaskAndLink("AXDIS-509", "AXDIS-1046", "8")
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser.class)
def searchProvider = ComponentAccessor.getComponent(SearchProvider.class)
def issueManager = ComponentAccessor.getIssueManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getUser()
//Add first function req here
//issueKey = 'AR-1231' for searching by id
def queryParamsString = "'Functional Requirement Id' ~ 5.3 "
//Add all functional reqs after the first here
def functionalReqs = ['5.4', '5.5', '5.6', '5.7', '5.8', '5.9', '5.10', '5.11', '5.12']
functionalReqs.eachWithIndex { a, i ->
queryParamsString += " OR 'Functional Requirement Id' ~ " + a
}
def parentIdKey = "AR-2125"
def subTaskIssueTypeId = "5"
def query = jqlQueryParser.parseQuery("project = AR AND affectedVersion = "Phase 2" AND 'Business Requirement Id' ~ '5' AND (" + queryParamsString + ")")
def results = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter())
results.getIssues().each {documentIssue ->
//log.debug(documentIssue.key)
// if you need a mutable issue you can do:
def issue = issueManager.getIssueObject(documentIssue.id)
// do something to the issue...
//changeToSubTaskAndLink("AR-2125", "AR-1977", "5")
changeToSubTaskAndLink(parentIdKey, documentIssue.key, subTaskIssueTypeId)
}
//Method to do all the work
def changeToSubTaskAndLink(parentId, childId, subTaskIssueTypeId)
{ //Get the parent Issue
def parent = ComponentManager.getInstance().getIssueManager().getIssueObject(parentId)
//Get the child Issue
MutableIssue child = (MutableIssue)ComponentManager.getInstance().getIssueManager().getIssueObject(childId)
//Change the child to the subtask type
child.setIssueTypeId(subTaskIssueTypeId)
//Update the issue
//ComponentManager.getInstance().getIssueManager().updateIssue()
ComponentAccessor.getIssueManager().updateIssue((ApplicationUser)ComponentManager.getInstance().jiraAuthenticationContext?.user, (MutableIssue)child, UpdateIssueRequest.builder().build())
//Create the subtask link, if this is not done you'll end up with orphans
//ComponentManager.getInstance().getSubTaskManager().createSubTaskIssueLink(parent, child, ComponentManager.getInstance().jiraAuthenticationContext?.user)
ComponentAccessor.getSubTaskManager().createSubTaskIssueLink(parent, child, ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser())
}
</pre>
Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-6244930388325813354.post-2781932848378679722015-04-01T14:28:00.004-04:002015-09-17T18:09:46.273-04:00Tired Engineers: Welcome to the Future of Coffee Automation<h2>
</h2>
<h2>
Welcome to the Future of Coffee Automation
</h2>
<div>
<br /></div>
<div>
Introducing Brew(). A Coffee Automation system to initiate coffee brewing whenever your code quality starts to slip.</div>
<div>
<br /></div>
<div>
<span style="background-color: #f3f3f3; color: grey; font-family: Raleway, Arial, Tahoma, sans-serif; font-size: 14px; line-height: 22px;">Brew detects when you start writing crappy code, brews you some coffee, and empowers you to PUT DOWN THE KEYBOARD AND PICK UP THE MUG!</span></div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6OPRRr2frD_QwxhbMgfJuhVP2Ka-0l0eENKtcNc78kXAVHCqw-QKFuZ8OWg0jUzNr7G0U_XG230zqnYCKh1KpUPXVidNkbRqCmXd-_wqPJqYHP2JcI4J1Cs80kzJKVEqXJprnGnHLYMM/s1600/Brew2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="The future of productivity for Software Engineers" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6OPRRr2frD_QwxhbMgfJuhVP2Ka-0l0eENKtcNc78kXAVHCqw-QKFuZ8OWg0jUzNr7G0U_XG230zqnYCKh1KpUPXVidNkbRqCmXd-_wqPJqYHP2JcI4J1Cs80kzJKVEqXJprnGnHLYMM/s1600/Brew2.png" title="The future of productivity for Software Engineers" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The future of productivity for Software Engineers</td></tr>
</tbody></table>
<br />
Brew() will save your life and the lives of your team. Engineers depend on it.<br />
<div>
<br />
<br />
So what are you waiting for!?!?!<br />
<h3>
Learn more about brew here: <a href="http://www.ipponusa.com/ippons-solution-to-tired-engineers/">Brew()</a></h3>
<div>
<br /></div>
</div>
Unknownnoreply@blogger.com2Richmond, VA, USA37.5407246 -77.436048137.339233099999994 -77.758771599999989 37.7422161 -77.1133246tag:blogger.com,1999:blog-6244930388325813354.post-45238578189429249532015-02-02T21:02:00.003-05:002015-02-04T15:09:24.506-05:00Add Stormpath User Mgmt Dependencies to Grails<h2>
Add Stormpath User Mgmt Dependencies to Grails</h2>
<br />
How to add dependencies for Stormpath to your grails application.<br />
<br />
<br />
In your BuildConfig.groovy in the dependencies section you need to add 3 dependencies.
<br />
<br />
These artifacts are up to date as of 2/2/2015 so you may need to look up the newest version here: <a href="http://docs.stormpath.com/java/quickstart/">http://docs.stormpath.com/java/quickstart/</a><br />
<br />
<br />
Here are the dependencies you need to add.<br />
<br />
<b>BuildConfig.groovy</b>
<pre class="prettyprint">
dependencies {
//Stormpath user mgmt
compile 'com.stormpath.sdk:stormpath-sdk-api:1.0.RC3.1'
runtime 'com.stormpath.sdk:stormpath-sdk-httpclient:1.0.RC3.1'
runtime 'com.stormpath.sdk:stormpath-sdk-oauth:1.0.RC3.1'
}
</pre>
<br /><br />
Here are the original Maven imports in XML format for reference:
<br />
<br />
<pre class="prettyprint"><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">dependency</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">groupId</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">com.stormpath.sdk</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">groupId</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">artifactId</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">stormpath-sdk-api</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">artifactId</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">version</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">1.0.RC3.1</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">version</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">dependency</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">dependency</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">groupId</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">com.stormpath.sdk</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">groupId</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">artifactId</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">stormpath-sdk-httpclient</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">artifactId</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">version</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">1.0.RC3.1</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">version</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">scope</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">runtime</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">scope</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">dependency</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-comment" style="box-sizing: border-box; color: #738191; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><!-- This next runtime dependency is only necessary if you have
a REST API and you want to secure it with OAuth: --></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">dependency</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">groupId</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">com.stormpath.sdk</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">groupId</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">artifactId</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">stormpath-sdk-oauth</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">artifactId</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">version</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">1.0.RC3.1</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">version</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"><<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">scope</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">runtime</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">scope</span>></span><span style="background-color: #eaeef3; color: #00193a; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;">
</span><span class="hljs-tag" style="box-sizing: border-box; color: #0048ab; font-family: Monaco, 'Andale Mono', 'Courier New', monospace; font-size: 13px; line-height: 18.2000007629395px; white-space: pre-wrap;"></<span class="hljs-title" style="box-sizing: border-box; font-weight: bold;">dependency</span>></span>
</pre>
<br/>
<br/>
Stormpath allows you to rely on their secure infrastructure so that you can focus on writing your application code:
<br/>
<a href="https://stormpath.com/" target="_blank">https://stormpath.com/</a>
<br/><br/>
I use Stormpath as a plugin with Heroku <br/>
<a href="http://heroku.com/" target="_blank">http://heroku.com/</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6244930388325813354.post-38638491033783591492014-10-31T15:13:00.000-04:002015-08-15T20:34:12.861-04:00Use Chrome for Development and Allow Cross-domain Javascript and AJAX<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
<style type="text/css">
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:300px;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnZ0ewiLSSHFBej1JR6l9hNfnEGQcjjUlmDZIJLfXj7taT9Nt6nh5_oYCS5rNwI1e5rsQ7HIlCpS7v5IAXlSUWduAXKXEJkRM9pZMhyp99C2cQkf-zk0cI77Fmu8uQyg4CALsrrW5MQb2h/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
</style>
<br />
<h1>
Use Another Instance of Chrome while Retrieving Content or Data from an Ajax Source on a Different Domain</h1>
<div>
<br /></div>
<div>
<br /></div>
<div>
If you are developing an application and calling a data source from another domain, you may encounter trouble when trying to use AJAX to retrieve a JSON data source from a service API for instance.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
You may see an error message like the following:</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<h3>
<b>Chrome</b></h3>
</div>
<blockquote class="tr_bq">
XMLHttpRequest cannot load [THE_URL_ENDPOINT]. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.</blockquote>
<br />
<b>- OR -</b><br />
<br />
<h3>
<b>IE</b></h3>
<blockquote class="tr_bq">
SEC7118: XMLHttpRequest for [THE_URL_ENDPOINT] required Cross Origin Resource Sharing (CORS). </blockquote>
<blockquote class="tr_bq">
<br /></blockquote>
<blockquote class="tr_bq">
SEC7119: XMLHttpRequest for [THE_URL_ENDPOINT] required CORS preflight. </blockquote>
<blockquote class="tr_bq">
<br /></blockquote>
<blockquote class="tr_bq">
SEC7120: Origin http://localhost:8080 not found in Access-Control-Allow-Origin header. </blockquote>
<blockquote class="tr_bq">
<br /></blockquote>
<blockquote class="tr_bq">
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.</blockquote>
<blockquote class="tr_bq">
</blockquote>
<br />
<br />
<br />
<br />
There are many solutions to this such as using JSONP or modifying the header, Access-Control-Allow-Origin, on the responding service. If none of these options are feasible for you you can run Chrome with cross-domain AJAX calls enabled.<br />
<br />
You will want to run a seperate instance of chrome with web security disabled so that you can still use your own version of Chrome for personal use.<br />
<br />
<h3>
Run Separate Instance of Chrome with Disabled Web Security to Execute AJAX Calls from Different Domains</h3>
<hr />
<br />
<br />
<br />
There is a flag in: chrome://flags/ that allows you to disable web security.<br />
<br />
<br />
You can run chrome with this flag using the following command assuming a standard Chrome Install.
<br />
<br />
<pre class="prettyprint">"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir="C:/Chrome dev session2" --disable-web-security
</pre>
<br />
Example:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4wkJAksjzby8UzE4S38ZUZ9VHWtWIO8PksJWg1WuExS6FddThazQOBw-8Av5ZrEbQCjHV633azp6TGCNH27ZuSE-qTyzNSFBGKN1JDjnjZFW5Ym2qISX5dGDxPoyp5uhvQKhbwKXgfHc/s1600/chrome-no-web-security.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Run Chrome with web security disabled for cross-domain requests" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4wkJAksjzby8UzE4S38ZUZ9VHWtWIO8PksJWg1WuExS6FddThazQOBw-8Av5ZrEbQCjHV633azp6TGCNH27ZuSE-qTyzNSFBGKN1JDjnjZFW5Ym2qISX5dGDxPoyp5uhvQKhbwKXgfHc/s1600/chrome-no-web-security.PNG" title="Run Chrome with web security disabled for cross-domain requests" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Run Chrome with --disable-web-security flag enabled </td></tr>
</tbody></table>
<br />
<br />
After running this command, a new folder should be created on your C:/ drive. This folder will contain user settings unique to this chrome instance. <br />
<br />
Therefore, you will be able to run your own instance of Chrome for secure web browsing and then this instance of Chrome for development. All the settings in this version of Chrome will be independent from you primary Chrome Instance.<br />
<br />
<br />
A new instance of chrome will open up with a warning message indicating web security is disabled and the --disable-web-security flag is being used. You can set a new home page on the browser instance to the local URL of your page in development.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY4jToAjBZJB7UGbDdCf4JL8JgKDDgWeMl6s_2C4VZBV5ZMmSlRxS1IlbGFDeYRfqpPvdEppc75wdfwqM22nfZzH3Ih9B0E5rL2FP0k9YoT23qoroU3SzxNuqYxgS1gSQ1lG3PhFSsbok/s1600/chrome-new-instance.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Independent instance of Chrome for Cross-domain Javascript/AJAX" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY4jToAjBZJB7UGbDdCf4JL8JgKDDgWeMl6s_2C4VZBV5ZMmSlRxS1IlbGFDeYRfqpPvdEppc75wdfwqM22nfZzH3Ih9B0E5rL2FP0k9YoT23qoroU3SzxNuqYxgS1gSQ1lG3PhFSsbok/s1600/chrome-new-instance.PNG" title="Independent instance of Chrome for Cross-domain Javascript/AJAX" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">New Instance of Chrome for testing Cross Domain AJAX Calls</td></tr>
</tbody></table>
<br />
You can have your normal personal instance of chrome running and then run this command whenever you need to test a web application that needs to access a cross-domain data source. <br />
<br />
<br />Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6244930388325813354.post-83235596419113909532014-10-13T14:02:00.001-04:002014-10-27T13:21:47.534-04:00Disabled Save Button on Forms while Saving in Salesforce<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
<style type="text/css">
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:300px;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnZ0ewiLSSHFBej1JR6l9hNfnEGQcjjUlmDZIJLfXj7taT9Nt6nh5_oYCS5rNwI1e5rsQ7HIlCpS7v5IAXlSUWduAXKXEJkRM9pZMhyp99C2cQkf-zk0cI77Fmu8uQyg4CALsrrW5MQb2h/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
</style>
<br />
<br />
<h1>
How to Disable the Save Button on your Form while the Form is Saving to Prevent Multiple Submissions in a Custom Salesforce Visualforce Page</h1>
<div>
<br /></div>
<div>
<br /></div>
<div>
Salesforce default functionality on forms will disable the save button after the form is submitted to prevent multiple submissions.</div>
<div>
<br /></div>
<div>
The disabled Save button will look like:</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1mwJDNkC1c4qhjUmhRM8m6ScY7uY1fpEkWUJyHkDn53BNYJUDlc3AWPLmUKKHp4Aw-A73Q301-rDjgAZ8oUExAKou9h-LDv5u0P73QNj2yyJIaXQJCpRFsvY9TIWJDPhIP2WuQnRd8Ls/s1600/disabled-save-button.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Disabled save button after submitting a form in Salesforce" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1mwJDNkC1c4qhjUmhRM8m6ScY7uY1fpEkWUJyHkDn53BNYJUDlc3AWPLmUKKHp4Aw-A73Q301-rDjgAZ8oUExAKou9h-LDv5u0P73QNj2yyJIaXQJCpRFsvY9TIWJDPhIP2WuQnRd8Ls/s1600/disabled-save-button.png" title="Disabled save button after submitting a form in Salesforce" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Disabled save button after form submit</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
When creating your own VisualForce page you can write custom code to mimic this functionality in your forms using just Javascript and modifying the button's CSS styles.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<h3>
Create Javascript functions to disable and enable the save button</h3>
<hr />
<br />
<br />
You will need to create 2 Javascript functions that will enable and disable the button by modifying the css and properties of the save button.
<br />
<br />
I am using jQuery but you can also do this with vanilla Javascript. I am currently using a unique style class attached to the button to look it up for convenience since this page does not get modified very often if ever and also because the element id is used by Salesforce for internal SFDC functionality.
<br />
<br />
<pre class="prettyprint"> function disableSave() {
j$(".saveButtonId").prop("disabled","true");
j$(".saveButtonId").val("Saving...");
j$(".saveButtonId").css( "border-color", "#c4c4c4" );
j$(".saveButtonId").css( "color", "#909090" );
}
function enableSave() {
j$(".saveButtonId").removeProp( "disabled" )
j$(".saveButtonId").val("Save");
j$(".saveButtonId").css( "border-color", "#7f7f7f" );
j$(".saveButtonId").css( "color", "#333" );
}
</pre>
<br />
<h3>
Add events to the Salesforce save button on your Visualforce Page</h3>
<hr />
<br />
<br />
You will then need to bind your Javascript functions to the onclick and oncomplete event on your save button. I am using binding within the tag since I am using a custom apex:commandbutton Visualforce tag to create the save button.
<br />
<br />
This will disable the save button on click and re-enable the button when the AJAX request completes that clicking your save button initiated.
<br />
<br />
<pre class="prettyprint"><apex:commandbutton action="{!save}" onclick="disableSave()" oncomplete="enableSave()" status="savingStatus" styleclass="saveButtonId" value="Save">
</apex:commandbutton></pre>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6244930388325813354.post-54549288216854583052014-08-26T14:28:00.000-04:002015-09-17T18:10:03.027-04:00Setup Service Rocket Connector for Salesforce.com and JIRA<h2>
Setup Service Rocket Connector for Salesforce.com and JIRA</h2>
<br />
<br />
<br />
<br />
Are you looking into integrating Salesforce and JIRA? The following product comes pre-installed on Cloud On-Demand JIRA instances.
<br />
<br />
<a href="http://marketplace.servicerocket.com/product/connector-for-salesforcecom-and-jira">Service Rocket Connector for Salesforce.com and JIRA</a>
<br />
<br />
The ServiceRocket Connector for Salesforce.com and JIRA links and synchronizes Salesforce.com cases and JIRA issues for an integrated experience from either interface.
<br />
<br />
<br />
<h3>
Add your Application Link to JIRA for your Salesforce instance</h3>
<hr />
<br />
<br />
First you need to go into your Add-ons section and navigate to the add a application link for your Salesforce instance:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7euDD9D6pMOYf_ykL-zr5NaCpgPzLgFm55SNNYDapx8G7k6ShrMgXZyxxyo0qgi-FgligVmL2hx6oO6ZdAcHGqDRg-YEeceo6fv0_jmtEVB7JJ0a4qDYBgjUXvKuyCy1McqbT65EuKog/s1600/jira-salesforce-add-app.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7euDD9D6pMOYf_ykL-zr5NaCpgPzLgFm55SNNYDapx8G7k6ShrMgXZyxxyo0qgi-FgligVmL2hx6oO6ZdAcHGqDRg-YEeceo6fv0_jmtEVB7JJ0a4qDYBgjUXvKuyCy1McqbT65EuKog/s1600/jira-salesforce-add-app.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Add application link</td></tr>
</tbody></table>
<br />
<br />
Add your salesforce domain:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcdZF0ctCsgiyst7HU9n7N62YMyIccd9PmgI6abNN0NM_XfQSOO81lyFXrCRtIni4BIqZdbdeKro195C06kMXAFZ3BuMArqtg137zeqCdulqgwpbNDGCVor4wxcnzT9IT23YBDXYPGrqM/s1600/jira-salesforce-add-app-link.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcdZF0ctCsgiyst7HU9n7N62YMyIccd9PmgI6abNN0NM_XfQSOO81lyFXrCRtIni4BIqZdbdeKro195C06kMXAFZ3BuMArqtg137zeqCdulqgwpbNDGCVor4wxcnzT9IT23YBDXYPGrqM/s1600/jira-salesforce-add-app-link.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Add application link</td></tr>
</tbody></table>
<br />
<br />
<h3>
Get your SEN Number</h3>
<hr />
<br />
You will need your SEN number to setup the plugin.<br />
<br />
<a href="https://confluence.atlassian.com/pages/viewpage.action?pageId=190481750">Finding the JIRA Support Entitlement Number (SEN)</a><br />
<br />
<br />
<h3>
Acquire a Connector License</h3>
<hr />
<br />
You will need to acquire a license for the Salesforce JIRA connector. Navigate to the following link to acquire a license which will be valid for 30 days.<br />
<h3>
<a href="http://marketplace.servicerocket.com/product/connector-for-salesforcecom-and-jira">Get a Connector License</a></h3>
<div>
<br /></div>
<div>
You will receive an email with the following heading: "Download - Connector for Salesforce.com and JIRA"</div>
<div>
<br /></div>
<div>
Within the email, click on: User Profile</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br /></div>
<div>
Download your license</div>
<div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm8SvWm7KIk0ac-B2hv5KlDmT6LyFRGH6rslIhzcmBR3DnGe6C2CLM_kEo5CtqJdDwfcAV1RnO0HCi3J56ec9IhdLBFSbEnwYi39whldaSfKnsugCGEHaOnTwZuY8SatEaSuINaTaVffk/s1600/jira-salesforce-download-license.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm8SvWm7KIk0ac-B2hv5KlDmT6LyFRGH6rslIhzcmBR3DnGe6C2CLM_kEo5CtqJdDwfcAV1RnO0HCi3J56ec9IhdLBFSbEnwYi39whldaSfKnsugCGEHaOnTwZuY8SatEaSuINaTaVffk/s1600/jira-salesforce-download-license.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Download License</td></tr>
</tbody></table>
<br />
<br />
<br />
Upload your license file<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5Y5O1Pu6DfhQTW7oehaqp0ls9d1uzoh29ZN5RRlaaEgqqXHQ25dIyznnE-hCE0JTTzO5jTU9afOIQNMFoy-AjMUTLqk5WIAlPbbQaWzGx_TUPGAJ4d10oBbTuR8VLtFR3hHB0-RWe82E/s1600/jira-salesforce-add-license.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5Y5O1Pu6DfhQTW7oehaqp0ls9d1uzoh29ZN5RRlaaEgqqXHQ25dIyznnE-hCE0JTTzO5jTU9afOIQNMFoy-AjMUTLqk5WIAlPbbQaWzGx_TUPGAJ4d10oBbTuR8VLtFR3hHB0-RWe82E/s1600/jira-salesforce-add-license.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Upload your license file</td></tr>
</tbody></table>
<br />
<br /></div>
<div>
<br /></div>
<div>
<br />
<br /></div>
<h3>
</h3>
<h3>
Setup Connector </h3>
<hr />
<br />
<br />
You will need to create a new cloud connection to your Salesforce instance using your Application Link.<br />
<br />
For password, you will want to append your security token on the end of your password when you configure authentication.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD7CUyD7iG30uOn3AKvdIIIWvRoxetvbCKjoUadBkUiu2553JIPHPsj1_vSdAYboSydl_RkVcnMlEGL0-UbugThVdyB8YIDsuAm888W1vmB8d9Ya770Se2NsujEfT-Xsfwvr4Pe4lZYNU/s1600/jira-salesforce-setup-connection.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD7CUyD7iG30uOn3AKvdIIIWvRoxetvbCKjoUadBkUiu2553JIPHPsj1_vSdAYboSydl_RkVcnMlEGL0-UbugThVdyB8YIDsuAm888W1vmB8d9Ya770Se2NsujEfT-Xsfwvr4Pe4lZYNU/s1600/jira-salesforce-setup-connection.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Setup connector</td></tr>
</tbody></table>
Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-6244930388325813354.post-36200826215465306412014-07-22T17:03:00.000-04:002015-09-17T18:10:24.912-04:00Create a Salesforce User in Apex with all Required Fields Populated<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
<style type="text/css">
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:300px;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnZ0ewiLSSHFBej1JR6l9hNfnEGQcjjUlmDZIJLfXj7taT9Nt6nh5_oYCS5rNwI1e5rsQ7HIlCpS7v5IAXlSUWduAXKXEJkRM9pZMhyp99C2cQkf-zk0cI77Fmu8uQyg4CALsrrW5MQb2h/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
</style>
<br />
<br />
<h2>
Create a Salesforce User with Code in Apex with all of the Required Fields Populated for a Test Class</h2>
<br />
<br />
When attempting to create a user with code in Apex you will encounter an error if you do not populate every single required field. You may be attempting to do this for a Test class or for any number of reasons.
The error you encounter may look similar to the following:
<br />
<br />
<h4>
Missing fields Exception</h4>
<blockquote>
System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [LastName, Email, Alias, TimeZoneSidKey, LocaleSidKey, EmailEncodingKey, ProfileId, LanguageLocaleKey]: [LastName, Email, Alias, TimeZoneSidKey, LocaleSidKey, EmailEncodingKey, ProfileId, LanguageLocaleKey]
</blockquote>
<br />
<br />
<h3>
Create a User</h3>
<hr />
<br />
<br />
Many of those fields require specific values populated from a picklist. Below is some boilerplate code you can use to create a use programmatically with all of those fields populated correctly. You can use your own values for timezonesidkey and locale if desired. They are listed below.
<br />
<br />
<h4>
List of TimeZoneSidKey values you can use</h4>
<div style="border: 1px solid lightgray; height: 120px; overflow: auto;">
Pacific/Kiritimati <br />
Pacific/Chatham <br />
Pacific/Auckland <br />
Pacific/Enderbury <br />
Pacific/Fiji <br />
Pacific/Tongatapu <br />
Asia/Kamchatka <br />
Pacific/Norfolk <br />
Australia/Lord_Howe <br />
Australia/Sydney <br />
Pacific/Guadalcanal <br />
Australia/Adelaide <br />
Australia/Darwin <br />
Asia/Seoul <br />
Asia/Tokyo <br />
Asia/Hong_Kong <br />
Asia/Kuala_Lumpur <br />
Asia/Manila <br />
Asia/Shanghai <br />
Asia/Singapore <br />
Asia/Taipei <br />
Australia/Perth <br />
Asia/Bangkok <br />
Asia/Ho_Chi_Minh <br />
Asia/Jakarta <br />
Asia/Rangoon <br />
Asia/Dhaka <br />
Asia/Yekaterinburg <br />
Asia/Kathmandu <br />
Asia/Colombo <br />
Asia/Kolkata <br />
Asia/Karachi <br />
Asia/Tashkent <br />
Asia/Kabul <br />
Asia/Dubai <br />
Asia/Tbilisi <br />
Europe/Moscow <br />
Asia/Tehran <br />
Africa/Nairobi <br />
Asia/Baghdad <br />
Asia/Kuwait <br />
Asia/Riyadh <br />
Europe/Minsk <br />
Africa/Cairo <br />
Africa/Johannesburg <br />
Asia/Jerusalem <br />
Europe/Athens <br />
Europe/Bucharest <br />
Europe/Helsinki <br />
Europe/Istanbul <br />
Africa/Algiers <br />
Europe/Amsterdam <br />
Europe/Berlin <br />
Europe/Brussels <br />
Europe/Paris <br />
Europe/Prague <br />
Europe/Rome <br />
Europe/Dublin <br />
Europe/Lisbon <br />
Europe/London <br />
GMT <br />
Atlantic/Cape_Verde <br />
America/Sao_Paulo <br />
Atlantic/South_Georgia <br />
America/Argentina/Buenos_Aires <br />
America/Santiago <br />
America/St_Johns <br />
America/Halifax <br />
America/Puerto_Rico <br />
Atlantic/Bermuda <br />
America/Caracas <br />
America/Bogota <br />
America/Indiana/Indianapolis <br />
America/Lima <br />
America/New_York <br />
America/Panama <br />
America/Chicago <br />
America/El_Salvador <br />
America/Mexico_City <br />
America/Denver ****America/Denver <br />
America/Phoenix <br />
America/Los_Angeles <br />
America/Tijuana <br />
America/Anchorage <br />
Pacific/Honolulu <br />
Pacific/Niue <br />
Pacific/Pago_Pago
</div>
<br />
<br />
<h4>
List of LocaleSidKey values you can use</h4>
<div style="border: 1px solid lightgray; height: 120px; overflow: auto;">
sq <br />
sq_AL <br />
ar <br />
ar_BH <br />
ar_EG <br />
ar_JO <br />
ar_KW <br />
ar_LB <br />
ar_QA <br />
ar_SA <br />
ar_AE <br />
hy <br />
hy_AM <br />
az_AZ <br />
eu <br />
eu_ES <br />
be_BY <br />
bn_BD <br />
bs <br />
bs_BA <br />
bg <br />
bg_BG <br />
ca <br />
ca_ES_EURO <br />
ca_ES <br />
zh <br />
zh_CN_PINYIN <br />
zh_CN_STROKE <br />
zh_CN <br />
zh_HK_STROKE <br />
zh_HK <br />
zh_MO <br />
zh_SG <br />
zh_TW_STROKE <br />
zh_TW <br />
hr <br />
hr_HR <br />
cs <br />
cs_CZ <br />
da <br />
da_DK <br />
nl <br />
nl_BE <br />
nl_NL <br />
nl_SR <br />
en_AU <br />
en_BB <br />
en_BM <br />
en_CA <br />
en_GH <br />
en_IN <br />
en_ID <br />
en_IE_EURO <br />
en_IE <br />
en_MY <br />
en_NZ <br />
en_NG <br />
en_PK <br />
en_PH <br />
en_SG <br />
en_ZA <br />
en_GB <br />
en_US <br />
et <br />
et_EE <br />
fi <br />
fi_FI_EURO <br />
fi_FI <br />
fr <br />
fr_BE <br />
fr_CA <br />
fr_FR_EURO <br />
fr_FR <br />
fr_LU <br />
fr_MC <br />
fr_CH <br />
ka <br />
ka_GE <br />
de <br />
de_AT_EURO <br />
de_AT <br />
de_DE_EURO <br />
de_DE <br />
de_LU_EURO <br />
de_LU <br />
de_CH <br />
el <br />
el_GR <br />
iw <br />
iw_IL <br />
hi <br />
hi_IN <br />
hu <br />
hu_HU <br />
is <br />
is_IS <br />
in <br />
in_ID <br />
ga <br />
ga_IE <br />
it <br />
it_IT <br />
it_CH <br />
ja <br />
ja_JP <br />
kk_KZ <br />
km_KH <br />
ky_KG <br />
ko <br />
ko_KR <br />
lv <br />
lv_LV <br />
lt <br />
lt_LT <br />
lb <br />
lb_LU <br />
mk <br />
mk_MK <br />
ms <br />
ms_BN <br />
ms_MY <br />
mt <br />
mt_MT <br />
sh_ME <br />
no <br />
no_NO <br />
pl <br />
pl_PL <br />
pt <br />
pt_AO <br />
pt_BR <br />
pt_PT <br />
ro <br />
ro_MD <br />
ro_RO <br />
rm <br />
rm_CH <br />
ru <br />
ru_RU <br />
sr <br />
sr_BA <br />
sh <br />
sh_BA <br />
sh_CS <br />
sr_CS <br />
sk <br />
sk_SK <br />
sl <br />
sl_SI <br />
es <br />
es_AR <br />
es_BO <br />
es_CL <br />
es_CO <br />
es_CR <br />
es_DO <br />
es_EC <br />
es_SV <br />
es_GT <br />
es_HN <br />
es_MX <br />
es_PA <br />
es_PY <br />
es_PE <br />
es_PR <br />
es_ES_EURO <br />
es_ES <br />
es_UY <br />
es_VE <br />
sv <br />
sv_SE <br />
tl <br />
tl_PH <br />
tg_TJ <br />
th <br />
th_TH <br />
tr <br />
tr_TR <br />
uk <br />
uk_UA <br />
ur <br />
ur_PK <br />
vi <br />
vi_VN <br />
cy <br />
cy_GB
</div>
<br />
<br />
<h4>
List of EmailEncodingKey values you can use</h4>
<div style="border: 1px solid lightgray; height: 120px; overflow: auto;">
UTF-8 <br />
ISO-8859-1 <br />
Shift_JIS <br />
ISO-2022-JP <br />
EUC-JP <br />
ks_c_5601-1987 <br />
Big5 <br />
GB2312
</div>
<br />
<br />
<h4>
List of LanguageLocaleKey values you can Use </h4>
<div style="border: 1px solid lightgray; height: 120px; overflow: auto;">
Chinese (Simplified): zh_CN <br />
Chinese (Traditional): zh_TW <br />
Danish: da <br />
Dutch: nl_NL <br />
English: en_US <br />
Finnish: fi <br />
French: fr <br />
German: de <br />
Italian: it <br />
Japanese: ja <br />
Korean: ko <br />
Portuguese (Brazil): pt_BR <br />
Russian: ru <br />
Spanish: es <br />
Swedish: sv <br />
Thai: th <br />
Arabic: ar <br />
Bulgarian: bg <br />
Czech: cs <br />
English (UK): en_GB <br />
Greek: el <br />
Spanish (Mexico): es_MX <br />
Hebrew: iw <br />
Hungarian: hu <br />
Indonesian: in <br />
Norwegian: no <br />
Polish: pl <br />
Romanian: ro <br />
Turkish: tr <br />
Ukrainian: uk <br />
Vietnamese: vi <br />
Albanian: sq <br />
Armenian: hy <br />
Basque: eu <br />
Bosnian: bs <br />
Croatian: hr <br />
English (Australia): en_AU <br />
English (Canada): en_CA <br />
English (India): en_IN <br />
English (Malaysia): en_MY <br />
English (Philippines): en_PH <br />
Estonian: et <br />
French (Canada): fr_CA <br />
Georgian: ka <br />
Hindi: hi <br />
Icelandic: is <br />
Irish: ga <br />
Latvian: lv <br />
Lithuanian: lt <br />
Luxembourgish: lb <br />
Macedonian: mk <br />
Malay: ms <br />
Maltese: mt <br />
Moldovan: ro_MD <br />
Montenegrin: sh_ME <br />
Portuguese (European): pt_PT <br />
Romansh: rm <br />
Serbian (Cyrillic): sr <br />
Serbian (Latin): sh <br />
Slovak: sk <br />
Slovenian: sl <br />
Tagalog: tl <br />
Urdu: ur <br />
Welsh: cy
</div>
<br />
<br />
<h4>
Code to create a user in Apex</h4>
<pre class="prettyprint"> User user = new User();
user.FirstName = 'Test';
user.LastName = 'Name';
user.CompanyName = 'IT Test Company';
user.MobilePhone = '123-456-7890';
user.Username = 'testUser-' + generateRandomString() + '@test.com';
user.Email = 'testUser-' + generateRandomString() + '@test.com';
user.Alias = 'test';
user.CommunityNickname = 'test1';
user.TimeZoneSidKey = 'America/New_York';
user.LocaleSidKey = 'en_US';
user.EmailEncodingKey = 'UTF-8';
user.ProfileId = prof.Id;
user.LanguageLocaleKey = 'en_US';
user.Street = '123 Test St';
user.City = 'Testcity';
user.State = 'va';
user.PostalCode = '23223';
user.Country = 'USA';
insert user;
</pre>
<br />
<h4>
Generate a Random Numeric String</h4>
<pre class="prettyprint"> private static String generateRandomString() {
return '' + math.rint( math.random() * 100000 );
}
</pre>
<br />
<br />
Here is a link to a user having a similar problem on the Salesforce forums: <a href="https://success.salesforce.com/answers?id=90630000000h1V4AAI">Creating a user in Apex</a>
<br />
<br />
<h3>
Using System.runAs() to Run Code as the User you just Created</h3>
<hr />
<br />
<br />
After creating that user, you may want to explicitly run code as this user. You may want to check permissions or sharing rules are applying correctly to that user's profile for instance. You can accomplish this using a runAs block and passing in the user you just created.
<br />
<br />
<h4>
IsTest Annotation to use Existing Data in Test Class</h4>
<pre class="prettyprint"> System.runAs(user) {
// The following code runs as user 'u'
System.debug('Current User: ' + UserInfo.getUserName());
// Perform user specific operations here
}
</pre>
<br />
<br />
More info on the runAs command here: <a href="https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_tools_runas.htm">Salesforce runAs Documentation</a>
<br />
<br />
It is also documented in this Salesforce article: <a href="https://developer.salesforce.com/page/An_Introduction_to_Apex_Code_Test_Methods">Salesforce Intro to Testing</a>
<br />
<br />
<h3>
Avoid Staging User Data by Using Existing Data</h3>
<hr />
<br />
<br />
Alternatively, you may be able to avoid having to stage user data entirely by using existing data in the database. If you want your Test Class to use existing data in your environment, whether its Sandbox or Test or Prod, you can use the following modification to the isTest annotation:
<br />
<br />
<h4>
IsTest Annotation to use Existing Data in Test Class</h4>
<pre class="prettyprint">@IsTest(SeeAllData=true)
</pre>
<br />
<br />
Place the annotation above the class declaration for your test class. Then your test class should have access to all of your organization's data in your Salesforce instance. Be sure to consider your use cases when deciding to use existing data or staging new data.
<br />
<br />
Additional info on the @IsTest annotation: <a href="https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_annotation_isTest.htm">IsTest Annotation</a>
<br />
<br />Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-6244930388325813354.post-89649775867788203342014-07-01T17:19:00.000-04:002015-09-17T18:09:07.899-04:00Salesforce Combobox Autocomplete in IE8 using jQuery
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
<style type="text/css">
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:300px;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnZ0ewiLSSHFBej1JR6l9hNfnEGQcjjUlmDZIJLfXj7taT9Nt6nh5_oYCS5rNwI1e5rsQ7HIlCpS7v5IAXlSUWduAXKXEJkRM9pZMhyp99C2cQkf-zk0cI77Fmu8uQyg4CALsrrW5MQb2h/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
</style>
<br />
<h2>
Creating a Combobox Autocomplete Input Field Compatible with Internet Explorer 8+ using jQuery</h2>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />
<h3>
Issues with Built-in Combobox functionality in Visualforce</h3>
<hr />
<br />
If you try to use the off-the-shelf apex tag to using a inputText field to create a combobox by passing in a list of comma-separated values you will get a nasty surprise when you try to open the page in Internet Explorer. Even though IE is officially supported, it will not display correctly.
<br />
<br />
<h4>
Apex Default Combobox Tag</h4>
<pre class="prettyprint"> <apex:inputtext list="{!getAccounts}" value="{!accountName}"></apex:inputtext>
</pre>
<br />
<br />
A great way to get around this limitation is to use the jQuery combo box. The jQuery combo box is not a standard widget and will not be packed into the jQuery UI by default, but you can configure it with a reasonable amount of code.
<br />
<br />
<strong>You will need the following libs:</strong>
<br />
<ul>
<li>jQuery javascript library - <a href="http://jquery.com/">jQuery</a></li>
<li>jQuery UI javascript library - <a href="http://jqueryui.com/">jQuery UI</a></li>
</ul>
<br />
<br />
<a href="http://jqueryui.com/autocomplete/#combobox"></a>
<br />
<h3>
Avoid conflicts with the Prototype library built into Salesforce</h3>
<hr />
<br />
Use this line of code at the top of your visualforce page to avoid conflicts with other javascript libraries. Salesforce uses the Prototype library behind the scenes to implement much of it's functionality. You will need to use j$ instead of $ in all of your jQuery code after using this snippet to avoid conflicts.<br />
<br />
<h4>
Avoid Conflicts with other Javascript Libs</h4>
<pre class="prettyprint">var j$ = jQuery.noConflict();
</pre>
<br />
<br />
<h3>
Configure your Combobox</h3>
<hr />
<br />
Then this code will initialize and configure your basic combo box functionality. You can modify various functions and behaviors of the combobox here such as the duration that tooltips display or the names of the css classes applied to your widget.
<br />
<br />
<h4>
Configure your jQuery Combobox Widget</h4>
<pre class="prettyprint" style="max-height: 300px; overflow: auto;"> (function( $ ) {
j$.widget( "custom.combobox", {
_create: function() {
this.wrapper = $( "<span>" )
.addClass( "custom-combobox" )
.insertAfter( this.element );
this.element.hide();
this._createAutocomplete();
this._createShowAllButton();
},
_createAutocomplete: function() {
var selected = this.element.children( ":selected" ),
value = selected.val() ? selected.text() : "";
this.input = j$( "<input>" )
.appendTo( this.wrapper )
.val( value )
.attr( "title", "" )
.addClass( "custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left" )
.autocomplete({
delay: 0,
minLength: 0,
source: $.proxy( this, "_source" )
})
.tooltip({
tooltipClass: "ui-state-highlight"
});
this._on( this.input, {
autocompleteselect: function( event, ui ) {
ui.item.option.selected = true;
this._trigger( "select", event, {
item: ui.item.option
});
},
autocompletechange: "_removeIfInvalid"
});
},
_createShowAllButton: function() {
var input = this.input,
wasOpen = false;
j$( "<a>" )
.attr( "tabIndex", -1 )
.attr( "title", "Show All Items" )
.tooltip()
.appendTo( this.wrapper )
.button({
icons: {
primary: "ui-icon-triangle-1-s"
},
text: false
})
.removeClass( "ui-corner-all" )
.addClass( "custom-combobox-toggle ui-corner-right" )
.mousedown(function() {
wasOpen = input.autocomplete( "widget" ).is( ":visible" );
})
.click(function() {
input.focus();
// Close if already visible
if ( wasOpen ) {
return;
}
// Pass empty string as value to search for, displaying all results
input.autocomplete( "search", "" );
});
},
_source: function( request, response ) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
response( this.element.children( "option" ).map(function() {
var text = $( this ).text();
if ( this.value && ( !request.term || matcher.test(text) ) )
return {
label: text,
value: text,
option: this
};
}) );
},
_removeIfInvalid: function( event, ui ) {
// Selected an item, nothing to do
if ( ui.item ) {
return;
}
// Search for a match (case-insensitive)
var value = this.input.val(),
valueLowerCase = value.toLowerCase(),
valid = false;
this.element.children( "option" ).each(function() {
if ( j$( this ).text().toLowerCase() === valueLowerCase ) {
this.selected = valid = true;
return false;
}
});
// Found a match, nothing to do
if ( valid ) {
return;
}
// Remove invalid value
this.input
.val( "" )
.attr( "title", value + " Select a value" )
.tooltip( "open" );
this.element.val( "" );
this._delay(function() {
this.input.tooltip( "close" ).attr( "title", "" );
}, 900 );
this.input.autocomplete( "instance" ).term = "";
},
_destroy: function() {
this.wrapper.remove();
this.element.show();
}
});
})( jQuery );
</pre>
<br />
<br />
<h3>
Create a select box</h3>
<hr />
<br />
Then you need to create a select dropdown element. This is being accomplished down here using a dynamic apex:selectList while passing in a List of SelectOptions and tracking the value of the selected option using a String from the Apex Controller.
<br />
<br />
<h4>
Create your Select box Dropdown using a Dynamic VisualForce selectList Tag</h4>
<pre class="prettyprint"> <div class="ui-widget">
<apex:selectList multiselect="false" size="1" title="Select box" value="{!selectBoxValue}" label="Duration" styleClass="largeInput comboboxSelectBox">
<apex:selectOptions value="{!selectBoxList}"/>
</apex:selectList>
</div>
</pre>
<br />
<h3>
Add a Variable to Apex Controller</h3>
<hr />
<br />
This variable will be in your apex controller to store the value of the selectbox. This String will store the ID of the currently selected value.
<br />
<br />
<h4>
Apex Controller Value</h4>
<pre class="prettyprint">
public String transactionDateRangeVal {get; set;}
</pre>
<br />
<br />
<h3>
Generate values for your select list</h3>
<hr />
<br />
This Apex method in your controller will create the list of values for your select list. You will be returning a List of SelectOption objects back to your select box which will automatically generate the select box from that list which jQuery will convert into a combobox.
<br />
<br />
<h4>
Apex Controller method to create a List of SelectOptions</h4>
<pre class="prettyprint">
public List<selectoption> getSelectBoxList() {
List<selectoption> options = new List<selectoption>();
options.add(new SelectOption('Select Value','Select Label'));
options.add(new SelectOption('Select Value','Select Label'));
return options;
}
</selectoption></selectoption></pre>
<br />
<h3>
Initialize your combobox</h3>
<hr />
<br />
Initialize your combobox by using a unique class name in the apex:selectList. The class name comboboxSelectBox is used in this case. Why can't you use the id parameter? Because Salesforce uses the id parameter to create a dynamic id that it uses for it's built in functionality. You won't have access to it unless you override the value using javascript but that would break existing functionality native to Salesforce.
<br />
<br />
<h4>
Initialize your SelectBox into a jQuery Combobox</h4>
<pre class="prettyprint">
j$(function() {
j$( ".comboboxSelectBox" ).combobox();
j$( "#toggle" ).click(function() {
j$( ".comboboxSelectBox" ).toggle();
});
});
</pre>
<br />
<h3>
Match the default Salesforce Look and Feel</h3>
<hr />
<br />
Here is some CSS to override the default jQuery style and make it fit in with the look-and-feel of Salesforce. Off-the-shelf jQuery UI elements will clash pretty heavility with Salesforce UI elements so I highly recommend you use this code and modify it further to reach a more unified user experience.
<br />
<br />
<h4>
CSS to help the jQuery Combobox look more like the Salesforce default Look and Feel</h4>
<pre class="prettyprint" style="max-height: 300px; overflow: auto;">
ul.ui-autocomplete {
overflow: auto;
max-height: 300px;
}
.custom-combobox {
position: relative;
display: inline-block;
}
.custom-combobox-toggle {
position: absolute;
top: 0;
bottom: 0;
margin-left: -1px;
padding: 0;
/* support: IE7 */
*height: 1.4em;
*top: 0.1em;
}
.custom-combobox-input {
margin: 0;
padding: 0.2em;
}
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
background: white;
border: 1px solid gray;
}
.ui-widget {
font-family: Arial,Helvetica,sans-serif;
color: #000;
font-size: 1.023em;
}
input.ui-state-default, input.ui-widget-content input.ui-state-default, input.ui-widget-header input.ui-state-default {
width: 177px;
}
a.ui-state-default, a.ui-widget-content a.ui-state-default, a.ui-widget-header a.ui-state-default {
width: 20px;
border-left: 0px solid gray;
border-right: 1px solid gray;
border-top: 1px solid gray;
border-bottom: 1px solid gray;
}
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br {
border-bottom-right-radius: 0px;
}
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl {
border-bottom-left-radius: 0px;
}
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr {
border-top-right-radius: 0px;
}
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl {
border-top-left-radius: 0px;
}
</pre>
<a href="http://www.blogcatalog.com/blogs/coding-development-solutions-other-stuff" title="Software Development Blogs - BlogCatalog Blog Directory"><img alt="Software Development Blogs - BlogCatalog Blog Directory" src="http://www.blogcatalog.com/images/buttons/blogcatalog_seal_125.png" style="border: 0;" /></a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6244930388325813354.post-88828414835029406062014-06-13T22:06:00.000-04:002015-09-17T18:10:50.373-04:00Tips for Migrating from Eclipse to IntelliJ - Re-learning shortcuts and other Tips<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<br />
<h2>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">
Migrating from Eclipse to IntelliJ: Re-learning shortcuts and other Tips</span></h2>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">As a long-time Eclipse user(Spring Tools Suite and Groovy and Grails Tools Suite), the transition to using IntelliJ was jarring in many ways. Keyboard shortcuts are different, the layout is different and the way you do things is different.</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">It is worth it to go through with the transition. Auto-complete and searching is better. Logs and consoles are better. The tooling is better. There are plenty of articles out there that highlight the changes. Most importantly though is that it is does everything you need well and is very fast.</span><br />
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Here are some things that will help with your transition:</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<br />
<h3>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">How to Change the JDK</span></h3>
<hr />
<br />
<br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><b>Setup the JDK locations</b></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Here you will want to setup the location of the Java SDKs you have installed.</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Ctrl+Shift+Alt+S -> Platform Settings -> SDKs: Change JDK</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN7MLL8TJZ_Qm-johb98uaEfa5frFD0Tc01Hm8oBaN1lsUlTQ0YfPez-H4V0c0Z68HlbPNGy8tD6jIxpMPv0hdIfi-kEaW-wImIisRoLXU4uArtc3NynuQarkPCJnCnFtmw79sbmdk4nw/s1600/intellij+change+JDK.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Change the JDK path in IntelliJ" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN7MLL8TJZ_Qm-johb98uaEfa5frFD0Tc01Hm8oBaN1lsUlTQ0YfPez-H4V0c0Z68HlbPNGy8tD6jIxpMPv0hdIfi-kEaW-wImIisRoLXU4uArtc3NynuQarkPCJnCnFtmw79sbmdk4nw/s1600/intellij+change+JDK.png" title="Update the JDK in IntelliJ" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Update the JDK in the IntelliJ IDE</td></tr>
</tbody></table>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><b>Setup the Project SDK</b></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Then you will need to set the Project SDK</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Then go to Project Settings -> Project and change the Project SDK</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbTLB0G1WE4_rF-8iC_E7yTH9inz0qKC2ymY4olRHirbnnhGUoAGOSv7GhM1PyHIYUtbGwicKkTll9VBOWro5tBX753559JSSkxHM6lkq2pP-L1WEtQG7coMcw8bnQK68TINYVBiq-6cY/s1600/intellij+set+project+sdk.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Set Project SDK in Project Structure" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbTLB0G1WE4_rF-8iC_E7yTH9inz0qKC2ymY4olRHirbnnhGUoAGOSv7GhM1PyHIYUtbGwicKkTll9VBOWro5tBX753559JSSkxHM6lkq2pP-L1WEtQG7coMcw8bnQK68TINYVBiq-6cY/s1600/intellij+set+project+sdk.png" title="Set Project SDK" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Set Project Java SDK for IntelliJ</td></tr>
</tbody></table>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<br />
<h3>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">
Keyboard Shortcuts</span></h3>
<hr />
</div>
<br />
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Here is a mapping of Eclipse vs IntelliJ keyboard shortcuts.</span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Here are a couple of the most used:</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<br />
<ul>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+n: Find a file by class name</span></li>
</ul>
<ul>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+shift+f: Search the entire project within files for a string</span></li>
</ul>
<ul>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+s: Save all files</span></li>
</ul>
<ul>
<li><span style="background-color: white; font-family: Helvetica Neue, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 20px;">ctrl+shift+N: Find Resource</span></li>
</ul>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 20px;"><br /></span></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 20px;">Grails Specific Shortcuts</span></span></div>
<ul>
<li><span style="background-color: white; font-family: Helvetica Neue, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 20px;">ctrl+alt+G: Open Grails Command line(Run Grails Target)</span></li>
</ul>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<b><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Here is a more comprehensive list:</span></b></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<table class="table table-hover table-striped" style="background-color: white; border-collapse: collapse; border-spacing: 0px; border: 0px; color: black; font-size: 15px; line-height: 21.434999465942383px; margin: 0px 0px 20px; max-width: 100%; padding: 0px; vertical-align: baseline; width: 618px;"><tbody style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><strong style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Eclipse</span></strong></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><strong style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">IntelliJ IDEA</span></strong></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><strong style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Description</span></strong></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">F4</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+h</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">show the type hierarchy</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: whitesmoke; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+alt+g</span></td><td style="background-color: whitesmoke; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+alt+F7</span></td><td style="background-color: whitesmoke; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">find usages</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+shift+u</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+f7</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">finds the usages in the same file</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">alt+shift+r</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">shift+F6</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">rename</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+shift+r</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+shift+N</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">find file / open resource</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+shift+x, j</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+shift+F10</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">run (java program)</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+shift+o</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+alt+o</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">organize imports</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+o</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+F12</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">show current file structure / outline</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+shift+m</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl+alt+V</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">create local variable refactoring</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">syso ctrl+space</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">sout ctrj+j</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">System.out.println(“”)</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">alt + up/down</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + shift + up/down</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">move lines</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + d</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + y</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">delete current line</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">???</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">alt + h</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">show subversion history</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + h</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + shift + f</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">search (find in path)</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">“semi” set in window-> preferences</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + shift + enter</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">if I want to add the semi-colon at the end of a statement</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + 1 or ctrl + shift + l</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + alt + v</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">introduce local variable</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">alt + shift + s</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">alt + insert</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">generate getters / setters</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + shift + f</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + alt + l</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">format code</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + y</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + shift + z</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">redo</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + shift + c</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + /</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">comment out lines (my own IDEA shortcut definition for comment/uncomment on german keyboard layout on laptop: ctrl + shift + y)</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + alt + h</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + alt + h (same!)</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">show call hierarchy</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">none ?</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + alt + f7</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">to jump to one of the callers of a method</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + shift + i</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">alt + f8</span></td><td style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">evaluate expression (in debugger)</span></td></tr>
<tr style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">F3</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">ctrl + b</span></td><td style="background-color: #f9f9f9; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-width: 1px 0px 0px; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 20px; margin: 0px; padding: 8px; vertical-align: top;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">go to declaration (e.g. go to method)</span></td></tr>
</tbody></table>
</div>
<h3>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></h3>
<h3>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></h3>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<br /></div>
<br />
<br />
<a href="http://www.blogcatalog.com/blogs/coding-development-solutions-other-stuff" title="Software Development Blogs - BlogCatalog Blog Directory"><img alt="Software Development Blogs - BlogCatalog Blog Directory" src="http://www.blogcatalog.com/images/buttons/blogcatalog_seal_125.png" style="border: 0;" /></a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6244930388325813354.post-38140169336677317072014-06-06T14:56:00.000-04:002015-09-17T18:09:27.795-04:00Salesforce Dynamically Populated List of Checkboxes in Visualforce and Apex<style>
pre {
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:auto;
overflow:auto;
background:#f0f0f0;;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnZ0ewiLSSHFBej1JR6l9hNfnEGQcjjUlmDZIJLfXj7taT9Nt6nh5_oYCS5rNwI1e5rsQ7HIlCpS7v5IAXlSUWduAXKXEJkRM9pZMhyp99C2cQkf-zk0cI77Fmu8uQyg4CALsrrW5MQb2h/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
line-height:20px;
}
code{
color:#000000;
word-wrap:normal;
}
</style>
<br />
<br />
<h2>
Dynamically Populated List of Checkboxes in Visualforce and Apex</h2>
<div>
<br /></div>
<div>
<br /></div>
<div>
Below you will find details on how to create a dynamic checkbox group on a custom Salesforce page using Apex and Visualforce.<br />
<br />
These examples will leverage Visualforce specific tags and Apex specific functionality to accomplish things that you would normally need an external library such as jQuery to acheive.</div>
<div>
<br /></div>
<div>
<br />
<br />
<h3>
<u>
Dynamic Array of Checkboxes</u></h3>
<br />
Dynamically build an array of checkboxes and keep track of which boxes are checked. Checkboxes will be populated from a SOQL query from a custom object in Salesforce. Selected options will be tracked and persisted if you re-render the checkboxes.<br />
<br />
<br /></div>
<div>
<br />
<h3>
<b><i>Visualforce</i></b></h3>
</div>
<br />
<b>Command button to refresh list of checkboxes</b><br />
<br />
<pre><code> <apex:commandButton action="{!refresh}" reRender="customCheckboxPanel" status="loadingDetails">
</code></pre>
<br />
<i>This is just an example. A more practical use of this would be a onchange or onclick event such as if you had checkbox groups on multiple tabs.</i><br />
<br />
<br />
<b>Output panel that is refreshed to display dynamic list of checkboxes</b><br />
<br />
<pre><code>
<apex:outputpanel id="customCheckboxPanel" layout="block">
<apex:actionStatus id="loadingDetails"
startText="Loading..."
stopText=""/>
<br/>
<apex:selectCheckboxes value="{!choices}" layout="pageDirection">
<apex:selectOptions value="{!list}"/><br/>
</apex:selectCheckboxes>
</apex:outputpanel>
</code></pre>
<br />
<br />
<br />
<h3>
<b><i>Apex</i></b></h3>
<div>
<b><i><br /></i></b></div>
This code will go in your controller.<br />
<br />
You will have an array of strings that will contain each id of each selected option.<br />
<br />
You will also need a method that retrieves the options via a SOQL queries and loads them into selectionOption objects<br />
<br />
<b>Choice Array and Get Select Options Method</b><br />
<br />
<pre><code>
//String array to keep track of the ids of choices
public String[] choices { get; set; }
//List of select options to populate select boxes
public List<SelectOption> getList() {
List<SelectOption> options = new List<SelectOption>();
for (Your_Custom_Object__c ow : [
SELECT Name,id FROM Your_Custom_Object__c]) {
options.add(new SelectOption(ow.id, ow.Name));
}
return options;
}
</code></pre>
<br />
The id is being set as the value and the Name is being set as the displayed label. Replace Your_Custom_Object__c with the name of the custom object you want to query.<br />
<br />
You should now have a set of checkboxes. Checked options will automatically be tracked in the choices String array.
<br />
<br />
<br />
<b>Checkbox Array Example</b><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9trxWILNvIP3W3AvV_6xYNNxaYq3w4OrUwgvH0TOSgq1i01hkGvyGHYTDDCj0k_IErWtiQ-pJPb7P8wAn3V8nA3kCGJ01lVUWy7u3KfHp6XYaxzI-Z-qu8AwQj6b8WLiW-xDgdVGBVX4/s1600/dynamic-check-boxes.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Check boxes populated with a SOQL query" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9trxWILNvIP3W3AvV_6xYNNxaYq3w4OrUwgvH0TOSgq1i01hkGvyGHYTDDCj0k_IErWtiQ-pJPb7P8wAn3V8nA3kCGJ01lVUWy7u3KfHp6XYaxzI-Z-qu8AwQj6b8WLiW-xDgdVGBVX4/s1600/dynamic-check-boxes.png" title="Check boxes populated with a SOQL query" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Dynamically populated checkboxes</td></tr>
</tbody></table>
<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<a href="http://www.blogcatalog.com/blogs/coding-development-solutions-other-stuff" title="Software Development Blogs - BlogCatalog Blog Directory"><img alt="Software Development Blogs - BlogCatalog Blog Directory" src="http://www.blogcatalog.com/images/buttons/blogcatalog_seal_125.png" style="border: 0;" /></a>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6244930388325813354.post-81322950976525866062014-06-04T14:28:00.001-04:002015-09-17T18:11:15.615-04:00Viewing DEBUG statements in Salesforce APEX Files using the Browser Developer's Console<br />
<br />
<br />
<h2>
How to view System Debug Statements in the Salesforce Dev Console</h2>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />
Use system debug statements in your Apex code to log the info you need.
<br />
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnZ0ewiLSSHFBej1JR6l9hNfnEGQcjjUlmDZIJLfXj7taT9Nt6nh5_oYCS5rNwI1e5rsQ7HIlCpS7v5IAXlSUWduAXKXEJkRM9pZMhyp99C2cQkf-zk0cI77Fmu8uQyg4CALsrrW5MQb2h/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> system.debug('results ' + results);
</code></pre>
<br />
<br />
Open up the page and execute the behavior you are trying to monitor using system debug statements.<br />
<br />
Choose the Logs tab at the bottom of the console and double-click the most recent log for the page you are monitoring. <br />
<br />
i.e. apex/yourpage<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqhlo0JQhJ-AIWAL3RNXQtdzxvHIe4tnaO4w0sJr7JxqHMXPTdP_K_tEmxoKczCeeQqS3-ZuufeC_LV6JsdMLU1tQEuf-M5batj1yo772HzrZFb6E4EC0yYSpTewqPFGJh5ZNIBD5Fqn4/s1600/logs+tab.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Select Apex log file" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqhlo0JQhJ-AIWAL3RNXQtdzxvHIe4tnaO4w0sJr7JxqHMXPTdP_K_tEmxoKczCeeQqS3-ZuufeC_LV6JsdMLU1tQEuf-M5batj1yo772HzrZFb6E4EC0yYSpTewqPFGJh5ZNIBD5Fqn4/s1600/logs+tab.png" title="Select Apex log file" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Select the Logs tab and open your log file</td></tr>
</tbody></table>
<br />
Once the log is open you can either check the "DEBUG ONLY" checkbox or check the "Filter" checkbox and filter on the string "USER_DEBUG" or any custom string you are searching for specifically. Both options are at the bottom of the console.<br />
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU9o1QeDUe4j2C8DLVQ5bjhBNq1xXiOS2-gBKaY1cLRtT27wY57_3oMpFX8_youvaz1EwsjU1BvCxuDx220WATgYb2nggFIZ7MeSLH_HJFn57igw_H899Nyrehn7W-psJLmMMoT3DYFnk/s1600/User_debug.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Filter for USER_DEBUG events" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU9o1QeDUe4j2C8DLVQ5bjhBNq1xXiOS2-gBKaY1cLRtT27wY57_3oMpFX8_youvaz1EwsjU1BvCxuDx220WATgYb2nggFIZ7MeSLH_HJFn57igw_H899Nyrehn7W-psJLmMMoT3DYFnk/s1600/User_debug.PNG" title="Filter for USER_DEBUG events" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Set the Filter to only display items containing "USER_DEBUG"</td></tr>
</tbody></table>
<br />
<h3>
Viewing logs in the browser in your Salesforce Instance</h3>
<br />
If you are having trouble opening the logs in the Developer Console you can open the logs in a regular browser window.<br />
<br />
Go to your Salesforce instance and click "Setup" in the top right corner<br />
<br />
Then on the left hand menu, at the bottom click on debug logs:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHH-MsaCX6aBTBehNLMFSbm18SayCGBBsOBYE0LBT7FK4pDzaTN6G7SA-g4HeAQD3Y_fRZyoYX-K5c2Vwxe_pUWmq0q1BVkT8ZY-WM7Hf2TFugO0zqlJDRydiSV9rlmWEuWSk61RmsVi0/s1600/view-logs-in-browser.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="View logs in a browser on your Salesforce instance" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHH-MsaCX6aBTBehNLMFSbm18SayCGBBsOBYE0LBT7FK4pDzaTN6G7SA-g4HeAQD3Y_fRZyoYX-K5c2Vwxe_pUWmq0q1BVkT8ZY-WM7Hf2TFugO0zqlJDRydiSV9rlmWEuWSk61RmsVi0/s1600/view-logs-in-browser.png" title="Viewing logs in a browser" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">View logs in your Salesforce Instance</td></tr>
</tbody></table>
<br />
Then select the appropiate log, click view or download and you can manually search for DEBUG statements using the find command(ctrl+f).<br />
<br />
<br />
<a href="http://www.blogcatalog.com/blogs/coding-development-solutions-other-stuff" title="Software Development Blogs - BlogCatalog Blog Directory"><img alt="Software Development Blogs - BlogCatalog Blog Directory" src="http://www.blogcatalog.com/images/buttons/blogcatalog_seal_125.png" style="border: 0;" /></a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6244930388325813354.post-2448678310584070332014-05-01T12:32:00.001-04:002015-09-17T18:11:34.298-04:00Getting Started with Apex Development on the Salesforce Force.com Platform using the Force.com IDE<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br />
</span></div>
<div>
<h2>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Getting Started with Apex Development on the Salesforce Force.com Platform using the Force.com IDE</span></h2>
</div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Below I will describe the steps to getting started using the SFDC plugin in Eclipse to start developing custom Apex classes and Visualforce pages for Salesforce. This guide does not focus on configuration or "click" based development.</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">You may prefer to use the built-in developer console instead of the Eclipse IDE.</span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br />
</span><br />
<h3>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Download and Install the Eclipse IDE</span></h3>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br />
<br />
Latest version of Eclipse as of 4/25/2014: <a href="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/kepler/SR2/eclipse-standard-kepler-SR2-win32-x86_64.zip&mirror_id=337">Eclipse Standard 4.3.2 for Windows 64 bit</a></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br />
<br />
Download Page: <a href="http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br />
</span><br />
<h3>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Install the Force.com Plugin for Eclipse</span></h3>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 17px;"><br /></span></span></div>
<ol style="background-color: white; color: #333333; font-size: 15px; line-height: 17px; margin: 0px 0px 10px 25px; padding: 0px;">
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">From the top menu, Click <b style="color: #222222;">Help > Install New Software</b>
</span>
<dl style="margin-bottom: 20px;">
<dt style="font-weight: bold; margin: 10px 0px;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span><div class="center" style="font-weight: normal; text-align: center; word-wrap: break-word;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4vvbXxOG_CsMCWJmG_3bqNrB3g5lMlCcTCmTuv_y088bXrAEOc0t5iKOQQVklmF_vmQ60LTwpClvQPA_THSwMp2lbI3sh4Y5dMt8HAqU2vG-7rzJzD-Bv4xqUYIwHjMxV1TXj39282u8/s1600/install+new+software+eclipse+.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><img alt="Eclipse Force.com IDE install new software" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4vvbXxOG_CsMCWJmG_3bqNrB3g5lMlCcTCmTuv_y088bXrAEOc0t5iKOQQVklmF_vmQ60LTwpClvQPA_THSwMp2lbI3sh4Y5dMt8HAqU2vG-7rzJzD-Bv4xqUYIwHjMxV1TXj39282u8/s1600/install+new+software+eclipse+.png" title="Navigate to Eclipse Force.com IDE install new software" /></span></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Install the Force.com Plugin</span></td></tr>
</tbody></table>
<div class="floatnone" style="word-wrap: break-word;">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
</div>
</dt>
</dl>
</li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Click <b style="color: #222222;">Add</b></span></li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Under the <b style="color: #222222;">Add Repository</b> message</span></li>
<ul>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Set the <b style="color: #222222;">Name</b> to "Force.com IDE" and </span></li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="color: #222222;">Set</span><b style="color: #222222;"> the Location</b> to "<a class="external free" href="http://media.developerforce.com/force-ide/eclipse42" rel="nofollow" style="color: #048ec6; text-decoration: none;">http://media.developerforce.com/force-ide/eclipse42</a>" then click <b style="color: #222222;">OK</b></span></li>
</ul>
<li>
<dl style="margin-bottom: 20px;">
<dt style="font-weight: bold; margin: 10px 0px;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span><div class="center" style="font-weight: normal; text-align: center; word-wrap: break-word;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXeIaDNmYhQtXEFQ2Pqic0U3ywr-92P1rdvFcjdAZzuo9V8G4xeAc5mzMFM5FvDB-ZhOBdRqAIXPLwhhoj6ZDPS5nOvpl1B-SdmlqXxZnwcCgPAR92FDJyT4jPDdZ45TpAIxuCT8yLD3A/s1600/Eclipse42_addrepository+.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><img alt="Eclipse Force.com IDE Repo Location" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXeIaDNmYhQtXEFQ2Pqic0U3ywr-92P1rdvFcjdAZzuo9V8G4xeAc5mzMFM5FvDB-ZhOBdRqAIXPLwhhoj6ZDPS5nOvpl1B-SdmlqXxZnwcCgPAR92FDJyT4jPDdZ45TpAIxuCT8yLD3A/s1600/Eclipse42_addrepository+.png" title="Force.com IDE Repo Location" /></span></a></td></tr>
<tr><td class="tr-caption"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Add the Force.com Plugin repo location</span></td></tr>
</tbody></table>
<div class="floatnone" style="word-wrap: break-word;">
</div>
</div>
</dt>
</dl>
</li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Eclipse will download the list of all available plugins.</span></li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Check the box for the Force.com IDE plugin and then click <b style="color: #222222;">Next</b>.
</span>
<dl style="margin-bottom: 20px;">
<dt style="font-weight: bold; margin: 10px 0px;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span><div class="center" style="font-weight: normal; text-align: center; word-wrap: break-word;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWhS7kGFwiYGPzCI-mU-mbnXkLSJWkUa8L6LV1GnNE6VJMfkcy2uxhGBAx9yuLV06QkmUb6tE1CrYw2Ekoj8BcjEWy4V_QMqN5i856LqUTKRFO_57ijmE-lefR3PnLocs3L8vErcl0LNA/s1600/Eclipse42_select+force.com+IDE+plugin+.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><img alt="Force.com IDE Plugin download" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWhS7kGFwiYGPzCI-mU-mbnXkLSJWkUa8L6LV1GnNE6VJMfkcy2uxhGBAx9yuLV06QkmUb6tE1CrYw2Ekoj8BcjEWy4V_QMqN5i856LqUTKRFO_57ijmE-lefR3PnLocs3L8vErcl0LNA/s1600/Eclipse42_select+force.com+IDE+plugin+.png" title="Force.com IDE Plugin" /></span></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Download the Force.com plugin for the Eclipse IDE</span></td></tr>
</tbody></table>
<div class="floatnone" style="word-wrap: break-word;">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
</div>
</dt>
</dl>
</li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Within the <b style="color: #222222;">Install Details</b> dialog, click <b style="color: #222222;">Next</b>.</span></li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">In the <b style="color: #222222;">Review Licenses</b> dialog, click accept to the terms then click <b style="color: #222222;">Finish</b>.</span></li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Eclipse will then download and install the Force.com IDE and any required dependencies. After installation is complete, you will be prompted to restart the IDE. Click on <b style="color: #222222;">Yes</b>.</span></li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Select <b style="color: #222222;">Window > Open Perspective > Other</b>, select <b style="color: #222222;">Force.com</b> and click <b style="color: #222222;">OK</b>. </span></li>
</ol>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 17px;"><br /></span></span></div>
<h4>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 17px;">Additional info on the Force.com IDE</span></span></h4>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 17px;">More in-depth info</span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 17px;"><a href="https://developer.salesforce.com/page/An_Introduction_to_Force_IDE">https://developer.salesforce.com/page/An_Introduction_to_Force_IDE</a></span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><a href="https://developer.salesforce.com/page/Force.com_IDE_FAQ">https://developer.salesforce.com/page/Force.com_IDE_FAQ</a></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<h3>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Sign up for a salesforce developer account</span></h3>
</div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">You will need a developer org to begin development applications.</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<br />
<ul>
<li><span style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;">Sign up here: </span><a href="https://developer.salesforce.com/signup" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;">https://developer.salesforce.com/signup</a></li>
</ul>
<ul>
<li><span style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;">Activate and login to your account: </span><a href="https://login.salesforce.com/" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;">https://login.salesforce.com</a></li>
</ul>
</div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<h3>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Read up on the Force.com platform and the Apex Language</span></h3>
</div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<b><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Workbooks</span></b><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br />Various Helpful Tutorials and workbooks</span><br />
<ul>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Get started with Force.com as a platform: <a href="https://developer.salesforce.com/docs/atlas.en-us.workbook.meta/workbook/workshops_intro.htm">Force.com Workbook</a></span></li>
</ul>
<ul>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Get started with the Apex language: <a href="http://www.salesforce.com/us/developer/docs/apex_workbook/apex_workbook.pdf">PDF Apex Workbook</a></span></li>
</ul>
<ul>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">All Downloadable Developer Workbooks: <a href="https://developer.salesforce.com/page/Force.com_workbook">Developer Workbooks</a></span></li>
</ul>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<b><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Online Interactive Courses</span></b></div>
<ul>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Free online cources on Salesforce at Udacity: <a href="http://udacity.com/salesforce">http://udacity.com/salesforce</a></span></li>
</ul>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<b><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Regular Webinars host by Salesforce personnel </span></b></div>
<ul>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Force.com Fridays half-hour webinars: <a href="https://developer.salesforce.com/en/events/webinars/forcedotcomfridayreg">Weekly Webinars</a></span></li>
</ul>
<ul>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Archived intro video webinars on Youtube: <a href="https://www.youtube.com/playlist?list=PLF5C1A684ED0DD117">Youtube Force.com and Apex Webinars</a></span></li>
</ul>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><b><br /></b><b>More In-depth Apex Learning Resources for more Advanced Techniques</b></span><br />
<ul>
<li><span style="color: #048ec6; font-family: Helvetica Neue, Arial, Helvetica, sans-serif; text-decoration: none;"><span style="color: black;">Apex Quickstart: </span><a class="external text" href="http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content%2Fapex_qs.htm" rel="nofollow" style="color: #048ec6; text-decoration: none;">Apex Code Quick Start</a></span></li>
<li><span style="color: #048ec6; font-family: Helvetica Neue, Arial, Helvetica, sans-serif; text-decoration: none;"><span style="color: black;">Intro to common Apex Concepts and Terms: </span><a class="external text" href="http://wiki.developerforce.com/page/An_Introduction_to_Apex" rel="nofollow" style="color: #048ec6; text-decoration: none;">An Introduction to Force.com Apex Code</a></span></li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Apex Training Course <a class="external text" href="https://itunes.apple.com/us/podcast/apex-programming-on-force.com/id628041149" rel="nofollow" style="color: #048ec6; text-decoration: none;">"Apex Programming on the Force.com Platform"</a></span></li>
<li><a class="external text" href="http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_connectapi_quickstart.htm" rel="nofollow" style="color: #048ec6; text-decoration: none;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Chatter in Apex Quick Start</span></a></li>
<li><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Intro-Level Apex Code Dreamforce Sessions:</span><ul>
<li><a class="external text" href="http://www.youtube.com/watch?v=OKKaDr-tW-g&list=PL0344301382C4042E&index=52&feature=plpp_video" rel="nofollow" style="color: #048ec6; text-decoration: none;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Introduction to Programming with Force.com Apex Code</span></a></li>
<li><a class="external text" href="http://youtu.be/Ul17dsrMoaU" rel="nofollow" style="color: #048ec6; text-decoration: none;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Hands-On: Introduction to Force.com Code (Apex) for Non-Developers</span></a></li>
<li><span style="color: #048ec6; font-family: Helvetica Neue, Arial, Helvetica, sans-serif; text-decoration: none;"><a class="external text" href="http://www.youtube.com/watch?v=Js00YUpJAjs&list=PL0344301382C4042E&index=38&feature=plpp_video" rel="nofollow" style="color: #048ec6; text-decoration: none;">Hands-On: Introduction to Force.com Apex Code Patterns for Developers</a></span></li>
</ul>
</li>
<li><a class="external text" href="https://na1.salesforce.com/help/doc/en/salesforce_apex_developer_cheatsheet.pdf" rel="nofollow" style="color: #048ec6; text-decoration: none;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Apex Code Cheat Sheet</span></a></li>
</ul>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br />
</span><br />
<h3>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Configure your IDE environment</span></h3>
</div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br />
<br />
<b>Select the Force.com perspective </b></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2xPgyOmS_LUYh_ox0wSLNTAsBiuvpPOKRNwdLQb9yEA9smbl8ilK-uqf_mpjAv8mkJU2hwkTyeYT-k5Q0LjMYVqTcQdjCslf8nRxcC2Pl2dxx6tqJIh0IgG8P04N6eug7JHqtiDaY8V0/s1600/forceidepers.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><img alt="Open Force.com IDE perspective" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2xPgyOmS_LUYh_ox0wSLNTAsBiuvpPOKRNwdLQb9yEA9smbl8ilK-uqf_mpjAv8mkJU2hwkTyeYT-k5Q0LjMYVqTcQdjCslf8nRxcC2Pl2dxx6tqJIh0IgG8P04N6eug7JHqtiDaY8V0/s1600/forceidepers.PNG" title="Open Force.com IDE perspective" /></span></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Select the Force.com Perspective</span></td></tr>
</tbody></table>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><b>Create a new Force.com Project in Eclipse</b></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br />
<br />
</span><br />
<div class="p" id="task_intro">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Launch the <span class="resultofText" name="resultofMatch">Force.com</span> <span class="resultofText" name="resultofMatch">Project</span> wizard, select <span class="ph menucascade"><strong class="ph uicontrol">File</strong> | <strong class="ph uicontrol"><span class="resultofText" name="resultofMatch">New</span></strong> | <strong class="ph uicontrol"><span class="resultofText" name="resultofMatch">Force.com</span> <span class="resultofText" name="resultofMatch">Project</span></strong></span>.</span></div>
<div class="p" id="task_intro">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<br />
<ul><span style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;">
<li>On the first page, enter the appropriate properties for the <span class="resultofText" name="resultofMatch">project</span>. Enter the salesforce login from your developer account.</li>
</span></ul>
<span style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;">
</span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<table cellpadding="4" cellspacing="0" class="featureTable" summary=""><tbody class="tbody">
<tr class="row"><td class="entry" colspan="1" headers="d8501217e60" rowspan="1" valign="top"><strong class="ph uicontrol"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Project Name</span></strong></td><td class="entry" colspan="1" headers="d8501217e63" rowspan="1" valign="top"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Required. A project is associated with one organization. Project names must be unique. You can create more than one project that connects to the same organization, but they cannot have the same project name.</span></td></tr>
<tr class="row"><td class="entry" colspan="1" headers="d8501217e60" rowspan="1" valign="top"><strong class="ph uicontrol"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Username</span></strong></td><td class="entry" colspan="1" headers="d8501217e63" rowspan="1" valign="top"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Required. The username you use to log in to the organization associated with this project (“home organization”).The username associated with this connection must have the “Modify All Data” permission. Typically, this is only enabled for System Administrator users. </span></td></tr>
<tr class="row"><td class="entry" colspan="1" headers="d8501217e60" rowspan="1" valign="top"><strong class="ph uicontrol"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Password</span></strong></td><td class="entry" colspan="1" headers="d8501217e63" rowspan="1" valign="top"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Required. The password for the specified username.</span></td></tr>
<tr class="row"><td class="entry" colspan="1" headers="d8501217e60" rowspan="1" valign="top"><strong class="ph uicontrol"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Security Token</span></strong></td><td class="entry" colspan="1" headers="d8501217e63" rowspan="1" valign="top"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">The security token is appended to your password as an added security measure. If you are using a security token, enter the value here. For more information, see the <span class="ph">Salesforce</span> online help topic <span class="ph">Setting Login Restrictions</span>.</span><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglojZBTf3tuct9STn6ol6CNPfhaFx7I74o5hyphenhyphenqX5DXHXTKbrZ-DOHE32dBZKvczExhXWnQ3BYH6LNg-SXowKGPQZwWahH1pwyBASZAjobSoPYN34WIR3HI5TpaciqfwQEtzpZRo0DQdBk/s1600/Reset+My+Security+Token+++salesforce.com+++Developer+Edition.png" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><img alt="Get security token from salesforce" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglojZBTf3tuct9STn6ol6CNPfhaFx7I74o5hyphenhyphenqX5DXHXTKbrZ-DOHE32dBZKvczExhXWnQ3BYH6LNg-SXowKGPQZwWahH1pwyBASZAjobSoPYN34WIR3HI5TpaciqfwQEtzpZRo0DQdBk/s1600/Reset+My+Security+Token+++salesforce.com+++Developer+Edition.png" title="Get security token from salesforce" /></span></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Get your security token from your Salesforce control panel</span></td></tr>
</tbody></table>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></td></tr>
<tr class="row"><td class="entry" colspan="1" headers="d8501217e60" rowspan="1" valign="top"><strong class="ph uicontrol"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Environment</span></strong></td><td class="entry" colspan="1" headers="d8501217e63" rowspan="1" valign="top"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Required. Choose the appropriate environment for your connection:</span><br />
<ul class="ul">
<li class="li"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Production/Developer Edition - Choose this option if you are connecting to a production or Developer Edition organization.</span></li>
<li class="li"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Sandbox - Choose this option if you are connecting to a sandbox organization. Sandbox organizations have an URL that starts with <samp class="ph codeph">test</samp>.</span></li>
<li class="li"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Pre-Release - Choose this option if you are connecting to a prerelease server.</span></li>
<li class="li"><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Other (Specify) - Choose this option if you want to connect to a specific instance.</span></li>
</ul>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span></div>
</td></tr>
</tbody></table>
</div>
</div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Click <b>Finish</b> to create the project.</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><b>Moving forward, you will want to move on to configuring your SFDC org and create some custom objects, custom settings, sites and other objects in your Salesforce org and start customizing them. The best way to go about this is to go through the workbooks. </b></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">List of All Downloadable Workbooks: <a href="https://developer.salesforce.com/page/Force.com_workbook">Developer Workbooks</a></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">How to Create a new app and custom objects: <a href="http://www.salesforce.com/us/developer/docs/workbook/">Work through this online workbook</a></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span><span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Intro to Force.com Sites</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><a href="https://developer.salesforce.com/page/An_Introduction_to_Force.com_Sites">https://developer.salesforce.com/page/An_Introduction_to_Force.com_Sites</a></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">More on visualforce:</span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><a href="https://developer.salesforce.com/page/An_Introduction_to_Visualforce">https://developer.salesforce.com/page/An_Introduction_to_Visualforce</a></span><br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><br /></span>
<a href="http://www.blogcatalog.com/blogs/coding-development-solutions-other-stuff" title="Software Development Blogs - BlogCatalog Blog Directory"><img alt="Software Development Blogs - BlogCatalog Blog Directory" src="http://www.blogcatalog.com/images/buttons/blogcatalog_seal_125.png" style="border: 0;" /></a>Unknownnoreply@blogger.com0