Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to store data into database

dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 1, 2013

I have created a screen on which user enters issues ID for particular days.

Now, how can i store these issue IDs and associated days into database for selected user ?

can you please share me detail steps to proceed.

Thank You

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
tousifs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 1, 2013

hi dhaval,

you can start working on active objects for your requirement.

https://developer.atlassian.com/display/DOCS/Getting+Started+with+Active+Objects

regards,

tousif shaikh.

dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013

Hi ,

i have been follwing the activeobjects tutorial and added - activeobject dependencies:

<dependency>
<groupId>com.atlassian.activeobjects</groupId>
<artifactId>activeobjects-plugin</artifactId>
<version>${ao.version}</version>
<scope>provided</scope>
</dependency>
and component reference.
Now, in eclipse , when i try to create entity then, unable to find "net.java.ao.Entity" namespace to extend the interface.
intelligence shows me - "com.atlassian.jira.entity", "org.dom4j" , "org.w3c.dom"
and net.* not found.
Developing plugin version : jira 5.1.8
can you please tell me how do i have to add missing dependency or packge.

tousifs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013

add entry in atlassian-plugin.xml .

<ao key="ao-module">
<description>The module configuring the Active Objects service used by this plugin</description>
<entity>com.custom.yourclassforentity</entity>

</ao>

<component-import key="ao" name="Active Objects service" interface="com.atlassian.activeobjects.external.ActiveObjects">
<description>Component to access Active Objects functionality from the plugin</description>
</component-import>

it should work.

dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013

In my eclipse editor, unabl e to find "net.java.ao.Entity" namespace .

Editor Intellience unable to show me , "net.java..."

Do i need to add any additonal package for - "net.java.ao.Entity" namespace.

My pom.xml contains:

<dependency>
<groupId>com.atlassian.activeobjects</groupId>
<artifactId>activeobjects-plugin</artifactId>
<version>${ao.version}</version>
<scope>provided</scope>
</dependency>

<dependency>

<groupId>com.atlassian.labs</groupId>

<artifactId>activeobjects-plugin</artifactId>

<version>0.5</version>

<type>atlassian-plugin</type>

</dependency>

atlassian-xml:


<component-import key="ao" name="Active Objects service" interface="com.atlassian.activeobjects.external.ActiveObjects">

<description>Component to access Active Objects functionality from the plugin</description>

</component-import>

<ao key="ao-module">

<description>The module configuring the Active Objects service used by this plugin</description>

<entity>com.company.jira.plugin.Reports.aoentities.InterfaceNameWhichExtendsEntity</entity>

</ao>

tousifs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013

update pom.xml and try . Refresh project

<dependency>
<groupId>com.atlassian.activeobjects</groupId>
<artifactId>activeobjects-plugin</artifactId>
<version>0.9.6</version>
<scope>provided</scope>
</dependency>

dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013

I have included your mentioned dependency block and also, in

pom.xml , have below block:

<build>

<plugins>

<plugin>

<groupId>com.atlassian.maven.plugins</groupId>

<artifactId>maven-jira-plugin</artifactId>

<version>${amps.version}</version>

<extensions>true</extensions>

<configuration>

<pluginArtifacts>

<pluginArtifact>

<groupId>com.atlassian.activeobjects</groupId>

<artifactId>activeobjects-plugin</artifactId>

<version>0.9.6</version>

</pluginArtifact>

<pluginArtifact>

<groupId>com.atlassian.activeobjects</groupId>

<artifactId>activeobjects-jira-spi</artifactId>

<version>0.9.6</version>

</pluginArtifact>

</pluginArtifacts>

<productVersion>${jira.version}</productVersion>

<productDataVersion>${jira.version}</productDataVersion>

</configuration>

</plugin>

I have compiled the code after that, through "atlas-cli --cli port 1025" and restrated eclipse .

And again tried to type - "net.java.ao.Entity" but this namespace was not appear through eclipse intelligence and shown me in red line only.

Is there any other dependency - refers "net.java.ao" package ?

http://activeobjects.java.net/0.8.2/api/net/java/ao/package-summary.html

dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013

I can get - com.atlassian.activeobjects and com.atlassian.activeobjects.spi name spaces

but not showing me - "net.java.ao"

dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013

Changed version from 0.9.6 to 0.20 and again compile through atlas-cli and succeed. Also, command prompt log shows download activeobject library texts.

Then, created Entity file as below:

package com.company.jira.plugin.Reports.aoentities;

import net.java.ao.Entity; //giving same error "The import net.java cannot be resolved"

public interface PlanIssues extends Entity { //"Entity red line error"

//

}

Again compiling through "atlas-cli" and build succeed even though in eclipse shows red line error saying "import net.java can not resolved". (so looks like, issues with eclipse build configuration path ).
Please shre me any comment or clues to resolve issue..
dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013

Hi,

Have added manually - build path - external JAR file reference from .m2 repository/net/java/dev/activeobject/0.20/jar file and it resolves eclipse error.

so, its fine to go with this for now.

I am not sure , why i need to manually add reference even though downloaded correctly through pom.xml dependencies.

Thanks for your comments.

Dhaval soni

2 votes
Aaron Sherman May 25, 2013

I had to clean my entire area, after which the active objects plugin downloaded correctly and added itself (without me edditing my jars)

  • atlas-mvn clean
  • atlas-mvn eclipse:clean eclipse:eclipse
HaarikaM
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 20, 2013

Works!! Thanks!!

1 vote
Onkar Ahire
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013

Pom.xml

<dependency>

<groupId>com.atlassian.labs</groupId>

<artifactId>activeobjects-plugin</artifactId>

<version>0.5</version>

<type>atlassian-plugin</type>

</dependency>

atlassian-plugin.xml

<ao key="ao-issueConfig">

<description>The module configuring the Active Objects service used by this plugin</description>

<entity>com.POJOCLASSREF</entity>

</ao>

POJOCLASSREF.java

public interface POJOCLASSREF extends Entity

{

// getter and setter methods

}

MainJAVACLASS.java

Depends on plugin module you can use ao, eg. Use ActiveObject in construction injection.

public class MainJAVACLASS

{

private final ActiveObjects ao;

}

public MainJAVACLASS(ActiveObject ao)

{

this.ao=ao;

}

and use ao object where ever you want in bussiness logic.

to store data in to DB

use ao scenario like this

ao.executeInTransaction(new TransactionCallback<POJOCLASSREF>() {

public IssueConfig doInTransaction()

{

final POJOCLASSREF pojoref=ao.create(POJOCLASSREF.class);

// USE SETTER METHOD TO SET PARAMETERS TO STORE IN DB

return pojoref;

}

});

dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013

Thanks for the comments. your commented stuff will also help me.. once resolved this namespace issue.

actually, i m facing an issue to get "net.java.ao.Entity" namespace as i posted in my last comment above.

dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013


What is the package for "TransactionCallback<POJOCLASSREF>()" ?

It shows me - "TransactionCallback is not generic...."

i refer "com.atlassian.sal.api.transaction.TransactionCallback;".

dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 10, 2013

It was resolve by removing argument and keep as "TransactionCallback()"

0 votes
Aaron Sherman May 25, 2013

@dhaval - did you ever solve this? I feel like I am about to rip my hair out, but assume it is something trivial I am missing. -aaron

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events