Skip to content

Commit

Permalink
* updated some javadoc
Browse files Browse the repository at this point in the history
* upped project libs and plugins
* fixed few code smells
  • Loading branch information
Pawel Kruszewski authored and ktor committed Jul 19, 2017
1 parent 60a1bb0 commit edc85c1
Show file tree
Hide file tree
Showing 26 changed files with 324 additions and 275 deletions.
63 changes: 53 additions & 10 deletions db-setup-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

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

<packaging>jar</packaging>

<properties>
<jaxb2.plugin.version>2.2</jaxb2.plugin.version>
<java.version>1.7</java.version>
<license.plugin.version>1.13</license.plugin.version>
<resource.plugin.version>3.0.2</resource.plugin.version>
<liferay.ce.version>6.2.5</liferay.ce.version>
<source.plugin.version>3.0.1</source.plugin.version>
<javadoc.plugin.version>2.10.4</javadoc.plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.5</version>
<version>${jaxb2.plugin.version}</version>
<executions>
<execution>
<id>xjc</id>
Expand All @@ -29,7 +38,9 @@
</executions>
<configuration>
<outputDirectory>${project.build.directory}/generated-sources/sources</outputDirectory>
<schemaDirectory>${basedir}/src/main/resources</schemaDirectory>
<sources>
<source>${basedir}/src/main/resources/setup_definition-1.0.xsd</source>
</sources>
<packageName>com.mimacom.liferay.portal.setup.domain</packageName>
<clearOutputDir>false</clearOutputDir>
</configuration>
Expand All @@ -40,19 +51,20 @@
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.7</source>
<target>1.7</target>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>1.8</version>
<version>${license.plugin.version}</version>
<configuration>
<outputDirectory>${project.build.directory}/generated-sources/license</outputDirectory>
<thirdPartyFilename>THIRD-PARTY.txt</thirdPartyFilename>
<licenseName>mit</licenseName>
<encoding>UTF-8</encoding>
<excludes>
<exclude>**/package-info.java</exclude>
</excludes>
Expand All @@ -74,19 +86,40 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<version>${resource.plugin.version}</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>${javadoc.plugin.version}</version>
<configuration>
<charset>UTF-8</charset>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${source.plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand All @@ -95,7 +128,7 @@
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<version>6.2.5</version>
<version>${liferay.ce.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -124,7 +157,9 @@
</dependency>
</dependencies>
<scm>
<url>https://github.com/mimacom/liferay-db-setup-core</url>
<connection>scm:git:git://github.com/mimacom/liferay-db-setup-core.git</connection>
<developerConnection>scm:git:ssh://github.com:mimacom/liferay-db-setup-core.git</developerConnection>
<url>https://github.com/mimacom/liferay-db-setup-core/tree/1.x</url>
</scm>
<organization>
<name>mimacom ag</name>
Expand All @@ -139,4 +174,12 @@
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
<developers>
<developer>
<name>Pawel Kruszewski</name>
<email>pawel.kruszewski@mimacom.com</email>
<organization>mimacom</organization>
<organizationUrl>http://www.mimacom.com</organizationUrl>
</developer>
</developers>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -517,7 +517,7 @@ public static void processRelatedAssets(final Article article, final JournalArti
try {
id = Long.parseLong(clazzPrimKey);
} catch (Exception ex) {
ex.printStackTrace();
LOG.error(ex);
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -50,7 +50,7 @@
* Setup module for creating / updating the categorization. So far it creates
* tree of categories. In the future also AssetTag creation feature should be
* here.
* <p/>
* <p>
* Created by guno on 8. 6. 2015.
*/
public final class SetupCategorization {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -129,12 +129,12 @@ public static byte[] getDocumentContent(final String filesystemPath) {
}
content = baos.toByteArray();
} catch (IOException e) {
e.printStackTrace();
LOG.error(e);
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
LOG.error(e);
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -129,10 +129,10 @@ private SetupPages() {
}

/**
* @param organization
* @param groupId
* @param company
* @param userid
* @param organization organization entity defined in xml descriptor
* @param groupId liferay site scope
* @param company liferay instance scope
* @param userid run as user
* @throws SystemException
* @throws PortalException
*/
Expand Down Expand Up @@ -241,12 +241,12 @@ private static void setupTheme(final long groupId, final Theme theme, final bool
}

/**
* @param pages
* @param groupId
* @param isPrivate
* @param parentLayoutId
* @param company
* @param userId
* @param pages list of pages defined in xml descriptor
* @param groupId Liferay site scope
* @param isPrivate should page be added in private pages?
* @param parentLayoutId layout id of parent page
* @param company Liferay instance scope
* @param userId run as user
* @throws SystemException
* @throws PortalException
*/
Expand Down Expand Up @@ -280,7 +280,7 @@ private static void addPages(final List<Page> pages, final long groupId,
}
LOG.info("Setup: Page " + page.getName() + " created...");
} catch (Exception ex) {
ex.printStackTrace();
LOG.error(ex);
}
setupLiferayPage(layout, page, groupId, isPrivate, company, userId, null);
}
Expand Down Expand Up @@ -397,7 +397,7 @@ private static void updatePage(final Layout layout, final Page page, final long
}
LayoutLocalServiceUtil.updateLayout(layout);
} catch (SystemException e) {
e.printStackTrace();
LOG.error(e);
}
}

Expand Down Expand Up @@ -586,7 +586,7 @@ private static void removeAllPortlets(final long runasUser,
try {
portlets = layoutTypePortlet.getAllPortlets();
} catch (PortalException | SystemException e1) {
e1.printStackTrace();
LOG.error(e1);
}
if (portlets != null) {
for (Portlet portlet : portlets) {
Expand All @@ -611,7 +611,7 @@ private static void removeAllPortlets(final long runasUser,
}
}
} catch (PortalException | SystemException e) {
e.printStackTrace();
LOG.error(e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -112,7 +112,7 @@ public static void addPermission(final String roleName, final String className,
ResourcePermissionLocalServiceUtil.setResourcePermissions(COMPANY_ID, className,
ResourceConstants.SCOPE_INDIVIDUAL, primaryKey, roleId, permission);
} catch (Exception ex) {
ex.printStackTrace();
LOG.error(ex);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* #%L
* Liferay Portal DB Setup core
* %%
* Copyright (C) 2016 mimacom ag
* Copyright (C) 2016 - 2017 mimacom ag
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit edc85c1

Please sign in to comment.