Skip to content

Commit

Permalink
case fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
manos committed Jun 7, 2017
1 parent 5b9c9f3 commit 3c31581
Show file tree
Hide file tree
Showing 6 changed files with 294 additions and 7 deletions.
264 changes: 264 additions & 0 deletions docs/assets/intellij-code-scheme.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
<?xml version="1.0" encoding="UTF-8"?>
<code_scheme name="restdude">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4"/>
<option name="CONTINUATION_INDENT_SIZE" value="8"/>
<option name="TAB_SIZE" value="4"/>
<option name="USE_TAB_CHARACTER" value="true"/>
<option name="SMART_TABS" value="false"/>
<option name="LABEL_INDENT_SIZE" value="0"/>
<option name="LABEL_INDENT_ABSOLUTE" value="false"/>
<option name="USE_RELATIVE_INDENTS" value="false"/>
</value>
</option>
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="50"/>
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="50"/>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="" withSubpackages="true" static="true"/>
<emptyLine/>
<package name="java" withSubpackages="true" static="false"/>
<emptyLine/>
<package name="javax" withSubpackages="true" static="false"/>
<emptyLine/>
<package name="" withSubpackages="true" static="false"/>
<emptyLine/>
<package name="org.springframework" withSubpackages="true" static="false"/>
</value>
</option>
<option name="ENABLE_JAVADOC_FORMATTING" value="false"/>
<option name="JD_ALIGN_PARAM_COMMENTS" value="false"/>
<option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false"/>
<option name="JD_KEEP_EMPTY_LINES" value="false"/>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true"/>
</XML>
<codeStyleSettings language="Groovy">
<indentOptions>
<option name="USE_TAB_CHARACTER" value="true"/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1"/>
<option name="BLANK_LINES_AROUND_FIELD" value="1"/>
<option name="BLANK_LINES_AROUND_FIELD_IN_INTERFACE" value="1"/>
<option name="ELSE_ON_NEW_LINE" value="true"/>
<option name="CATCH_ON_NEW_LINE" value="true"/>
<option name="FINALLY_ON_NEW_LINE" value="true"/>
<option name="ALIGN_MULTILINE_PARAMETERS" value="false"/>
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true"/>
<option name="KEEP_SIMPLE_BLOCKS_IN_ONE_LINE" value="true"/>
<option name="KEEP_MULTIPLE_EXPRESSIONS_IN_ONE_LINE" value="true"/>
<option name="FIELD_ANNOTATION_WRAP" value="1"/>
<indentOptions>
<option name="USE_TAB_CHARACTER" value="true"/>
</indentOptions>
<arrangement>
<groups>
<group>
<type>GETTERS_AND_SETTERS</type>
<order>KEEP</order>
</group>
</groups>
<rules>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PUBLIC</MODIFIER>
<MODIFIER>STATIC</MODIFIER>
<MODIFIER>FINAL</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PROTECTED</MODIFIER>
<MODIFIER>STATIC</MODIFIER>
<MODIFIER>FINAL</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PACKAGE_PRIVATE</MODIFIER>
<MODIFIER>STATIC</MODIFIER>
<MODIFIER>FINAL</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PRIVATE</MODIFIER>
<MODIFIER>STATIC</MODIFIER>
<MODIFIER>FINAL</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PUBLIC</MODIFIER>
<MODIFIER>STATIC</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PROTECTED</MODIFIER>
<MODIFIER>STATIC</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PACKAGE_PRIVATE</MODIFIER>
<MODIFIER>STATIC</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PRIVATE</MODIFIER>
<MODIFIER>STATIC</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PUBLIC</MODIFIER>
<MODIFIER>FINAL</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PROTECTED</MODIFIER>
<MODIFIER>FINAL</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PACKAGE_PRIVATE</MODIFIER>
<MODIFIER>FINAL</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PRIVATE</MODIFIER>
<MODIFIER>FINAL</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PUBLIC</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PROTECTED</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PACKAGE_PRIVATE</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>FIELD</TYPE>
<MODIFIER>PRIVATE</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<TYPE>FIELD</TYPE>
</match>
</rule>
<rule>
<match>
<TYPE>CONSTRUCTOR</TYPE>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>METHOD</TYPE>
<MODIFIER>STATIC</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<TYPE>METHOD</TYPE>
</match>
</rule>
<rule>
<match>
<TYPE>ENUM</TYPE>
</match>
</rule>
<rule>
<match>
<TYPE>INTERFACE</TYPE>
</match>
</rule>
<rule>
<match>
<AND>
<TYPE>CLASS</TYPE>
<MODIFIER>STATIC</MODIFIER>
</AND>
</match>
</rule>
<rule>
<match>
<TYPE>CLASS</TYPE>
</match>
</rule>
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="USE_TAB_CHARACTER" value="true"/>
</indentOptions>
</codeStyleSettings>
</code_scheme>

Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
import com.restdude.domain.cases.ICaseModel;
import com.restdude.domain.cases.model.dto.BaseContextInfo;
import com.restdude.domain.cases.model.dto.CaseStatustInfo;
import com.restdude.domain.users.model.User;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
Expand All @@ -43,6 +45,7 @@
/**
* Base topic impl
*/

@Slf4j
@MappedSuperclass
public class AbstractCaseModel<A extends SpaceCasesApp<C>, C extends AbstractCaseModel<A, C, CC>, CC extends AbstractCaseCommentModel>
Expand Down Expand Up @@ -90,12 +93,12 @@ public class AbstractCaseModel<A extends SpaceCasesApp<C>, C extends AbstractCa
@Getter @Setter
private List<CC> comments;

@JsonIgnore
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(joinColumns = {@JoinColumn(name = "member_id")}, inverseJoinColumns = {
@JoinColumn(name = "case_id")})
@ApiModelProperty(value = "Assigned to", readOnly = true, hidden = true)
@ManyToOne(fetch = FetchType.EAGER )
@JoinColumn(name = "assigned_to", referencedColumnName = "id", updatable = false)
@Getter @Setter
private List<Membership> assignedTo;
private User assignee;




Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*/
package com.restdude.domain.cases.repository;

import java.util.List;

import com.restdude.domain.cases.model.Space;
import com.restdude.domain.users.model.User;
import org.springframework.data.jpa.repository.Query;
Expand All @@ -34,4 +36,6 @@ public interface SpaceRepository extends ContextRepository<Space> {
@Query(value = "select context from Space context where context.owner = :#{#user} and context.name = :#{#user.username} ")
Space getUserSpace(@Param("user") User user);

Space findByName(String name);

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,11 @@ public interface SpaceService extends ContextService<Space> {
* @return
*/
Space getSystemContext();

/**
* Get the space matching the given name
* @param name
* @return
*/
Space findByName(String name);
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public List<CaseCommenttInfo> getCompactCommentsBySubject(String id){
@Override
@Transactional(readOnly = false)
public T create(T resource) {
log.debug("create, resource: {}", resource);

// save case
resource = super.create(resource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ protected Map<String, User> createTestSpaceUsers() {
.firstName(username.substring(0, 3)).lastName(username.substring(3)).build();
testUsers.put(username, userService.createAsConfirmed(u));
}


return testUsers;
}


@Override
public Space getSystemContext(){
if(this.syetemSpace == null){
Expand All @@ -220,4 +220,12 @@ public Space getSystemContext(){
return this.syetemSpace;
}

/**
* {@inheritDoc}
*/
@Override
public Space findByName(String name) {
return this.repository.findByName(name);
}

}

0 comments on commit 3c31581

Please sign in to comment.