27 Kasım 2012 Salı

JIRA REST API - Updating Status

You can change a status with executing the transition.

  • You should give the transition id. "{transition\": {\"id\": \"61\"}"
  • The url should be :  "http://localhost:8080/rest/api/2/issue/TAI-39/transitions?expand=transitions.fields" SElect the issue that you want to update.
  • You shoul use "POST"
  • Here is the curl command: curl -D- -X POST -H "Authorization: Basic YWRtaW46SDF0MXQ=" --data "{\"transition\": {\"id\": \"81\"}}" -H "Content-Type: application/json" "http://localhost:8080/rest/api/2/issue/TAI-39/transitions?expand=transitions.fields"
  • Here is the java implementation:          
  •                                                                
    public static String httpGet() throws IOException {         
    URL url = new URL("http://localhost:8080/rest/api/2/issue/TAI-39/transitions?expand=transitions.fields");         
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();  
    conn.setDoOutput(true);         
    conn.setDoInput(true);                 
    String credentials = "username" + ":" + "password";        
     String encoding = Base64Converter.encode(credentials.getBytes("UTF-8"));   
    conn.setRequestProperty("Authorization", String.format("Basic %s", encoding));  
    conn.setRequestMethod("POST"); 
    conn.setRequestProperty("Content-Type", "application/json");    
      conn.connect();                  
     String st = "{\"transition\": {\"id\": \"91\"}}";    
     System.out.println(st);      
      byte[] outputBytes = st.getBytes("UTF-8");     
     OutputStream os = conn.getOutputStream();  
    BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));        
     StringBuilder sb = new StringBuilder();        
     String line;         
    while ((line = rd.readLine()) != null) {           
    sb.append(line);         
    }         
    rd.close();             
    conn.disconnect();        
    System.out.println("sb: "+ sb.toString());         
    return sb.toString();     
    }

JIRA REST API - Edit Issues


  • When you want to update a field with JIRA REST API, first write it i json format.  Ex: I want to update the summary of an issue.        
  • {"fields": {"summary":{"name":"bahar"}}}
  •  You can try it with curl commant whether it works or not.
  •   curl -D- -X PUT -H "Authorization: Basic YWRtaW46SDF0MXQ=" --data "{\"fields\":{\"summary\":\"bahar\"}}"   -H "Content-Type: application/json" "http://localhost:8080/rest/api/2/issue/TAI-9"
  •  You should use PUT for updating.
  • Don't forget to add "\" backslash  before the double quotes.
  • You should encode your username:password with base 64 encode.
  • encoder 
  • write your username:password, and the output will be "YWRtaW46SDF0MXQ= " something like this. Write the output to the authorization. 
  • Ex: "Authorization: Basic YWRtaW46SDF0MXQ="  
  • "http://localhost:8080/rest/api/2/issue/TAI-9" is the issue that you want to update.
  •   You can do the same thing with java code.Here is the method:   
     public static String updateSummary() throws IOException {
     
        URL url = new URL("http://localhost:8080/rest/api/2/issue/TAI-9");
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setDoOutput(true);
        conn.setDoInput(true);

        String credentials = "username" + ":" + "password";
        String encoding = Base64Converter.encode(credentials.getBytes("UTF-8"));
        conn.setRequestProperty("Authorization", String.format("Basic %s", encoding));
       
        conn.setRequestMethod("PUT");
        conn.setRequestProperty("Content-Type", "application/json");
       
        conn.connect();
      
        String st="{\"fields\":{\"summary\":\"bahar\"}}"

        byte[] outputBytes = st.getBytes("UTF-8");
        OutputStream os = conn.getOutputStream();
        os.write(outputBytes);
        os.flush();
       
        BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        StringBuilder sb = new StringBuilder();
        String line;
        while ((line = rd.readLine()) != null) {
          sb.append(line);
        }
        rd.close();

        conn.disconnect();
        return sb.toString();

    }                                                                                                                               

  • you can use Base64Convertor.java class. Download
  • Here is the atlassian documentation for updating issue via JIRA REST API. atlassian

8 Kasım 2012 Perşembe

JIRA - Create Custom Fields with Code

You can automatically create custom fields with code within your plugin for JIRA.
Here is an  example method to do this. This method creates four custom fields.

public void createAllCustomFields(){
        CustomFieldType fieldType = customFieldManager.getCustomFieldType("com.atlassian.jira.plugin.system.customfieldtypes:textfield");
        try {
            CustomField contactName = customFieldManager.createCustomField("Contact Name", "Name of the contact", fieldType , null, null, null);
            customFieldManager.createCustomField("Contact Surname", "Surname of the contact", fieldType , null, null, null);
            customFieldManager.createCustomField("Contact Phone", "Phone number of the contact", fieldType , null, null, null);
            customFieldManager.createCustomField("Contact Email", "Email address of the contact", fieldType , null, null, null);
        } catch (GenericEntityException e) {
       
            e.printStackTrace();
        }
        System.out.println("createAllCustomFields is called !!!!!!!!!!!!!!!!!!!!!");
    }

Plugin Development Tips


2 Kasım 2012 Cuma

Create some marketing materials












 
 plugin logo














A plugin logo that is a 72x72px PNG/JPG/GIF image. Atlassian strongly recommends a chiclet-style background for the logo (check out this free Photoshop template). This format works best with upcoming changes to the user interfaces of UPM and the Atlassian Marketplace.
plugin icon The plugin icon that is a 16x16px PNG/JPG/GIF pixel version of your plugin logo or an appropriate derivation of it.
banner

Currently, UPM 2.0 does not display banners but later versions will. Moreover, a banner is required by the Atlassian Marketplace. So, since ArfX's functionality (nothing really) is likely to work in future versions of both JIRA and UPM, this example adds a banner to show up when the software supports it. 

Here is how to add it to your plugin

Plugin Metadata Files used by UPM and Marketplace


Velocity Guide

Velocity is a Java-based template engine. It permits web page designers to reference methods defined in Java code. Web designers can work in parallel with Java programmers to develop web sites according to the Model-View-Controller (MVC) model, meaning that web page designers can focus solely on creating a well-designed site, and programmers can focus solely on writing top-notch code. Velocity separates Java code from the web pages, making the web site more maintainable over the long run and providing a viable alternative to JSPs.

Velocity - Guide

<HTML>
<BODY>
Hello $customer.Name!
<table>
#foreach( $mud in $mudsOnSpecial )
   #if ( $customer.hasPurchased($mud) )
      <tr>
        <td>
          $flogger.getPromo( $mud )
        </td>
      </tr>
   #end
#end
</table>

1 Kasım 2012 Perşembe

Reusing the configurations in each run

Suppose you added some data on to virtual JIRA, how do you retain it when you clean start-up JIRA next time?
This is where a new SDK command comes to our rescue.
After the atlas-run is finished, that is, after you pressed Ctrl + C, execute the following command:
atlas-create-home-zip
This will generate a file named generated-test-resources.zip under the target folder.
Copy this file to the /src/test/resources folder or any other known locations. Now modify the pom.xml to add the following entry under configurations in the maven-jira-plugin:
<productDataPath>${basedir}/src/test/resources/generated-test-
resources.zip</productDataPath>

Modify the path accordingly. This will reuse the configurations the next time you run
atlas-run.

13 Eylül 2012 Perşembe

Confluence Increase Maximum Heap Size


You can only view Maximum Heap Size  from Confluence > Administration > System Information.

To Edit:

Do not set your memory using CATALINA_OPTS this is overridden by JAVA_OPTS.
On Linux
  • In the unpacked Confluence standalone directory, edit the file bin/setenv.sh
  • Edit the line beginning with JAVA_OPTS= substituting new values for -Xms (starting memory) and -Xmx (maximum memory)
  • Leave the rest of the options in that line unchanged
An example of a minimal setting for a large system - max heap size is set to 1Gb :
JAVA_OPTS="-Xmx1024m $JAVA_OPTS -Djava.awt.headless=true "

Reference

FishEye Upgrade Guide


1. Download Fisheye
2. Extract the new FishEye archive into a directory such as <New FishEye home directory>.
3. Shut down the old FishEye instance if it is running.
4. Copy <FishEye home directory>/config.xml to <New FishEye home directory>.
5. Copy  the <FishEye home directory>/var directory to <New FishEye home directory>/var.
6. Copy the <FishEye home directory>/cache directory to <New FishEye home directory>/cache.
7. Start FishEye from the new installation by running <New FishEye home directory>/bin/run.sh.

linux commands:

wget -c http://www.atlassian.com/software/fisheye/downloads/binary/fisheye-2.8.0.zip

unzip fisheye-2.8.0.zip

<FishEye home directory>/bin ./stop.sh

cp <FishEye home directory>/config.xml <New FishEye home directory>/config.xml

<New FishEye home directory> rm -rf var

<New FishEye home directory> mkdir var

cp <FishEye home directory>/var/* <New FishEye home directory>/var/*

<New FishEye home directory> mkdir cache

cp <FishEye home directory>/cache/* <New FishEye home directory>/cache/*

<New FishEye home directory>/bin ./run.sh

Go to your fisheye 2.8, ex: http://localhost:8060/

12 Eylül 2012 Çarşamba

'java.sql.SQLException Got error 28 from storage engine' Error when Viewing a Page

Symptoms:

Viewing a page fails with this stack trace found in the atlassian-confluence.log:
...
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Could not execute query; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1030]; Got error 28 from storage engine; nested exception is java.sql.SQLException: Got error 28 from storage engine
Caused by: java.sql.SQLException: Got error 28 from storage engine
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1072)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3563)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3495)
...
Cause:

MySQL database server has no space left to work in its tmp directory.
Resolution:

Verify whether there is sufficient disk space on the MySQL database server.

Reference

30 new and updated Confluence tutorials



We now have 11 new and 19 updated Confluence tutorials – a great resource for plugin developers, nicely timed with the release of Confluence 4.3.
New Confluence tutorials:

Working with the Tasks REST API in Confluence

Sending Emails in a Plugin

Posting notifications in Confluence

Preformatted Table – Example of a User Macro

Panel Preformatted with Specific Colours – Example of a User Macro

Adding an Option to the Editor Insert Menu

Adding Keyboard Shortcuts to Confluence

Writing Integration Tests for your Plugin (to be published after review)

Altering Confluence page output using a Pipeline Transformer module (to be published after completion, some time in October)

Writing Soy Templates (to be published after review)

Defining a Pluggable Service in a Confluence Plugin (to be published after completion, some time in September)

Updated Confluence tutorials:

Extending Autoconvert

Adding Menu Items to Confluence

Creating a Cross-Platform Admin Configuration Form

Writing Macros for pre-4.0 versions of Confluence

Preventing XSS issues with macros in Confluence 4.0

Creating a new Confluence Macro

Extending the Macro Property Panel

Writing a Confluence Theme

Writing Unit Tests for your Plugin

Writing a Macro Using JSON

Developing Technical Documentation on Confluence Wiki

Developing a Knowledge Base on Confluence Wiki

Searching using the V2 Search API (in progress)

Writing a search result renderer (in progress)

Adding a Custom Action to Confluence (to be published after review)




11 Eylül 2012 Salı

confluence suddenly unusable -- java error

System Error
A system error has occurred — our apologies!
For immediate troubleshooting, consult our knowledge base for a solution.
If you would like to receive support from Atlassian's support team, ask your Confluence administrator to create a support issue on Atlassian's support system with the following information:
a description of your problem and what you were doing at the time it occurred
a copy of the error and system information found below
a copy of the application logs (if possible).
Your Confluence administrator can use the support request form to create a support ticket which will include this information.
We will respond as promptly as possible.
Thank you!
Return to site homepage…
The SystemInformationService could not be retrieved from the container. Therefore very limited information is available in this error report.
The SystemInformationService could not be retrieved due to the following error: java.lang.NullPointerException
Cause
com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:152)
caused by: java.lang.NullPointerException
at com.atlassian.spring.container.ContainerManager.getComponent(ContainerManager.java:33)

If you get this error message, permission error may cause this error.
To solve it,
1. Go to your confluence home directory
2. list all items with ls -al

testwww1:/usr/local/confluence-data# ls -al
total 152
drwx--S---  19 confluence confluence  4096 2012-08-20 10:27
(...)
drwxr-sr-x   2 root       confluence  4096 2012-07-10 15:41 plugins-cache

3. Then, (Our) Confluence is running with confluence user, so permissions were wrong (without writing for group). When I changed owner with:

chown -R confluence:confluence confluence
chown -R confluence:confluence confluence-data
 and restarted Confluence with
/etc/init.d/confluence restart
 it raised up and is working. Hope you will find it useful :)

4 Eylül 2012 Salı

How to add a facebook like button in a Confluence page?

1. You should create the code from the facebook developers' page for the page that you want to like.

          http://developers.facebook.com/docs/reference/plugins/like/


















2. Copy the generated code.
3. Create a confluence page or open editing for an existing one. Add a html-include macro.
4. Paste the copied code into it, and save the page.







5. Here it is!






Similiarly, you can add twitter follow button.

https://twitter.com/about/resources/buttons


31 Ağustos 2012 Cuma

Confluence - Enabling the html-include Macro

By default, the HTML macros are disabled. You should only turn on these macros if you trust all your users not to attempt to exploit them.


(info) You need to have System Administrator permissions in order to perform this function. 
To enable the HTML macros,
  1. Choose Browse > Confluence Admin.
  2. Select 'Plugins' in the left-hand panel. This will display the installed plugins active for this Confluence installation.
  3. Click' 'HTML macros', then click 'Enable Plugin'.

To embed an external page,
Use the following syntax:
{html-include:url=http://www.example.com}



29 Ağustos 2012 Çarşamba

Confluence Plugin - Business Dictionary (BuDict)



BuDict is used for displaying an information bubble above selected words in Confluence. The information bubble is displayed only when the mouse cursor is over the word, as shown in the next picture. This bubble includes an explanation or other specified text for the marked words (investment).










Budict manual 4.0 EN

marketplace

Upgrading Confluence on Linux









  1. Download the appropriate Confluence 'Linux 64-bit / 32-bit Installer' (.bin) file that suits your operating system (for the new version of Confluence) from the Confluence Download Center.
  2. Open a Linux console and change directory (cd) to the '.bin' file's directory.
    If the '.bin' file is not executable after downloading it, make it executable, for example:
    chmod a+x atlassian-confluence-X.Y.bin
    (where X.Y represents your version of Confluence)
  3. Execute the '.bin' file to start the upgrade wizard.
  4. When prompted to choose between creating a new Confluence installation or upgrading an existing installation, choose the 'Upgrade an existing Confluence installation' option.


16 Ağustos 2012 Perşembe

El Altı Notları

Çok unutkan oldum bugünlerde herşeyi unutuyorum ne yapmak lazım bu durumda herşeyi yazmak lazım :)


1. Connect Server with SSH (Mac/Linux)
Copy .PEM file to the machine from which you are going to connect.
Make sure permissions on .PEM file are appropriate (chmod 600 file.pem)
Connect with ssh command: ssh vcloud@ipaddress –i privkey.pem

2. Find Folder Command in Linux

find / -name 'httpdocs' -type d

3. Zip a Folder in Linux

zip -9 -r zip file folder name

4. Delete Non-empty Folder in Linux

rm -rf folder/

5. Creates new JAR (Java Archive) file named Project1.jar, compresses and stores Project1 directory and all its contents (including both data files and subdirectories).

jar cf Project1.jar Project1


6. Jar file in Linux

jar xf

7. How to Unzip Over an Existing Directory in Linux

Read more: How to Unzip Over an Existing Directory in Linux

unzip -o filename.zip -d dir

8. If it’s available a ssh access on the servers, using scp to transfer file from and to the server could be a very good option.



scp /localdir/localfilename.txt remoteuser@www.remotehost.com:/remotedir/remotefilename.txt

9. Wget is one of the powerful tools available there to download stuff from internet. You can do a lot of things using wget. Basic use is to download files from internet.

wget -c http://your-link-to/file



9 Ağustos 2012 Perşembe

JIRA Workflow Sharing Plugin

The JIRA Workflow Sharing Plugin enables sharing of workflows across JIRA instances.

The plugin allows JIRA administrators to export or import workflows in a zipped "workflow bundle" format.

Exported workflow bundles can be shared with any JIRA instance with little or no manual setup required.

JIRA Workflow Sharing Plugin

JIRA: Is it possible to set issue assignee based on "Issue Type" automatically?

Create separate workflows for each issueType.
Create a workflow scheme for your project mapping those workflows to the specific issueTypes.
Then (in the workflows) using the stock post function "Update Issue Field", set your Assignee field to the desired user for each individual issue type in the "Create" transition.

3 things to note: 1.) To get to the "Create" transition, click on the "Open" step and "Create" should be one of the Incoming Transitions. 2.) When adding the post function, be sure to place it after the "creates issue originally" function or you will get some nasty errors. 3.) Be sure to delete the post function "Assign the issue to the reporter" otherwise your issue will get re-routed to the reporter.

30 Temmuz 2012 Pazartesi

Customising the Dashboard Introduction Gadget

The default jira welcome message in the dashboard introduction gadget is shown in the below image:


To customize it in your jira;

1. Go to Administration > System > General Configuration

2. Click Edit Configuration

3. Paste your html code in the introduction section.

4. Click Udpate.

4. The introduction has changed!





Here is an html example:

<!DOCTYPE html>
<head>
</head>
<body>
</body>
<table>
<tr>
<td><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwLO_gHWG7Vj4Rmbc8lVZe8XiIBwg3LdB5bWzmthyphenhyphen1li-NxW6tdouwK2NqXiPf5_cpUU0LxD2hMDvcJAAaY6kjjcQoO7wYaY8F520p1Gaqzf9mCBAMOwA0BcSUEtZj31R9NaDoYYVcUCDJ/s1600/logo.png" width="250" height="150"/> </td>
<td><h3>Johnson Controls' e Hosgeldiniz</h3>

<p>Johnson Controls, global olarak teknoloji ve 150'den fazla ulkedeki hizmet veren end lideridir.</p></td>
</tr>
</table>

</html>

29 Temmuz 2012 Pazar

Disable the footer content in Confluence

Confluence defines its default footer something like in the below image.



add the stylesheet to the global stylesheet


#footer {
display: none;
}

 and all is fine :-)






23 Temmuz 2012 Pazartesi

Why is adding comments while attaching files so important in Confluence?

First of all, in Confluence adding attachments is very easy. You can drag and drop or
as follows:

To attach a file to a page from the computer's (or network's) file system:

Choose Tools > Attachments.
Choose Browse and navigate to the file.
Select the file and click Open.
Add a descriptive comment for the file (optional).
Choose Attach more files if required.
Choose Attach.

When you view attachments, shown as below:



The name of the attached file may not be enough to tell the content of it. Many times, you create a page, after a while when you view the page & attachments, probably you forget why you added it, etc. Luckily, confluence supports attachment properties (as shown in the above image).

These are:

1. Name
2. Size
3. Creator
4. Creation Date
5. Comment

In the image, only first attachment has a comment, and it is also meaningful for viewers except the creator :) However, there is no way to make comments required for attachments. At least I haven' t found it yet ;)

9 Temmuz 2012 Pazartesi

Groovy Development in JIRA

The task at hand was pretty simple - write a JIRA script to automatically handle e-mails that came in on a certain address, looking at the attachments, and then processing the e-mail as required.  However, with the minimal amount of documentation available on-line, it ended up taking a little bit longer than I had initially expected.  And so, I've decided to document my experiences here so that if anyone in the future needs to do something similar, they'll have at least one resource to look at.


Step 1. ScriptRunner
Due to the foresight of our QA Manager, (thanks man!) our JIRA environment had already been loaded with the Groovy ScriptRunner.  Consequently, I pretty much had the scripting language decided for me.  I set up a development instance of a JIRA server so that I wouldn't disrupt people's actual work while I was testing, and got to work.

Step 2. Working with JIRA Issues in Groovy
Our JIRA system was already set up to create issues based on e-mails delivered to the appropriate address, so now it was a matter of writing a script to process these issues once they came through the system. I knew that I was going to have to work with attachments, as well as add comments, and send e-mails, etc... I also wanted to be able to log information as I was working on the script to JIRA's default catalina.out file, so I went about finding the appropriate methods for accomplishing these things.

After some searching for the correct syntax I determined what I needed in order to manage logging, comments, and attachments:

import org.apache.log4j.Category;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.comments.CommentManager;
import com.atlassian.jira.issue.AttachmentManager;
import com.atlassian.jira.issue.attachment.Attachment;

// Logger

def Category log = Category.getInstance("com.onresolve.jira.groovy.PostFunction");

// Set the logging level to DEBUG

log.setLevel(org.apache.log4j.Level.DEBUG);

// Set up a comment manager and an attachment manager, as we will need to use these for working with the issues

CommentManager comment = ComponentManager.getInstance().getCommentManager();
AttachmentManager attachments = ComponentManager.getInstance().getAttachmentManager();

It turns out that the JIRA libraries have helper classes called CommentManager and AttachmentManager built in to make this process easier, so I set up instances of those objects for later use in the script.
I also wanted to log a debug message to catalina.out every time that I made a comment on the issue so that I could see the progress while I was tailing the file. To make this less of a headache, I created a method to manage this for me:
def doComment(commentManager, logger, issue, currentUser, text) {
  log.debug "Script Processing - ${issue.key} - Adding Comment - ${text}";
  comment.create(issue, currentUser, text, true);
}
Creating a comment requires an instance of the issue that we are working on (which the Groovy script is nice enough to give us with an 'issue' variable) as well as the username creating the comment, and the text of the comment.  I passed these into my method, along with the CommentManager and the Logger which I'd previouly instantiated, and used this method to create all of my comments.
Step 3. Working with Attachments This was probably the most non-intuitive part of the process and the main reason that I decided to write this entry. The first issue that had me scratching my head was this: Attachments in JIRA are not available when the issue is first created. We actually had to work around this process by activating this script when the issue was moved into In Progress as a result - so that I would be able to retrieve the attachments from the issue. Retrieving the list of attachments from the issue turned out to be fairly easy:
List attachments = attachmentManager.getAttachments(issue);

However, when it came to actually reading the contents of the attachment to the issue, the built-in Attachment Object in the JIRA library didn't seem to be of much help.

Methods were provided for finding the author, MIME Type, date created, etc... about the attachment, but nothing about the getting the actual text of the attachment itself.  This, however, was the entire reason that I needed the attachment object - I needed to be able to read the contents of a document attached to the original e-mail, and do the processing based on that.
 Luckily, I was able to find the file location on my development JIRA server where the attachments had been saved.  For example, it appeared that all of my attachments were saved in the following location on my server (this will be different based on which directory you have JIRA installed to, of course):
/usr/jira/data/attachments/

In that location were several directories, one for each of the different projects created on this JIRA instance.  Inside of those directories were more folders for each of the issues that had been created with attachments.  Using this information, I was able to determine the actual file path based on the issue that I was working with. From that point,it was a matter of reading the attachment file into a string and doing the appropriate parsing based on that data.
List attachments = attachmentManager.getAttachments(issue);

if (!attachments.isEmpty()) {
  for (Attachment a in attachments) {
    String filePath = "/usr/jira/data/attachments/PROJECT_ID/" + issue.getKey() + '/' + a.getId();
    def attachmentFile = new File(filePath);
    String attachmentContents = attachmentFile.text;

    // Do regex processing on the attachmentContents to determine what needs to be done
  }
}
Step 4. E-mails The last step of the process was to send an e-mail in cases where the attachment was unable to be parsed, or when some other issue didn't allow us to resolve this issue appropriately. I was able to write a simple method to handle this, using the documentation available on-line:
import com.atlassian.mail.Email;
import com.atlassian.mail.server.MailServerManager;
import com.atlassian.mail.server.SMTPMailServer;

def sendEmail(emailAddr, subject, body) {
  SMTPMailServer mailServer = ComponentManager.getInstance().getMailServerManager().getDefaultSMTPMailServer();

  if (mailServer) {
    Email email = new Email(emailAddr);
    email.setSubject(subject);
    email.setBody(body);
    mailServer.send(email);
  } else {
    // Problem getting the mail server from JIRA configuration, log this error
  }
}
Step 5. Finishing Up
These were the main issues I ran across while writing this script - and, as I mentioned earlier, tutorials on these nuances appear to be nearly non-existent on-line.  Hopefully, if anyone runs into these problems in the future this article will help them through the process.If you're working on JIRA/Groovy development and are looking for some guidance from someone's who has been there, or if you have questions about this tutorial, please feel free to connect with me on this site 
and send me a message, or comment on this blog.  I'm happy to answer anything that I can.

reference

4 Temmuz 2012 Çarşamba

JIRA nedir?


JIRA, projeleriniz içerisinde, belirli bir hayat döngüsü olan iş maddelerinin (issue) oldukça gelişmiş bir şekilde takibinin, yönetiminin ve raporlamasının yapılabilmesine olanak sağlayan, kendi ihtiyaçlarınıza ve kurumsal yapılanmanıza göre değiştirebildiğiniz-düzenleyebildiğiniz, JAVA platformu üzerinde geliştirilmiş web tabanlı güzel bir araç. 

Proje yönetimi içerisinde oldukça önemli bir yer tutan zaman ve kaynak planlaması gibi konular JIRA içerisinde oldukça profesyonel ve genişletilebilir bir altyapı sayesinde yönetilebiliyor.

JIRA'nın en güçlü yanlarından birisi de plugin altyapısı. JIRA uygulamasını kendi ihtiyaçlarınıza göre genişletebiliyor, kendi jira pluginlerinizi yazıp JIRA uygulaması içerisinde kullanabiliyorsunuz.

JIRA ile ilgili ayrıntılı bilgiler için:
http://www.atlassian.com/software/jira/ adresini ziyaret edebilirsiniz.                                   

3 Temmuz 2012 Salı

jQuery Syntax Examples


jQuery is a JavaScript Library.
jQuery greatly simplifies JavaScript programming.
jQuery is easy to learn.

jQuery Syntax Examples

$(this).hide()
Demonstrates the jQuery hide() method, hiding the current HTML element.
$("#test").hide()
Demonstrates the jQuery hide() method, hiding the element with id="test".
$("p").hide()
Demonstrates the jQuery hide() method, hiding all
elements.
$(".test").hide()
Demonstrates the jQuery hide() method, hiding all elements with class="test".

The Document Ready Function

You might have noticed that all jQuery methods, in our examples, are inside a document.ready() function:
$(document).ready(function(){

   // jQuery functions go here...

});
This is to prevent any jQuery code from running before the document is finished loading (is ready).
Here are some examples of actions that can fail if functions are run before the document is fully loaded:
  • Trying to hide an element that doesn't exist
  • Trying to get the size of an image that is not loaded


29 Haziran 2012 Cuma

Linux Commands – Top 20 Most Used

1.Files and Directories Management

  • ls – Lists files and directories content, I usually use “ls -la” to have a long listing with all the details and hidden files
  • cd – move from the current directory to a different folder
  • pwd – lists your current location
  • mv – this command can either change the name of a file, or move it to a different location.
  • locate – find any file on the Linux server, to get an updated index of files (if for example you just installed a whole bunch of RPM’s) run the command updatedb
  • ln – create a shortcut to a file or folder
  • tar – create or extract files out of a storage file. with the correct arguments it will also compress the files


2. Editing and Viewing
  • tail – lists the last 10 lines of a file, but you tell tell it to show any number of last lines
  • vi – the best command line editing software :)   a little hard to learn how to work this one at first, buts its worth the effort
  • cat – list the content of the file. better know how long is the file you are running this command on, or you will get a very long scrolling of lines that will fill up your screen

3. General

  • history – lists the last used commands on your Linux server
  • make – when compiling a software from source, this command will create the binaries
  • id – who am I right now? besides the philosophical angle, this command will show you as which user you will be running commands, I use this to check what is my status, and then sudo to the user I need
  • sudo – execute a command as another user – although  usually use it to change to root
  • ps – list the running processes on the server, it give more info like the process id, the parent process id, running time and much more
  • man – displays a manual page, whenever you are not sure about a specific command or config file, you should run “man command” to get info about it. to search the man database use “whatis command” to find which man file has the info you need
  • df – report file system disk space usage, use “df -h” to get a human formatted listing

14 Haziran 2012 Perşembe

Başucu SQL Komutları :)

Her seferinde syntax ını unutup tekrar bakıp hatırladığım ve bu döngüden sıkıldığım için bu yazımda yazıp kurtulcam :)

1. INSERT

INSERT INTO Persons (P_Id, LastName, FirstName)
VALUES (5, 'Tjessem', 'Jakob')

2. DELETE

DELETE FROM Persons
WHERE LastName='Tjessem' AND FirstName='Jakob'

3. UPDATE

UPDATE Persons
SET Address='Nissestien 67', City='Sandnes'
WHERE LastName='Tjessem' AND FirstName='Jakob'

4. SELECT

SELECT LastName,FirstName FROM Persons

28 Mayıs 2012 Pazartesi

Step by Step Php development

1. install jdk
2. install xampp
3. install netbeans
4. install Php Plugins
5. make a php project

Setting up a PHP Project in the NetBeans IDE

1. Start the IDE, switch to the Projects window, and choose File > New Project. The Choose Project panel opens.

2. In the Categories list, choose PHP.

3. In the Projects area, choose PHP Application and click Next. The New PHP Project > Name and Location panel opens.














4. In the Project Name text field, enter NewPHPProject.

5. In the Sources Folder field, browse for your PHP document root and create a subfolder there called NewPHPProject. The document root is the folder where the web server looks for files to open in the browser. The document root is specified in the web server configuration file. For example, on Xampp, the document root is XAMPP_HOME/htdocs.

6. Leave all other fields with their default values. Click Next. The Run Configuration window opens.














7. In the Run As drop-down list, select Local Web Site. The project will run on your local Apache server. Your other options are to run the project remotely via FTP and to run it from the command line.


8. Leave the Project URL at default.

9. Click Finish. The IDE creates the project.

10. The NewPHPProject tree appears in the Projects window and the project's index.php file opens in the editor and in the Navigator window.












11. Enter the following code inside the block:

echo "Hello, world! This is my first PHP project!";

12. To run the project, position the cursor on the NewPHPProject node and choose Run from the context menu. The figure below shows what you should see in the browser window:


Install Php plugins in netbeans

1. In start page, click Install Plugins

2. Select PHP or related ones from Available Plugins tab, and click install. restart netbeans.



NetBeans IDE Installation

1. Once you have downloaded the installer file, double-click the installer's icon to launch the installer.download

2. In the install wizard, respond to the License Agreement, then click Next.

3. Specify an empty directory within which to install NetBeans IDE.
Note: This NetBeans IDE will not disrupt the settings of your other NetBeans installations because the IDE automatically creates a new user directory when launched (${HOME}/.netbeans/5.5.1).

4. Choose the JDK you want the IDE to use from the list of suitable choices in the list, then click Next.

5. Verify that the installation location is correct and that you have adequate space on your system for the installation.

6. Click Next to begin the installation.

Installing XAMPP on Windows

1. Download the software from: here

2. Double-click the .exe file you downloaded.

3. Choose a language from the menu, and then click OK.Click the Next button.Click the Next button once again.

4. Click Install.

















5. Launch a Web browser, and, in the Location bar, type http://localhost/.




Installing the JDK on Windows

1. For the Sun version of the JDK, enter the URL download
2. From the Sun Developer Network page, scroll to find the heading J2SE v 1.4.2_12 SDK (that is, .12 or the latest version).
3. Select Download J2SE SDK.
4. From the Sun Developer Network page, accept the license agreement and scroll to the heading "Windows Platform - Java(TM) 2 SDK, Standard Edition 1.4.2_12".
5. Select and download Windows Installation, Multi-language.
6. Save and install the .exe file.
7. If prompted, install the JDK to C:\j2sdk1.4.2_10.
8. Set the JAVA_HOME environment variable to C:\j2sdk1.4.2_12. --> how to set JAVA_HOME

24 Mayıs 2012 Perşembe

Matlab - Traffic Sign Detection

GOAL: Implement a traffic sign detection program which detects location of the traffic sign(s) on a given image.


       Input image:                                                                                                                         Output image:




ALGORITHM

To detect a traffic sign in an image, the algorithm follows these steps:
1) Color detection
2) Conversion to grayscale
3) Edge and line detection with Hough transforms
4) Optimization of edges
5) Highlighting the found traffic signs in the image


Download

19 Mayıs 2012 Cumartesi

Proje Fuarı 2012

Anadolu Üniversitesi Mühendislik Fakültesi bu sene bitirme projelerini bir yarışmayla görücüye çıkarıyor.

Tarih: 28 Mayıs 2012
Yer: Bilgisayar Mühendisliği
Mühendislik-Mimarlık Fakültesi, Anadolu Üniversitesi
İki Eylül Kampusu, 26555, Eskişehir



Masaüstü Depolama Uygulaması - SDrive

Günümüzde veri depolama gerek maliyet gerekse güvenlik açısından şirket bazında bir problem teşkil ediyor. Varolan depolama seçenekleri için gigabyte başına depolama maaliyeti ödeyeceksiniz. Ayrıca gizlilik ve güvenlik için hiçbir garantisi yok çünkü verileriniz üçüncü şahısların sunucularında tutulmakta. Bu iki sorunun da çözümü şirketin kendi sunucularını kullanması. Ağ programlama ve java teknolojisi kullanılarak bir masaüstü uygulaması geliştirdik. Bu uygulama sayesinde verilerinize her yerden erişebileceksiniz, işten, evden, vs. Belgelerinizi artık usb flash bellekte taşımanıza, mailinizde saklamanıza gerek yok. Bilgisayarınızda herhangi bir klasör gibi görünüyor ama daha fazlası. Uygulama temelde dosya senkronizasyonuna dayanıyor. Şöyle ki; yeni bir dosya eklenmesi, varolan dosyada değişiklik veya dosyanın silinmesi durumu asenkron olarak algılanıyor ve sunucuda da aynı değişiklikler yapılıyor. Örneğin, işte ve evdeki bilgisayarınıza SDrive’ ı kurdunuz. İşteki bilgisayarınızda raporunuzu yazmaya başladınız, (SDrive’ a raporunuzu koydunuz). Eve gittiğinizde, evdeki bilgisayarınızda da raporunuzun var olduğunu göreceksiniz. Raporunuzu akşam tamamladınız. Hiç birşey yapmanıza gerek yok. Sabah işte bilgisayarınızda raporunuz hazır.


4 Mayıs 2012 Cuma

Java - Default Mail Client

When you want to direct client to mail sending, you can use java.awt.Desktop.
Here is an example:

article

import java.awt.*;
import java.io.IOException;
import java.net.URI;

public class RunningDefaultMailClient {
public static void main(String[] args) {
//
// Get an instance of Desktop. If the platform doesn't
// support Desktop API an UnsupportedOperationException
// will be thrown.
//
Desktop desktop = Desktop.getDesktop();

try {
//
// Open user-default mail client application.
//
desktop.mail();
} catch (IOException e) {
e.printStackTrace();
}

try {
//
// Open user-default mail client with the email message
// fields information.
//
// mailto:dummy@domain.com?cc=test@domain.com&
// subject=First%20Email&&body=Hello%20World
//
String message = "mailto:dummy@domain.com?subject=First%20Email";
URI uri = URI.create(message);
desktop.mail(uri);
} catch (IOException e) {
e.printStackTrace();
}
}
}

26 Nisan 2012 Perşembe

Creating JSP Web Application in Netbeans

1. In start page, click "Install Plugins".

2. Under Available Plugins, search for "Java Web Applications". Select it.
When you select, it automatically selects its dependencies.

3. Click Install.

4. File > New Project > Web > JSP

5. Name your project as HelloWeb.
















6. Click Next. Specify your server location.
I used Tomcat. Set its root directory.

7. Change body as
<body>
<h1>Hello Web !</h1>
</body>

8. Finally, Run index.jsp