You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by ms...@apache.org on 2015/01/27 09:01:50 UTC
[06/19] portals-pluto git commit: worked on Mapper API
worked on Mapper API
Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/aa65948e
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/aa65948e
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/aa65948e
Branch: refs/heads/PortletHub
Commit: aa65948ee128073304e06b9b951da4f809cf9f07
Parents: 505393c
Author: Scott Nicklous <ms...@apache.org>
Authored: Mon Jan 19 22:55:14 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Mon Jan 19 22:55:14 2015 +0100
----------------------------------------------------------------------
.../portal/PublicRenderParameterMapper.java | 73 ++++++++++++++++++++
1 file changed, 73 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/aa65948e/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapper.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapper.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapper.java
index 5b6927f..f2e4a8e 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapper.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapper.java
@@ -20,11 +20,29 @@ package org.apache.pluto.driver.services.portal;
import java.util.Set;
+import javax.xml.namespace.QName;
+
import org.apache.pluto.driver.url.PortalURLPublicParameter;
/**
* Interface for the public render parameter mapper.
*
+ * The mapper maps the public render parameters into groups. All PRPs within a group
+ * are considered to be referring to the same underlying parameter, and should
+ * therefore have the same value.
+ *
+ * The algorithm for mapping the parameters into groups is determined by the specific
+ * public render parameter mapping service / mapper implementation.
+ *
+ * The mapper provides a standard interface for manipulating the mapped PRP groups.
+ *
+ * The groups are numbered beginning at 0, and they are addressed through the numeric
+ * index much like an ArrayList.
+ *
+ * Proper functioning of the mapper is dependent on the PortalURLPublicParameter
+ * equals() function, which determines equality of public render parameters
+ * based on comparison of the window ID and the parameter name (= PRP identifier).
+ *
* @author msnicklous
* @since 16/01/2015
*/
@@ -39,6 +57,61 @@ public interface PublicRenderParameterMapper {
*/
public Set<PortalURLPublicParameter> getMappedPublicParameters(PortalURLPublicParameter prp);
+ /**
+ * Returns the set of public render parameters specified by the input group index.
+ *
+ * @param index The group index
+ * @return Set containing all matching PRPs.
+ * If no group matches the index, an empty set is returned
+ */
+ public Set<PortalURLPublicParameter> getMappedPublicParameters(int index);
+
+ /**
+ * Returns the number of distinct PRP groups available from the mapper.
+ *
+ * @return number of groups
+ */
+ public int getNumberOfGroups();
+
+ /**
+ * Returns the group index for the given public render parameter. If the input
+ * PRP cannot be found in the overall set, -1 is returned.
+ *
+ * @param prp input PRP
+ * @return if the PRP is found in the overall set, the index of the group containing the PRP.
+ * if the PRP cannot be found, -1 is returned
+ */
+ public int getIndex(PortalURLPublicParameter prp);
+
+ /**
+ * Returns the group index for the given window ID / PRP identifier pair.
+ * If the input PRP cannot be found in the overall set, -1 is returned.
+ *
+ * @param windowId Window ID
+ * @param identifier PRP identifier
+ * @return if the PRP is found in the overall set, the index of the group containing the PRP.
+ * if the PRP cannot be found, -1 is returned
+ */
+ public int getIndex(String windowId, String identifier);
+
+ /**
+ * Returns the group index for the given PRP QName unique identifier.
+ * If the input PRP cannot be found in the overall set, -1 is returned.
+ *
+ * @param qname QName
+ * @return if the PRP is found in the overall set, the index of the group containing the PRP.
+ * if the PRP cannot be found, -1 is returned
+ */
+ public int getIndex(QName qname);
+
+ /**
+ * Sets the values of all public render parameters within the specified group.
+ *
+ * @param index Group index
+ * @param values Values array for the public render parameters contained in the group
+ */
+ public void setValue(int index, String[] values);
+
// scafolding function - to be thrown away then the URL generation is complete.
public Set<PortalURLPublicParameter> getPRPsForId(String id, String[] vals);