Skip to content

Commit edc85c1

Browse files
Pawel Kruszewskiktor
Pawel Kruszewski
authored andcommitted
* updated some javadoc
* upped project libs and plugins * fixed few code smells
1 parent 60a1bb0 commit edc85c1

26 files changed

+324
-275
lines changed

db-setup-core/pom.xml

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55

66
<groupId>com.mimacom.liferay</groupId>
7-
<version>1.0.0</version>
7+
<version>1.0.1</version>
88
<artifactId>db-setup-core</artifactId>
99
<name>Liferay Portal DB Setup core</name>
1010
<description>Library that allows to declare a set of Liferay data to be created and create them using the API.
@@ -13,12 +13,21 @@
1313

1414
<packaging>jar</packaging>
1515

16+
<properties>
17+
<jaxb2.plugin.version>2.2</jaxb2.plugin.version>
18+
<java.version>1.7</java.version>
19+
<license.plugin.version>1.13</license.plugin.version>
20+
<resource.plugin.version>3.0.2</resource.plugin.version>
21+
<liferay.ce.version>6.2.5</liferay.ce.version>
22+
<source.plugin.version>3.0.1</source.plugin.version>
23+
<javadoc.plugin.version>2.10.4</javadoc.plugin.version>
24+
</properties>
1625
<build>
1726
<plugins>
1827
<plugin>
1928
<groupId>org.codehaus.mojo</groupId>
2029
<artifactId>jaxb2-maven-plugin</artifactId>
21-
<version>1.5</version>
30+
<version>${jaxb2.plugin.version}</version>
2231
<executions>
2332
<execution>
2433
<id>xjc</id>
@@ -29,7 +38,9 @@
2938
</executions>
3039
<configuration>
3140
<outputDirectory>${project.build.directory}/generated-sources/sources</outputDirectory>
32-
<schemaDirectory>${basedir}/src/main/resources</schemaDirectory>
41+
<sources>
42+
<source>${basedir}/src/main/resources/setup_definition-1.0.xsd</source>
43+
</sources>
3344
<packageName>com.mimacom.liferay.portal.setup.domain</packageName>
3445
<clearOutputDir>false</clearOutputDir>
3546
</configuration>
@@ -40,19 +51,20 @@
4051
<version>2.5</version>
4152
<configuration>
4253
<encoding>UTF-8</encoding>
43-
<source>1.7</source>
44-
<target>1.7</target>
54+
<source>${java.version}</source>
55+
<target>${java.version}</target>
4556
</configuration>
4657
</plugin>
4758

4859
<plugin>
4960
<groupId>org.codehaus.mojo</groupId>
5061
<artifactId>license-maven-plugin</artifactId>
51-
<version>1.8</version>
62+
<version>${license.plugin.version}</version>
5263
<configuration>
5364
<outputDirectory>${project.build.directory}/generated-sources/license</outputDirectory>
5465
<thirdPartyFilename>THIRD-PARTY.txt</thirdPartyFilename>
5566
<licenseName>mit</licenseName>
67+
<encoding>UTF-8</encoding>
5668
<excludes>
5769
<exclude>**/package-info.java</exclude>
5870
</excludes>
@@ -74,19 +86,40 @@
7486
<plugin>
7587
<groupId>org.apache.maven.plugins</groupId>
7688
<artifactId>maven-resources-plugin</artifactId>
77-
<version>2.6</version>
89+
<version>${resource.plugin.version}</version>
7890
<configuration>
7991
<encoding>UTF-8</encoding>
8092
</configuration>
8193
</plugin>
8294
<plugin>
8395
<groupId>org.apache.maven.plugins</groupId>
8496
<artifactId>maven-javadoc-plugin</artifactId>
85-
<version>2.9.1</version>
97+
<version>${javadoc.plugin.version}</version>
8698
<configuration>
8799
<charset>UTF-8</charset>
88100
<encoding>UTF-8</encoding>
89101
</configuration>
102+
<executions>
103+
<execution>
104+
<id>attach-javadocs</id>
105+
<goals>
106+
<goal>jar</goal>
107+
</goals>
108+
</execution>
109+
</executions>
110+
</plugin>
111+
<plugin>
112+
<groupId>org.apache.maven.plugins</groupId>
113+
<artifactId>maven-source-plugin</artifactId>
114+
<version>${source.plugin.version}</version>
115+
<executions>
116+
<execution>
117+
<id>attach-sources</id>
118+
<goals>
119+
<goal>jar</goal>
120+
</goals>
121+
</execution>
122+
</executions>
90123
</plugin>
91124
</plugins>
92125
</build>
@@ -95,7 +128,7 @@
95128
<dependency>
96129
<groupId>com.liferay.portal</groupId>
97130
<artifactId>portal-service</artifactId>
98-
<version>6.2.5</version>
131+
<version>${liferay.ce.version}</version>
99132
<scope>provided</scope>
100133
</dependency>
101134
<dependency>
@@ -124,7 +157,9 @@
124157
</dependency>
125158
</dependencies>
126159
<scm>
127-
<url>https://github.com/mimacom/liferay-db-setup-core</url>
160+
<connection>scm:git:git://github.com/mimacom/liferay-db-setup-core.git</connection>
161+
<developerConnection>scm:git:ssh://github.com:mimacom/liferay-db-setup-core.git</developerConnection>
162+
<url>https://github.com/mimacom/liferay-db-setup-core/tree/1.x</url>
128163
</scm>
129164
<organization>
130165
<name>mimacom ag</name>
@@ -139,4 +174,12 @@
139174
<comments>A business-friendly OSS license</comments>
140175
</license>
141176
</licenses>
177+
<developers>
178+
<developer>
179+
<name>Pawel Kruszewski</name>
180+
<email>pawel.kruszewski@mimacom.com</email>
181+
<organization>mimacom</organization>
182+
<organizationUrl>http://www.mimacom.com</organizationUrl>
183+
</developer>
184+
</developers>
142185
</project>

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/BasicSetupUpgradeProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/LiferaySetup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/MarshallUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/SetupUpgradeProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/core/SetupArticles.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal
@@ -517,7 +517,7 @@ public static void processRelatedAssets(final Article article, final JournalArti
517517
try {
518518
id = Long.parseLong(clazzPrimKey);
519519
} catch (Exception ex) {
520-
ex.printStackTrace();
520+
LOG.error(ex);
521521
}
522522

523523
try {

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/core/SetupCategorization.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* #%L
33
* Liferay Portal DB Setup core
44
* %%
5-
* Copyright (C) 2016 mimacom ag
5+
* Copyright (C) 2016 - 2017 mimacom ag
66
* %%
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal
@@ -50,7 +50,7 @@
5050
* Setup module for creating / updating the categorization. So far it creates
5151
* tree of categories. In the future also AssetTag creation feature should be
5252
* here.
53-
* <p/>
53+
* <p>
5454
* Created by guno on 8. 6. 2015.
5555
*/
5656
public final class SetupCategorization {

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/core/SetupCustomFields.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/core/SetupDocumentFolders.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/core/SetupDocuments.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal
@@ -129,12 +129,12 @@ public static byte[] getDocumentContent(final String filesystemPath) {
129129
}
130130
content = baos.toByteArray();
131131
} catch (IOException e) {
132-
e.printStackTrace();
132+
LOG.error(e);
133133
} finally {
134134
try {
135135
is.close();
136136
} catch (IOException e) {
137-
e.printStackTrace();
137+
LOG.error(e);
138138
}
139139
}
140140
} else {

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/core/SetupOrganizations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/core/SetupPages.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal
@@ -129,10 +129,10 @@ private SetupPages() {
129129
}
130130

131131
/**
132-
* @param organization
133-
* @param groupId
134-
* @param company
135-
* @param userid
132+
* @param organization organization entity defined in xml descriptor
133+
* @param groupId liferay site scope
134+
* @param company liferay instance scope
135+
* @param userid run as user
136136
* @throws SystemException
137137
* @throws PortalException
138138
*/
@@ -241,12 +241,12 @@ private static void setupTheme(final long groupId, final Theme theme, final bool
241241
}
242242

243243
/**
244-
* @param pages
245-
* @param groupId
246-
* @param isPrivate
247-
* @param parentLayoutId
248-
* @param company
249-
* @param userId
244+
* @param pages list of pages defined in xml descriptor
245+
* @param groupId Liferay site scope
246+
* @param isPrivate should page be added in private pages?
247+
* @param parentLayoutId layout id of parent page
248+
* @param company Liferay instance scope
249+
* @param userId run as user
250250
* @throws SystemException
251251
* @throws PortalException
252252
*/
@@ -280,7 +280,7 @@ private static void addPages(final List<Page> pages, final long groupId,
280280
}
281281
LOG.info("Setup: Page " + page.getName() + " created...");
282282
} catch (Exception ex) {
283-
ex.printStackTrace();
283+
LOG.error(ex);
284284
}
285285
setupLiferayPage(layout, page, groupId, isPrivate, company, userId, null);
286286
}
@@ -397,7 +397,7 @@ private static void updatePage(final Layout layout, final Page page, final long
397397
}
398398
LayoutLocalServiceUtil.updateLayout(layout);
399399
} catch (SystemException e) {
400-
e.printStackTrace();
400+
LOG.error(e);
401401
}
402402
}
403403

@@ -586,7 +586,7 @@ private static void removeAllPortlets(final long runasUser,
586586
try {
587587
portlets = layoutTypePortlet.getAllPortlets();
588588
} catch (PortalException | SystemException e1) {
589-
e1.printStackTrace();
589+
LOG.error(e1);
590590
}
591591
if (portlets != null) {
592592
for (Portlet portlet : portlets) {
@@ -611,7 +611,7 @@ private static void removeAllPortlets(final long runasUser,
611611
}
612612
}
613613
} catch (PortalException | SystemException e) {
614-
e.printStackTrace();
614+
LOG.error(e);
615615
}
616616
}
617617
}

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/core/SetupPermissions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal
@@ -112,7 +112,7 @@ public static void addPermission(final String roleName, final String className,
112112
ResourcePermissionLocalServiceUtil.setResourcePermissions(COMPANY_ID, className,
113113
ResourceConstants.SCOPE_INDIVIDUAL, primaryKey, roleId, permission);
114114
} catch (Exception ex) {
115-
ex.printStackTrace();
115+
LOG.error(ex);
116116
}
117117
}
118118

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/core/SetupRoles.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/core/SetupUsers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal

db-setup-core/src/main/java/com/mimacom/liferay/portal/setup/core/SetupWebFolders.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* Liferay Portal DB Setup core
66
* %%
7-
* Copyright (C) 2016 mimacom ag
7+
* Copyright (C) 2016 - 2017 mimacom ag
88
* %%
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)