Skip to content

Commit f92fc9a

Browse files
committed
JPA annotations
1 parent d6434e4 commit f92fc9a

File tree

4 files changed

+41
-32
lines changed

4 files changed

+41
-32
lines changed

logicaldoc-core/src/main/java/com/logicaldoc/core/document/Document.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,6 @@ public String getTagsString() {
237237
return sb.toString();
238238
}
239239

240-
@Override
241-
public Set<DocumentAccessControlEntry> getAccessControlList() {
242-
return accessControlList;
243-
}
244-
245-
@Override
246-
public void setAccessControlList(Set<DocumentAccessControlEntry> accessControlList) {
247-
this.accessControlList = accessControlList;
248-
}
249-
250240
public void addTag(String word) {
251241
Tag tg = new Tag();
252242
tg.setTenantId(getTenantId());
@@ -340,6 +330,16 @@ public void setTemplate(Template template) {
340330
this.template = template;
341331
}
342332

333+
@Override
334+
public Set<DocumentAccessControlEntry> getAccessControlList() {
335+
return accessControlList;
336+
}
337+
338+
@Override
339+
public void setAccessControlList(Set<DocumentAccessControlEntry> accessControlList) {
340+
this.accessControlList = accessControlList;
341+
}
342+
343343
@Override
344344
public AccessControlEntry getAccessControlEntry(long groupId) {
345345
return getAccessControlList().stream().filter(ace -> ace.getGroupId() == groupId).findFirst().orElse(null);

logicaldoc-core/src/main/java/com/logicaldoc/core/metadata/Extensible.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,20 @@
33
import java.util.List;
44
import java.util.Map;
55

6+
import com.logicaldoc.core.PersistentObject;
7+
8+
/**
9+
* Interface to be implemented by those {@link PersistentObject}s that have extensible attribtues
10+
*
11+
* @author Giuseppe Desiato - LogicalDOC
12+
* @since 9.2
13+
*/
614
public interface Extensible {
715

16+
public Map<String, Attribute> getAttributes();
17+
18+
public void setAttributes(Map<String, Attribute> attributes);
19+
820
public Long getTemplateId();
921

1022
public void setTemplateId(Long templateId);
@@ -17,10 +29,6 @@ public interface Extensible {
1729

1830
public void setTemplate(Template template);
1931

20-
public Map<String, Attribute> getAttributes();
21-
22-
public void setAttributes(Map<String, Attribute> attributes);
23-
2432
public List<Attribute> getValueAttributes(String name);
2533

2634
public List<Object> getValues(String name);

logicaldoc-core/src/main/java/com/logicaldoc/core/metadata/ExtensibleObject.java

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,6 @@ public abstract class ExtensibleObject extends PersistentObject implements Exten
2525

2626
private static final long serialVersionUID = 1L;
2727

28-
/**
29-
* Retrieves the ordered set of the names of the attributes representing the
30-
* different values
31-
*
32-
* @param name name of the attribute to get values from
33-
*
34-
* @return the set of names
35-
*/
36-
private Set<String> getValueAttributesName(String name) {
37-
TreeSet<String> attNames = new TreeSet<>();
38-
for (String n : getAttributes().keySet()) {
39-
if (n.equals(name) || name.equals(getAttribute(n).getParent()))
40-
attNames.add(n);
41-
}
42-
return attNames;
43-
}
44-
4528
@Override
4629
public List<Attribute> getValueAttributes(String name) {
4730
Set<String> valueNames = getValueAttributesName(name);
@@ -204,4 +187,22 @@ private int getLastPosition() {
204187

205188
return position;
206189
}
190+
191+
/**
192+
* Retrieves the ordered set of the names of the attributes representing the
193+
* different values
194+
*
195+
* @param name name of the attribute to get values from
196+
*
197+
* @return the set of names
198+
*/
199+
private Set<String> getValueAttributesName(String name) {
200+
TreeSet<String> attNames = new TreeSet<>();
201+
for (String n : getAttributes().keySet()) {
202+
if (n.equals(name) || name.equals(getAttribute(n).getParent()))
203+
attNames.add(n);
204+
}
205+
return attNames;
206+
}
207+
207208
}

logicaldoc-core/src/test/java/com/logicaldoc/core/searchengine/StandardSearchEngineTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void setUp() throws IOException, SQLException, PluginException {
3333

3434
@After
3535
@Override
36-
public void tearDown() throws SQLException {
36+
public void tearDown() throws SQLException, IOException {
3737
testSubject.unlock();
3838
testSubject.close();
3939
super.tearDown();

0 commit comments

Comments
 (0)