Merge "Omaha #3350 Removing OBE classes/files for registry user registry and identity management" into omaha_14.4.1

Former-commit-id: 98d82de231 [formerly 0312ae103ee4dedea47c9ede9bb5651629e5a5b9]
Former-commit-id: a50a5b1663
This commit is contained in:
Richard Peter 2014-07-07 09:21:02 -05:00 committed by Gerrit Code Review
commit 8a5608d851
22 changed files with 7 additions and 2601 deletions

View file

@ -29,7 +29,7 @@ fi
while [ -z $keystorePw ];
do
echo -n "Enter password for keystore [$keystore]: "
echo -n "Enter desired password for keystore [$keystore]: "
read keystorePw
if [ -z $keystorePw ];
then
@ -49,7 +49,7 @@ done
while [ -z $keyPw ];
do
echo -n "Enter password for key [$keyAlias]: "
echo -n "Enter desired password for key [$keyAlias]: "
read keyPw
if [ -z $keyPw ];
then
@ -110,6 +110,10 @@ echo -n "Moving key store and trust store to [$securityDir] ..."
mv $truststore $keystore $securityDir
echo "Done!"
echo "Keystores are located at $securityDir"
echo "The public key for this server is located at $(pwd)/$keyAlias$publicKeyFile"
echo "This file may be disseminated to other registry federation memebers who wish to interact with this server"
}
function addKey() {
@ -157,4 +161,4 @@ elif [ "$1" = "-usage" ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]
then
usage
exit 0
fi
fi

View file

@ -58,7 +58,6 @@
</bean>
<!-- QUERY -->
<!-- Define concrete implementation of the service -->
<bean id="queryServiceImpl"
class="com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImpl">
<property name="federationDao" ref="federationDao" />
@ -71,7 +70,6 @@
</bean>
<!-- NOTIFICATION LISTENER -->
<!-- Define concrete implementation of the service -->
<bean id="notificationServiceImpl"
class="com.raytheon.uf.edex.registry.ebxml.services.notification.NotificationListenerImpl">
<property name="lcm" ref="lcmServiceImpl" />
@ -82,7 +80,6 @@
<!-- LIFE CYCLE MANAGER -->
<!-- Define concrete implementation of the service -->
<bean id="lcmServiceImpl"
class="com.raytheon.uf.edex.registry.ebxml.services.lifecycle.LifecycleManagerImpl">
<property name="queryManager" ref="queryServiceImpl" />
@ -94,7 +91,6 @@
</bean>
<!-- VALIDATOR -->
<!-- Define concrete implementation of the service -->
<bean id="validatorServiceImpl"
class="com.raytheon.uf.edex.registry.ebxml.services.validator.ValidatorImpl">
<property name="queryManager" ref="queryServiceImpl" />
@ -102,35 +98,13 @@
<property name="registryObjectTypeValidator" ref="registryObjectTypeValidator" />
</bean>
<!-- CATALOGER -->
<!-- Define concrete implementation of the service -->
<bean id="catalogerServiceImpl"
class="com.raytheon.uf.edex.registry.ebxml.services.cataloger.CatalogerImpl">
<property name="registryObjectDao" ref="registryObjectDao" />
</bean>
<!-- REST Service Beans -->
<bean name="AddRegistryParty"
class="com.raytheon.uf.edex.registry.ebxml.web.AddRegistryParty">
<property name="partyDao" ref="partyDao" />
<property name="lcm" ref="lcmServiceImpl" />
<property name="webUtil" ref="RegistryWebUtil" />
</bean>
<bean name="ModifyRegistryParty"
class="com.raytheon.uf.edex.registry.ebxml.web.ModifyRegistryParty">
<property name="partyDao" ref="partyDao" />
<property name="lcm" ref="lcmServiceImpl" />
<property name="webUtil" ref="RegistryWebUtil" />
</bean>
<bean name="DeleteRegistryParty"
class="com.raytheon.uf.edex.registry.ebxml.web.DeleteRegistryParty">
<property name="partyDao" ref="partyDao" />
<property name="webUtil" ref="RegistryWebUtil" />
</bean>
<bean id="registryObjectsRestService"
class="com.raytheon.uf.edex.registry.ebxml.services.rest.RegistryObjectsRestService">
<property name="registryObjectDao" ref="registryObjectDao" />
@ -147,21 +121,6 @@
<property name="queryDefinitionDao" ref="queryDefinitionDao" />
</bean>
<bean id="RegistryWebUtil" class="com.raytheon.uf.edex.registry.ebxml.web.RegistryWebUtil">
<property name="lcm" ref="lcmServiceImpl" />
<property name="personDao" ref="personDao" />
<property name="classificationNodeDao" ref="classificationNodeDao" />
</bean>
<bean id="RegistryWebAdmin"
class="com.raytheon.uf.edex.registry.ebxml.web.RegistryWebAdmin">
<property name="partyDao" ref="partyDao" />
<property name="classificationNodeDao" ref="classificationNodeDao" />
<property name="organizationDao" ref="organizationDao" />
<property name="personDao" ref="personDao" />
<property name="roleDao" ref="roleDao" />
</bean>
<bean id="AuditableEventService"
class="com.raytheon.uf.edex.registry.ebxml.services.AuditableEventService">
<constructor-arg ref="AuditableEventTypeDao" />

View file

@ -1,176 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.registry.ebxml.web;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.SubmitObjectsRequest;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PartyType;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.edex.registry.ebxml.dao.PartyDao;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
import com.raytheon.uf.edex.registry.ebxml.services.lifecycle.LifecycleManagerImpl;
/**
*
* Servlet implementation used to add a user or organization to the registry.
* FIXME: This class will be refactored in a later ticket
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/31/2012 #724 bphillip Initial creation
* 3/13/2013 1082 bphillip Made transactional
* 4/19/2013 1931 bphillip Refactored to use web application spring container and cxf services
*
* </pre>
*
* @author bphillip
* @version 1.0
*/
@Path("/AddRegistryParty")
@Service
@Transactional
public class AddRegistryParty {
/** Serial */
private static final long serialVersionUID = 1422748054768442033L;
/** The logger */
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(AddRegistryParty.class);
/** The page to display upon success */
private static final String SUCCESS_RESPONSE_PAGE = "addPartySuccess";
/** the page to display upon failure */
private static final String ERROR_RESPONSE_PAGE = "addPartyFailure";
private PartyDao partyDao;
private LifecycleManagerImpl lcm;
private RegistryWebUtil webUtil;
@POST
@Produces("text/html")
public Response doPost(@Context HttpServletRequest request)
throws IOException {
String partyId = request.getParameter(WebFields.ID.fieldName());
String objectType = request
.getParameter(WebFields.OBJ_TYPE.fieldName());
PartyType existingParty = null;
// The EDEX internal user cannot be modified
if (partyId.equals(RegistryUtil.DEFAULT_OWNER)) {
return Response.serverError().build();
// webUtil.sendErrorResponse(request, response,
// ERROR_RESPONSE_PAGE, partyId, objectType,
// "Cannot modify EDEX Internal User");
}
/*
* Check to see if the party already exists. If so, the user cannot be
* added
*/
existingParty = partyDao.getById(partyId);
if (existingParty != null) {
statusHandler.error("Error adding " + objectType + " to registry. "
+ objectType + " " + partyId + " already exists");
return Response.serverError().build();
// webUtil.sendErrorResponse(request, response,
// ERROR_RESPONSE_PAGE, partyId, objectType, objectType
// + " Already Exists");
}
/*
* Create a new submit request containing the new party
*/
SubmitObjectsRequest submitRequest = null;
try {
submitRequest = webUtil.createParty(request);
} catch (EbxmlRegistryException e) {
statusHandler.error("Error creating " + objectType, e);
return Response.serverError().build();
// webUtil.sendErrorResponse(
// request,
// response,
// ERROR_RESPONSE_PAGE,
// partyId,
// objectType,
// "Error creating " + objectType + "\n"
// + e.getLocalizedMessage());
}
// Submit the objects to the registry
try {
lcm.submitObjects(submitRequest);
webUtil.updatePC(request);
} catch (Exception e) {
statusHandler.error("Error submitting new " + objectType
+ " to the registry", e);
return Response.serverError().build();
// webUtil.sendErrorResponse(
// request,
// response,
// ERROR_RESPONSE_PAGE,
// partyId,
// objectType,
// "Error submitting new " + objectType
// + " to the registry\n"
// + e.getLocalizedMessage());
}
// Send success response back to the caller
return Response.ok().build();
// webUtil.sendSuccessResponse(request, response, SUCCESS_RESPONSE_PAGE,
// partyId, objectType);
}
public void setWebUtil(RegistryWebUtil webUtil) {
this.webUtil = webUtil;
}
public void setPartyDao(PartyDao partyDao) {
this.partyDao = partyDao;
}
public void setLcm(LifecycleManagerImpl lcm) {
this.lcm = lcm;
}
}

View file

@ -1,144 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.registry.ebxml.web;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PartyType;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.edex.registry.ebxml.dao.PartyDao;
/**
*
* Servlet implementation used to delete a user or organization from the
* registry. FIXME: This class will be refactored in a later ticket
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/31/2012 #724 bphillip Initial creation
* 3/13/2013 1082 bphillip Made transactional
* 4/19/2013 1931 bphillip Refactored to use web application spring container and cxf services
*
* </pre>
*
* @author bphillip
* @version 1.0
*/
@Path("/DeleteRegistryParty")
@Service
@Transactional
public class DeleteRegistryParty {
/** The serial ID */
private static final long serialVersionUID = -9009661529309992652L;
/** The page to display upon success */
private static final String SUCCESS_RESPONSE_PAGE = "deletePartySuccess";
/** The page to display upon failure */
private static final String ERROR_RESPONSE_PAGE = "deletePartyFailure";
private PartyDao partyDao;
private RegistryWebUtil webUtil;
/** The logger */
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(DeleteRegistryParty.class);
@POST
@Produces("text/html")
public Response doPost(@Context HttpServletRequest request)
throws IOException {
String partyId = request.getParameter(WebFields.ID.fieldName());
String objectType = request
.getParameter(WebFields.OBJ_TYPE.fieldName());
PartyType existingParty = null;
// The EDEX internal user cannot be modified
if (partyId.equals(RegistryUtil.DEFAULT_OWNER)) {
return Response.serverError().build();
// webUtil.sendErrorResponse(request, response,
// ERROR_RESPONSE_PAGE, partyId, objectType,
// "Cannot remove EDEX Internal User");
}
/*
* Check if the party exists. If not, the party obviously cannot be
* deleted
*/
existingParty = partyDao.getById(partyId);
if (existingParty == null) {
return Response.serverError().build();
// webUtil.sendErrorResponse(request, response,
// ERROR_RESPONSE_PAGE, partyId, objectType,
// "Unable to delete " + objectType + " " + partyId + ". "
// + objectType + " does not exist");
}
/*
* Remove any associations to the party
*/
try {
webUtil.removeAssociations(existingParty);
webUtil.removeParty(existingParty);
} catch (Exception e) {
statusHandler.error("Error modifying user", e);
return Response.serverError().build();
// webUtil.sendErrorResponse(request, response,
// ERROR_RESPONSE_PAGE, partyId, objectType,
// "Error removing associations to " + objectType + "\n"
// + e.getLocalizedMessage());
}
// Send back a successful response to the requester
// webUtil.sendSuccessResponse(request, response,
// SUCCESS_RESPONSE_PAGE, partyId, objectType);
return Response.ok().build();
}
public void setPartyDao(PartyDao partyDao) {
this.partyDao = partyDao;
}
public void setWebUtil(RegistryWebUtil webUtil) {
this.webUtil = webUtil;
}
}

View file

@ -1,174 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.registry.ebxml.web;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.SubmitObjectsRequest;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PartyType;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.edex.registry.ebxml.dao.PartyDao;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
import com.raytheon.uf.edex.registry.ebxml.services.lifecycle.LifecycleManagerImpl;
/**
*
* Servlet implementation used to modify a user or organization in the registry
* FIXME: This class will be refactored in a later ticket
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/31/2012 #724 bphillip Initial creation
* 3/13/2013 1082 bphillip Made transactional
* 4/19/2013 1931 bphillip Refactored to use web application spring container and cxf services
*
* </pre>
*
* @author bphillip
* @version 1.0
*/
@Path("/DeleteRegistryParty")
@Service
@Transactional
public class ModifyRegistryParty {
/** The serial ID */
private static final long serialVersionUID = -2361555059266130462L;
/** Page to display upon success */
private static final String SUCCESS_RESPONSE_PAGE = "modifyPartySuccess";
/** Page to display upon failure */
private static final String ERROR_RESPONSE_PAGE = "modifyPartyFailure";
private PartyDao partyDao;
private LifecycleManagerImpl lcm;
private RegistryWebUtil webUtil;
/** The logger */
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(ModifyRegistryParty.class);
@POST
@Produces("text/html")
public Response doPost(@Context HttpServletRequest request)
throws IOException {
String partyId = request.getParameter(WebFields.ID.fieldName());
String objectType = request
.getParameter(WebFields.OBJ_TYPE.fieldName());
PartyType existingParty = null;
// The EDEX internal user cannot be modified
if (partyId.equals(RegistryUtil.DEFAULT_OWNER)) {
return Response.serverError().build();
// webUtil.sendErrorResponse(request, response,
// ERROR_RESPONSE_PAGE, partyId, objectType,
// "Cannot modify EDEX Internal User");
}
/*
* Check if the party already exists. If the party does not exist, the
* party cannot be modified. An error response is sent to the requester
*/
existingParty = partyDao.getById(partyId);
if (existingParty == null) {
return Response.serverError().build();
// webUtil.sendErrorResponse(request, response,
// ERROR_RESPONSE_PAGE, partyId, objectType,
// "Unable to modify " + objectType + " " + partyId + ". "
// + objectType + " does not exist");
}
/*
* Create the submit request
*/
SubmitObjectsRequest submitRequest = null;
try {
submitRequest = webUtil.createParty(request);
} catch (EbxmlRegistryException e) {
statusHandler.error("Error modifying user", e);
return Response.serverError().build();
// webUtil.sendErrorResponse(
// request,
// response,
// ERROR_RESPONSE_PAGE,
// partyId,
// objectType,
// "Error modifying " + objectType + "\n"
// + e.getLocalizedMessage());
}
/*
* Remove any associations originating from the modified party
*/
try {
webUtil.removeAssociationsFrom(existingParty);
lcm.submitObjects(submitRequest);
webUtil.updatePC(request);
} catch (Exception e) {
statusHandler.error("Error modifying user", e);
return Response.serverError().build();
// webUtil.sendErrorResponse(request, response,
// ERROR_RESPONSE_PAGE, partyId, objectType,
// "Error removing associations to " + objectType + "\n"
// + e.getLocalizedMessage());
}
/*
* Send back success message to the requester
*/
// webUtil.sendSuccessResponse(request, response, SUCCESS_RESPONSE_PAGE,
// partyId, objectType);
return Response.ok().build();
}
public void setPartyDao(PartyDao partyDao) {
this.partyDao = partyDao;
}
public void setWebUtil(RegistryWebUtil webUtil) {
this.webUtil = webUtil;
}
public void setLcm(LifecycleManagerImpl lcm) {
this.lcm = lcm;
}
}

View file

@ -1,457 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.registry.ebxml.web;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.EmailAddressType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.OrganizationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PartyType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PersonType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PostalAddressType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RoleType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.TelephoneNumberType;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
import com.raytheon.uf.edex.registry.ebxml.dao.ClassificationNodeDao;
import com.raytheon.uf.edex.registry.ebxml.dao.OrganizationDao;
import com.raytheon.uf.edex.registry.ebxml.dao.PartyDao;
import com.raytheon.uf.edex.registry.ebxml.dao.PersonDao;
import com.raytheon.uf.edex.registry.ebxml.dao.RoleDao;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
/**
* Class used to get registry information for displaying information on the Data
* Delivery Registry Admin Web Page
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/30/2012 724 bphillip Initial creation
* 3/13/2013 1082 bphillip Made transaction and modified to use spring injection
*
* </pre>
*
* @author bphillip
* @version 1.0
*/
@Transactional
public class RegistryWebAdmin {
/** Static list of role types */
private static final String[] ROLE_TYPES = new String[] {
"RegistryAdministrator", "RegistryLocalAdministrator",
"RegistryUser", "RegistryGuest" };
private PartyDao partyDao;
private ClassificationNodeDao classificationNodeDao;
private OrganizationDao organizationDao;
private PersonDao personDao;
private RoleDao roleDao;
/**
* Gets the array of address types from the registry
*
* @return The array of address types from the registry
* @throws EbxmlRegistryException
* If errors occur during database access
*/
public String[] getAddressTypes() throws EbxmlRegistryException {
List<String> result = classificationNodeDao.getAddressTypes();
return result.toArray(new String[result.size()]);
}
/**
* Gets the array of telephone number types from the registry
*
* @return The array of telephone number types from the registry
* @throws EbxmlRegistryException
* If errors occur during database access
*/
public String[] getTelephoneTypes() throws EbxmlRegistryException {
List<String> result = classificationNodeDao.getTelephoneTypes();
return result.toArray(new String[result.size()]);
}
/**
* Gets the array of email address types from the registry
*
* @return The array of email address types from the registry
* @throws EbxmlRegistryException
* If errors occur during database access
*/
public String[] getEmailTypes() throws EbxmlRegistryException {
List<String> result = classificationNodeDao.getEmailTypes();
return result.toArray(new String[result.size()]);
}
/**
* Gets the static list of role types
*
* @return The static list of role types
*/
public String[] getRoleTypes() {
return ROLE_TYPES;
}
/**
* Gets organization names for names matching the provided search criteria
*
* @param name
* The name (may be a partial name) of the organization to search
* for
* @return The list of organization names matching the given search criteria
* @throws EbxmlRegistryException
* If errors occur during database access
*/
public String[] getOrganizationNames(String name)
throws EbxmlRegistryException {
List<OrganizationType> orgs = organizationDao
.getOrganizationByName(name);
List<String> retVal = new ArrayList<String>(orgs.size());
for (OrganizationType org : orgs) {
retVal.add(org.getId());
}
return retVal.toArray(new String[retVal.size()]);
}
/**
* Gets the HTML formatted table with the details for the given organization
*
* @param name
* The name of the organization to get details for
* @return The HTML formatted table with the details of the given
* organization
* @throws EbxmlRegistryException
* If errors occur during database access
*/
public String getOrganization(String name) throws EbxmlRegistryException {
// Instantiate the necessary data access objects
StringBuffer retVal = new StringBuffer(1024);
// Query the organization table for matching organization names
List<OrganizationType> orgs = organizationDao
.getOrganizationByName(name);
if (orgs.size() == 1) {
retVal.append("<b>" + orgs.size() + " Match</b>");
} else {
retVal.append("<b>" + orgs.size() + " Matches</b>");
}
retVal.append("<table>");
retVal.append("<tr>");
retVal.append("<th>ID</th>");
retVal.append("<th>Name</th>");
retVal.append("<th>Local Admin</th>");
retVal.append("<th>Users</th>");
retVal.append("</tr>");
/*
* Loop over the returned organizations and fill in the table rows
*/
for (OrganizationType org : orgs) {
String primaryContactId = org.getPrimaryContact();
PersonType primaryContact = personDao.getById(primaryContactId);
String pcString = "";
if (primaryContact != null) {
pcString = "<a id=\"" + primaryContactId
+ "\" onclick=\"getUserDetails(" + "'"
+ primaryContactId + "'" + ")\">"
+ primaryContact.getPersonName().getFirstName() + " "
+ primaryContact.getPersonName().getLastName() + "</a>";
}
String orgId = org.getId();
retVal.append("<tr>");
retVal.append("<td>")
.append("<a id=\"" + orgId
+ "\" onclick=\"getOrgDetails(this.id)\">" + orgId
+ "</a>").append("</td>");
retVal.append("<td>")
.append(org.getName().getLocalizedString().get(0)
.getValue()).append("</td>");
retVal.append("<td>").append(pcString).append("</td>");
List<PersonType> users = personDao
.getEmployeesOfOrganization(orgId);
retVal.append("<td style=\"word-wrap: break-word\">");
for (int i = 0; i < users.size(); i++) {
retVal.append("<a id=\"" + orgId
+ "\" onclick=\"getUserDetails(" + "'"
+ users.get(i).getId() + "'" + ")\">"
+ users.get(i).getPersonName().getFirstName() + " "
+ users.get(i).getPersonName().getLastName() + "</a>");
if (i != users.size() - 1) {
retVal.append(", ");
}
}
retVal.append("</td>").append("</tr>");
}
retVal.append("</table>");
return retVal.toString();
}
/**
* Gets the HTML formatted table with details for the given user name
*
* @param firstName
* The first name of the user to search for
* @param lastName
* The last name of the user to search for
* @return The HTML formatted table with the details for the given user name
* @throws EbxmlRegistryException
* If errors occur during database access
*/
public String getUser(String firstName, String lastName)
throws EbxmlRegistryException {
// Instantiate the necessary data access objects
StringBuffer retVal = new StringBuffer(1024);
// Query for users matching the given search criteria
List<PersonType> users = personDao.getByFirstAndLastName(firstName,
lastName);
for (int i = 0; i < users.size(); i++) {
if (users.get(i).getId().equals(RegistryUtil.DEFAULT_OWNER)) {
users.remove(i);
break;
}
}
if (users.size() == 1) {
retVal.append("<b>" + users.size() + " Match</b>");
} else {
retVal.append("<b>" + users.size() + " Matches</b>");
}
retVal.append("<table>");
retVal.append("<tr>");
retVal.append("<th>ID</th>");
retVal.append("<th>Name</th>");
retVal.append("<th>Organization</th>");
retVal.append("<th>Role</th>");
retVal.append("</tr>");
/*
* Loop over the returned users and populate the table
*/
for (PersonType user : users) {
String userId = user.getId();
OrganizationType userOrg = organizationDao
.getOrganizationForUser(userId);
RoleType userRole = roleDao.getUserRole(userId);
retVal.append("<tr>");
retVal.append("<td>")
.append("<a id=\"" + userId
+ "\" onclick=\"getUserDetails(this.id)\">"
+ userId + "</a>").append("</td>");
retVal.append("<td>")
.append(user.getPersonName().getFirstName() + " "
+ user.getPersonName().getLastName())
.append("</td>");
if (userOrg == null) {
retVal.append("<td></td>");
} else {
retVal.append("<td>")
.append("<a id=\"" + userOrg.getId() + userId
+ "\" onclick=\"getOrgDetails('"
+ userOrg.getId() + "')\">" + userOrg.getId()
+ "</a>").append("</td>");
}
if (userRole == null) {
retVal.append("<td></td>");
} else {
retVal.append("<td>").append(userRole.getId()).append("</td>");
}
retVal.append("</tr>");
}
retVal.append("</table>");
return retVal.toString();
}
/**
* Get the details of a party(user or organization) to populate the web form
*
* @param objId
* The id of the party to get information for
* @return The details of the party as a property map in string format
* @throws EbxmlRegistryException
* If errors occur during database access
*/
public String getPartyDetails(String objId) throws EbxmlRegistryException {
/*
* Spaces need to be converted from the hex value to the actual space
* character
*/
objId = objId.replaceAll("%20", " ");
Map<String, String> propMap = new HashMap<String, String>();
PartyType party = partyDao.getById(objId);
if (party == null) {
return "";
}
propMap.put(WebFields.ID.field(), party.getId());
if (party instanceof PersonType) {
propMap.put(WebFields.FIRST_NAME.field(), ((PersonType) party)
.getPersonName().getFirstName());
propMap.put(WebFields.MIDDLE_NAME.field(), ((PersonType) party)
.getPersonName().getMiddleName());
propMap.put(WebFields.LAST_NAME.field(), ((PersonType) party)
.getPersonName().getLastName());
OrganizationType userOrg = organizationDao
.getOrganizationForUser(party.getId());
String orgId = "";
if (userOrg != null) {
orgId = userOrg.getId();
}
RoleType role = roleDao.getUserRole(party.getId());
String roleId = "";
if (role != null) {
roleId = role.getId();
}
propMap.put(WebFields.USER_ORG.field(), orgId);
propMap.put(WebFields.USER_ROLE.field(), roleId);
} else if (party instanceof OrganizationType) {
propMap.put(WebFields.ORGANIZATION_NAME.field(), party.getName()
.getLocalizedString().get(0).getValue());
PersonType primaryContact = personDao
.getById(((OrganizationType) party).getPrimaryContact());
if (primaryContact == null) {
propMap.put(WebFields.PRIMARY_CONTACT.field(), "Not Specified");
} else {
propMap.put(WebFields.PRIMARY_CONTACT.field(), "<a id=\""
+ primaryContact.getId()
+ "\" onclick=\"getUserDetails(this.id)\">"
+ primaryContact.getPersonName().getLastName() + ", "
+ primaryContact.getPersonName().getFirstName()
+ "</a>");
}
}
if (!party.getPostalAddress().isEmpty()) {
PostalAddressType addr = party.getPostalAddress().get(0);
propMap.put(WebFields.ADDRESS_TYPE.field(),
classificationNodeDao.getCodeFromNode(addr.getType()));
propMap.put(WebFields.ADDRESS_1.field(), addr.getStreet());
propMap.put(WebFields.ADDRESS_2.field(), addr.getStreetNumber());
propMap.put(WebFields.CITY.field(), addr.getCity());
propMap.put(WebFields.STATE.field(), addr.getStateOrProvince());
propMap.put(WebFields.COUNTRY.field(), addr.getCountry());
propMap.put(WebFields.POSTAL_CODE.field(), addr.getPostalCode());
}
if (!party.getTelephoneNumber().isEmpty()) {
TelephoneNumberType phone = party.getTelephoneNumber().get(0);
propMap.put(WebFields.TELEPHONE_TYPE.field(),
classificationNodeDao.getCodeFromNode(phone.getType()));
propMap.put(WebFields.AREA_CODE.field(), phone.getAreaCode());
if (phone.getNumber().length() == 7) {
propMap.put(WebFields.PHONE_1.field(), phone.getNumber()
.substring(0, 3));
propMap.put(WebFields.PHONE_2.field(), phone.getNumber()
.substring(3));
}
propMap.put(WebFields.EXTENSION.field(), phone.getExtension());
}
if (!party.getEmailAddress().isEmpty()) {
EmailAddressType email = party.getEmailAddress().get(0);
propMap.put(WebFields.EMAIL_TYPE.field(),
classificationNodeDao.getCodeFromNode(email.getType()));
propMap.put(WebFields.EMAIL.field(), email.getAddress());
}
return mapToString(propMap);
}
/**
* Gets the array of ids associated with users. This function is used to
* list the members of a given organization
*
* @return The array of user ids and names
* @throws EbxmlRegistryException
* If errors occur during database access
*/
public String[] getUserIdsAndNames() throws EbxmlRegistryException {
@SuppressWarnings("unchecked")
List<Object[]> allUsers = (List<Object[]>) personDao.getAllUserNames();
List<String> retVal = new ArrayList<String>(allUsers.size());
for (Object[] userInfo : allUsers) {
for (Object obj : userInfo) {
retVal.add(obj.toString());
}
}
return retVal.toArray(new String[] {});
}
public String mapToString(Map<String, String> map) {
StringBuffer retVal = new StringBuffer();
int idx = 0;
for (String key : map.keySet()) {
retVal.append(key).append("===").append(map.get(key));
if (idx != map.size() - 1) {
retVal.append("_____");
}
idx++;
}
return retVal.toString();
}
public void setPartyDao(PartyDao partyDao) {
this.partyDao = partyDao;
}
public void setClassificationNodeDao(
ClassificationNodeDao classificationNodeDao) {
this.classificationNodeDao = classificationNodeDao;
}
public void setOrganizationDao(OrganizationDao organizationDao) {
this.organizationDao = organizationDao;
}
public void setPersonDao(PersonDao personDao) {
this.personDao = personDao;
}
public void setRoleDao(RoleDao roleDao) {
this.roleDao = roleDao;
}
}

View file

@ -1,554 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.registry.ebxml.web;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException;
import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.Mode;
import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.RemoveObjectsRequest;
import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.SubmitObjectsRequest;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.EmailAddressType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.OrganizationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PartyType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PersonNameType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PersonType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PostalAddressType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.TelephoneNumberType;
import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryExceptionType;
import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseStatus;
import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType;
import com.raytheon.uf.common.registry.constants.AssociationTypes;
import com.raytheon.uf.common.registry.constants.RegistryObjectTypes;
import com.raytheon.uf.common.registry.constants.StatusTypes;
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
import com.raytheon.uf.edex.registry.ebxml.dao.AssociationDao;
import com.raytheon.uf.edex.registry.ebxml.dao.ClassificationNodeDao;
import com.raytheon.uf.edex.registry.ebxml.dao.OrganizationDao;
import com.raytheon.uf.edex.registry.ebxml.dao.PersonDao;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
import com.raytheon.uf.edex.registry.ebxml.services.lifecycle.LifecycleManagerImpl;
import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
/**
* Utility class used to modify parties in the registry
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/30/2012 724 bphillip Initial creation
* 3/13/2013 1082 bphillip Modified to use spring injection
* Apr 23, 2013 1910 djohnson RegistryResponseStatus is now an enum.
* Mar 31, 2014 2889 dhladky Added username for notification center tracking.
*
* </pre>
*
* @author bphillip
* @version 1.0
*/
public class RegistryWebUtil {
private LifecycleManagerImpl lcm;
private ClassificationNodeDao classificationNodeDao;
private PersonDao personDao;
/**
* Creates a party (user or organization) based on parameters contained in
* the servlet request
*
* @param request
* The servlet request object
* @return The registry submit object request
* @throws EbxmlRegistryException
* If errors occur during registry interaction
*/
public SubmitObjectsRequest createParty(HttpServletRequest request)
throws EbxmlRegistryException {
List<RegistryObjectType> objectList = new ArrayList<RegistryObjectType>();
String partyId = request.getParameter("id");
PartyType party = null;
// Creating a user object
if (request.getParameter(WebFields.OBJ_TYPE.fieldName()).equals("User")) {
String employer = request.getParameter(WebFields.USER_ORG
.fieldName());
String roleName = request.getParameter(WebFields.USER_ROLE
.fieldName());
party = new PersonType();
/*
* Assign the person name to the person
*/
PersonNameType personName = new PersonNameType();
personName.setFirstName(request.getParameter(WebFields.FIRST_NAME
.fieldName()));
if (request.getParameter(WebFields.MIDDLE_NAME.fieldName()) == null) {
personName.setMiddleName("");
} else {
personName.setMiddleName(request
.getParameter(WebFields.MIDDLE_NAME.fieldName()));
}
personName.setLastName(request.getParameter(WebFields.LAST_NAME
.fieldName()));
((PersonType) party).setPersonName(personName);
party.setLid(partyId);
party.setOwner(RegistryUtil.DEFAULT_OWNER);
party.setStatus(StatusTypes.APPROVED);
party.setName(RegistryUtil.getInternationalString("User "
+ personName.getFirstName() + " "
+ personName.getMiddleName() + " "
+ personName.getLastName()));
party.setDescription(RegistryUtil
.getInternationalString("Profile description for user "
+ personName.getFirstName() + " "
+ personName.getMiddleName() + " "
+ personName.getLastName()));
party.setObjectType(RegistryObjectTypes.PERSON);
/* Create an association to the organization if specified */
if (!employer.trim().isEmpty()) {
objectList.add(createEmployeeOfAssociation(partyId, employer));
}
/* Create an association to the role if specified */
if (!roleName.trim().isEmpty()) {
objectList.add(createHasRoleAssociation(partyId, roleName));
}
}
// Creating an organization
else {
party = new OrganizationType();
party.setLid(partyId);
party.setOwner(RegistryUtil.DEFAULT_OWNER);
party.setStatus(StatusTypes.APPROVED);
party.setName(RegistryUtil.getInternationalString(request
.getParameter(WebFields.ORGANIZATION_NAME.fieldName())));
String primaryContactStr = request
.getParameter(WebFields.PRIMARY_CONTACT.fieldName());
// Setting the primary contact name
if (!primaryContactStr.equals("Not Specified")
&& !primaryContactStr.isEmpty()) {
String[] nameTokens = primaryContactStr.split(", ");
((OrganizationType) party).setPrimaryContact(personDao
.getByFirstAndLastName(nameTokens[1], nameTokens[0])
.get(0).getId());
}
party.setDescription(RegistryUtil
.getInternationalString("Profile description for organization "
+ partyId));
party.setObjectType(RegistryObjectTypes.ORGANIZATION);
}
// Assign the postal address
PostalAddressType address = new PostalAddressType();
address.setType(classificationNodeDao.getNodeFromCode(request
.getParameter(WebFields.ADDRESS_TYPE.fieldName())));
address.setStreet(request.getParameter(WebFields.ADDRESS_1.fieldName()));
address.setStreetNumber(request.getParameter(WebFields.ADDRESS_2
.fieldName()));
address.setCity(request.getParameter(WebFields.CITY.fieldName()));
address.setCountry(request.getParameter(WebFields.COUNTRY.fieldName()));
address.setStateOrProvince(request.getParameter(WebFields.STATE
.fieldName()));
address.setPostalCode(request.getParameter(WebFields.POSTAL_CODE
.fieldName()));
party.getPostalAddress().add(address);
// Assign the telephone number
TelephoneNumberType phone = new TelephoneNumberType();
phone.setType(classificationNodeDao.getNodeFromCode(request
.getParameter(WebFields.TELEPHONE_TYPE.fieldName())));
phone.setAreaCode(request.getParameter(WebFields.AREA_CODE.fieldName()));
phone.setNumber(request.getParameter(WebFields.PHONE_1.fieldName())
+ request.getParameter(WebFields.PHONE_2.fieldName()));
phone.setExtension(request.getParameter(WebFields.EXTENSION.fieldName()));
party.getTelephoneNumber().add(phone);
// Assign the email address
EmailAddressType email = new EmailAddressType();
email.setType(classificationNodeDao.getNodeFromCode(request
.getParameter(WebFields.EMAIL_TYPE.fieldName())));
email.setAddress(request.getParameter(WebFields.EMAIL.fieldName()));
party.getEmailAddress().add(email);
party.setId(partyId);
objectList.add(party);
return getSubmitRequest(objectList);
}
/**
* Creates an association from a user to an organization
*
* @param user
* The user (The source of the association)
* @param organization
* The organization (The target of the association)
* @return The association object
* @throws EbxmlRegistryException
* If errors occur during database interaction
*/
private AssociationType createEmployeeOfAssociation(String user,
String organization) throws EbxmlRegistryException {
AssociationType association = new AssociationType();
association.setId(EbxmlObjectUtil.getUUID());
association.setLid(association.getId());
association.setName(RegistryUtil.getInternationalString(user + "-->"
+ organization));
association.setDescription(RegistryUtil.getInternationalString(user
+ " is an employee of " + organization));
association.setStatus(StatusTypes.APPROVED);
association.setOwner(RegistryUtil.DEFAULT_OWNER);
association.setObjectType(RegistryObjectTypes.ASSOCIATION);
association.setSourceObject(user);
association.setTargetObject(organization);
association.setType(AssociationTypes.EMPLOYEE_OF);
return association;
}
/**
* Creates an association from a user to a role
*
* @param user
* The user (The source of the association)
* @param roleName
* The role (The target of the association)
* @return The association object
*/
private AssociationType createHasRoleAssociation(String user,
String roleName) {
AssociationType association = new AssociationType();
association.setId(EbxmlObjectUtil.getUUID());
association.setLid(association.getId());
association.setName(RegistryUtil.getInternationalString(user + "-->"
+ roleName));
association.setDescription(RegistryUtil.getInternationalString(user
+ " has role of " + roleName));
association.setStatus(StatusTypes.APPROVED);
association.setOwner(RegistryUtil.DEFAULT_OWNER);
association.setObjectType(RegistryObjectTypes.ASSOCIATION);
association.setSourceObject(user);
association.setTargetObject(roleName);
association.setType(AssociationTypes.HAS_ROLE);
return association;
}
/**
* Sends a successful response back the servlet requester
*
* @param request
* The servlet request
* @param response
* The servlet response
* @param responsePage
* The page to display
* @param userId
* The requester's user ID
* @param partyType
* The type of party
* @throws ServletException
* If an error occurs while sending the response back
* @throws IOException
* If the message cannot be forwarded
*/
public void sendSuccessResponse(HttpServletRequest request,
HttpServletResponse response, String responsePage, String userId,
String partyType) throws ServletException, IOException {
request.setAttribute("partyType", partyType);
request.setAttribute("userId", userId);
request.getRequestDispatcher("/response/" + responsePage + ".jsp")
.forward(request, response);
}
/**
* Sends an error response back to the servlet requester
*
* @param request
* The servlet request
* @param response
* The servlet response
* @param responsePage
* The page to display
* @param userId
* The requester's user ID
* @param partyType
* The type of the party
* @param cause
* The cause of the error
* @throws ServletException
* If an error occurs while sending the response back
* @throws IOException
* If the message cannot be forwarded
*/
public void sendErrorResponse(HttpServletRequest request,
HttpServletResponse response, String responsePage, String userId,
String partyType, String cause) throws ServletException,
IOException {
request.setAttribute("partyType", partyType);
request.setAttribute("userId", userId);
request.setAttribute("cause", cause);
request.getRequestDispatcher("/response/" + responsePage + ".jsp")
.forward(request, response);
}
/**
* Removes all associations to and from a given party
*
* @param party
* The party for which to remove associations to and from
* @throws EbxmlRegistryException
* If errors occur during database interaction
* @throws MsgRegistryException
* If errors occur when submitting the remove object request
*/
public void removeAssociations(PartyType party)
throws EbxmlRegistryException, MsgRegistryException {
AssociationDao associationDao = new AssociationDao();
List<AssociationType> associations = associationDao
.getAllAssociations(party.getId());
if (!associations.isEmpty()) {
RemoveObjectsRequest removeRequest = getRemoveRequest(associations);
lcm.removeObjects(removeRequest);
}
}
/**
* Removes associations with the source specified as the given party
*
* @param party
* The source of the associations to remove
* @throws EbxmlRegistryException
* If errors occur during database interaction
* @throws MsgRegistryException
* If errors occur when submitting the remove object request
*/
public void removeAssociationsFrom(PartyType party)
throws EbxmlRegistryException, MsgRegistryException {
AssociationDao associationDao = new AssociationDao();
List<AssociationType> associations = associationDao
.getAssociationsFrom(party.getId());
if (!associations.isEmpty()) {
RemoveObjectsRequest removeRequest = getRemoveRequest(associations);
lcm.removeObjects(removeRequest);
}
}
/**
* Removes associations with the target specified as the given party
*
* @param party
* The target of the associations to remove
* @throws EbxmlRegistryException
* If errors occur during database interaction
* @throws MsgRegistryException
* If errors occur when submitting the remove object request
*/
public void removeAssociationsTo(PartyType party)
throws EbxmlRegistryException, MsgRegistryException {
AssociationDao associationDao = new AssociationDao();
List<AssociationType> associations = associationDao
.getAssociationsTo(party.getId());
if (!associations.isEmpty()) {
RemoveObjectsRequest removeRequest = getRemoveRequest(associations);
lcm.removeObjects(removeRequest);
}
}
/**
* Updates the primary contact information for a given request
*
* @param request
* The servlet request
* @throws EbxmlRegistryException
* If errors occur during database interaction
*/
public void updatePC(HttpServletRequest request)
throws EbxmlRegistryException {
if (request.getParameter(WebFields.OBJ_TYPE.fieldName()).equals("User")) {
String user = request.getParameter(WebFields.ID.fieldName());
String orgName = request.getParameter(WebFields.USER_ORG
.fieldName());
String roleName = request.getParameter(WebFields.USER_ROLE
.fieldName());
OrganizationDao orgDao = new OrganizationDao();
OrganizationType org = orgDao.getOrganizationByName(orgName).get(0);
String currentPrimaryContact = org.getPrimaryContact();
boolean update = false;
if (currentPrimaryContact == null
|| roleName.equals("RegistryLocalAdministrator")) {
org.setPrimaryContact(user);
update = true;
} else if (currentPrimaryContact.equals(user)) {
org.setPrimaryContact(null);
update = true;
}
if (update) {
orgDao.createOrUpdate(org);
}
}
}
/**
* Deletes a party from the registry
*
* @param party
* The party to delete
* @throws EbxmlRegistryException
* If errors occur during database interaction
* @throws MsgRegistryException
* If errors occur when submitting the remove objects request
*/
public void removeParty(PartyType party) throws EbxmlRegistryException,
MsgRegistryException {
RemoveObjectsRequest request = getRemoveRequest(party);
RegistryResponseType response = lcm.removeObjects(request);
if (!response.getStatus().equals(RegistryResponseStatus.SUCCESS)) {
StringBuilder exceptionText = new StringBuilder();
exceptionText.append("Remove Objects Failed:\n");
for (RegistryExceptionType exception : response.getException()) {
exceptionText.append("Exception: ")
.append(exception.getMessage()).append(":")
.append(exception.getDetail()).append("\n");
throw new EbxmlRegistryException(exceptionText.toString());
}
}
}
/**
* Constructs a submit object request to be submitted to the
* LifecycleManager with the given objects as the payload
*
* @param <T>
* RegistryObjectType
* @param obj
* The object to be submitted to the registry
* @return The submit object request
*/
public <T extends RegistryObjectType> SubmitObjectsRequest getSubmitRequest(
T obj) {
List<RegistryObjectType> objs = new ArrayList<RegistryObjectType>();
objs.add(obj);
return getSubmitRequest(objs);
}
/**
* Constructs a submit object request to be submitted to the
* LifecycleManager with the given objects as the payload
*
* @param <T>
* RegistryObjectType
* @param objs
* The objects to be submitted to the registry
* @return The submit object request
*/
public <T extends RegistryObjectType> SubmitObjectsRequest getSubmitRequest(
List<T> objs) {
SubmitObjectsRequest submitRequest = new SubmitObjectsRequest();
submitRequest.setComment("Object submission");
submitRequest.setCheckReferences(false);
submitRequest.setMode(Mode.CREATE_OR_REPLACE);
submitRequest.setUsername(RegistryUtil.registryUser);
submitRequest.setId("User/Organization Profiles and Roles");
submitRequest.setRegistryObjectList(EbxmlObjectUtil
.createRegistryObjectList(objs));
return submitRequest;
}
/**
* Constructs a remove object request to be submitted to the
* LifecycleManager with the given object as the payload
*
* @param <T>
* RegistryObjectType
* @param obj
* The object to be removed from the registry
* @return The RemoveObjectRequest object
*/
public <T extends RegistryObjectType> RemoveObjectsRequest getRemoveRequest(
T obj) {
List<RegistryObjectType> objs = new ArrayList<RegistryObjectType>(1);
objs.add(obj);
return getRemoveRequest(objs);
}
/**
* Constructs a remove object request to be submitted to the
* LifecycleManager with the given objects as the payload
*
* @param <T>
* RegistryObjectType
* @param objs
* The objects to be removed from the registry
* @return The RemoveObjectRequest object
*/
public <T extends RegistryObjectType> RemoveObjectsRequest getRemoveRequest(
List<T> objs) {
StringBuilder comment = new StringBuilder(objs.size() * 38);
comment.append("Removing objects: ");
for (RegistryObjectType regObj : objs) {
comment.append("[");
comment.append(regObj.getId());
comment.append("] ");
}
RemoveObjectsRequest request = new RemoveObjectsRequest();
request.setId(EbxmlObjectUtil.getUUID());
request.setComment(comment.toString());
request.setObjectRefList(EbxmlObjectUtil.createObjectRefList(objs));
return request;
}
public void setLcm(LifecycleManagerImpl lcm) {
this.lcm = lcm;
}
public void setClassificationNodeDao(
ClassificationNodeDao classificationNodeDao) {
this.classificationNodeDao = classificationNodeDao;
}
public void setPersonDao(PersonDao personDao) {
this.personDao = personDao;
}
}

View file

@ -1,181 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.registry.ebxml.web;
/**
* Utility enum class used to defined the fields on the Data Delivery Registry
* Web interface pages
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/30/2012 724 bphillip Initial creation
*
* </pre>
*
* @author bphillip
* @version 1.0
*/
public enum WebFields {
/** The user ID field */
ID("id", TYPE.Text),
/**
* The object type metadata information. Valid values are User and
* Organization
*/
OBJ_TYPE("objType", TYPE.Meta),
/** The action being performed on the web page */
ACTION("action", TYPE.Meta),
/** The first name field */
FIRST_NAME("firstName", TYPE.Text),
/** The middle name field */
MIDDLE_NAME("middlName", TYPE.Text),
/** The last name field */
LAST_NAME("lastName", TYPE.Text),
/** The user organization field */
USER_ORG("userOrg", TYPE.Select),
/** The organization name field */
ORGANIZATION_NAME("organizationName", TYPE.Text),
/** The user role field */
USER_ROLE("userRole", TYPE.Select),
/** The address type field */
ADDRESS_TYPE("addressType", TYPE.Select),
/** The address 1 field */
ADDRESS_1("streetAddress1", TYPE.Text),
/** The address 2 field */
ADDRESS_2("streetAddress2", TYPE.Text),
/** The city field */
CITY("city", TYPE.Text),
/** The state field */
STATE("state", TYPE.Select),
/** The country field */
COUNTRY("country", TYPE.Select),
/** The postal code field */
POSTAL_CODE("postalCode", TYPE.Text),
/** The telephone type field */
TELEPHONE_TYPE("telephoneType", TYPE.Select),
/** The area code field */
AREA_CODE("areaCode", TYPE.Text),
/** The telephone number prefix field */
PHONE_1("phone1", TYPE.Text),
/** The telephone number suffix field */
PHONE_2("phone2", TYPE.Text),
/** The telephone extension field */
EXTENSION("extension", TYPE.Text),
/** The email type field */
EMAIL_TYPE("emailType", TYPE.Select),
/** The email address field */
EMAIL("email", TYPE.Text),
/** The primary contact field */
PRIMARY_CONTACT("primaryContact", TYPE.Span);
/**
* The type of HTML element
*
* @author bphillip
*
*/
private enum TYPE {
/** A text field */
Text,
/** A select box */
Select,
/** An HTML span */
Span,
/** A metadata element not displayed on the web page */
Meta
}
/** The name of the field on the web page */
private final String fieldName;
/** The type of the field on the web page */
private final TYPE fieldType;
/**
* Constructs a new web field with the given name and type
*
* @param fieldName
* The name of the field
* @param fieldType
* The type of the field
*/
WebFields(String fieldName, TYPE fieldType) {
this.fieldName = fieldName;
this.fieldType = fieldType;
}
/**
* Gets the name of the field
*
* @return The name of the field
*/
public String fieldName() {
return this.fieldName;
}
/**
* Gets the type of the field
*
* @return The type of the field
*/
public String fieldType() {
return this.fieldType.toString();
}
/**
* Gets the name and type of the field concatenated together
*
* @return The name and type of the field concatenated together
*/
public String field() {
return this.fieldName + fieldType.toString();
}
}

View file

@ -1,150 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 0 Transitional//EN">
<html>
<head>
<style type="text/css">
a {font-weight:bold;}
td {width:270px;}
input{width:200px;}
table {border:0;}
select {width:200px;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" media="screen, projection" href="dataDelivery.css"/>
<script type="text/javascript" src='/dwr/engine.js'></script>
<script type="text/javascript" src='/dwr/util.js'></script>
<script type='text/javascript' src='/dwr/interface/RegistryWeb.js'></script>
<script type='text/javascript' src='/dataDeliveryUtil.js'></script>
<script type='text/javascript' src='/validateForm.js'></script>
<title>Data Delivery Registry Admin: Add New Organization</title>
</head>
<body onLoad="populateFormData('Organization')">
<span id="titleSpan" style="font-weight:bold; font-size:20pt"></span>
<p>
<a href="javascript:javascript:history.go(-1)">Back</a>
<br>
<a href="RegistryOrganizationMenu.html">Organization Search</a>
<a href="RegistryUserMenu.html">User Search</a>
<hr width="500" align="left"/>
<button id="deleteOrgButton" onclick="deleteParty()">Delete Organization</button>
<button id="modifyOrgButton" onclick="goToModifyOrg()">Modify Organization</button>
<h4>Organization Name</h4>
<table>
<tr>
<td>Organization ID</td>
<td><input id="idText" type="text"/></td>
</tr>
<tr>
<td>Organization Name</td>
<td><input id="organizationNameText" type="text"/></td>
</tr>
<tr>
<td>Local Registry Admin</td>
<td><span id="primaryContactSpan">Not Specified</td>
</tr>
</table>
<hr width="100" align="left"/>
<h4>Primary Address</h4>
<table>
<tr>
<td>Address Type</td>
<td><select id="addressTypeSelect"></select></td>
</tr>
<tr>
<td>Address 1</td>
<td><input id="streetAddress1Text" type="text"/></td>
</tr>
<tr>
<td>Address 2</td>
<td><input id="streetAddress2Text" type="text"/></td>
</tr>
<tr>
<td>City</td>
<td><input id="cityText" type="text"/></td>
</tr>
<tr>
<td>State/Province</td>
<td><select id="stateSelect"\></td>
</tr>
<tr>
<td>Country</td>
<td><select onclick="populateStates('stateSelect')" id="countrySelect"\></td>
</tr>
<tr>
<td>Postal Code</td>
<td><input id="postalCodeText" type="text"/></td>
</tr>
</table>
<hr width="100" align="left"/>
<h4>Primary Telephone</h4>
<table>
<tr>
<td>Telephone Type</td>
<td><select id="telephoneTypeSelect"></select></td>
</tr>
<tr>
<td>Telephone Number</td>
<td>(<input id="areaCodeText" type="text" maxlength=3 style='width: 28px;'/>)
<input id="phone1Text" type="text" maxlength=3 style='width: 28px;'/>-
<input id="phone2Text" type="text" maxlength=4 style='width: 36px;'/>
Ext:<input id="extensionText" type="text" maxlength=8 style='width: 70px;'/>
</td>
</tr>
</table>
<hr width="100" align="left" />
<h4>Primary Email</h4>
<table>
<tr>
<td>Email Type</td>
<td><select id="emailTypeSelect"></select></td>
</tr>
<tr>
<td>Email Address</td>
<td><input id="emailText" type="text" style='width: 260px;'/>
</tr>
</table>
<hr width="100" align="left"/>
<p>
<button id="userActionButton" type="button" onclick="partyAction()"/>
</body>
<script language="JavaScript">
/*
* The user currently be looked at by this page. Null if none
*/
self.userId = getUserId();
/*
* The current mode of the page. Valid modes are 'add', 'modify', and 'view'
* The add mode is used when adding a new user to the registry
* The modify mode is used when modifying a user in the registry
* The view mode is used when viewing a user in the registry
*/
self.mode=getMode()
RegistryWeb.getUserIdsAndNames(function(users){
//clearComboBox("primaryContactSelect");
//addOptionToList("primaryContactSelect","","");
//for(var i = 0; i < users.length; i+=3){
//addOptionToList("primaryContactSelect",users[i+2]+", "+users[i+1]+" ("+users[i]+")", users[i]);
//}
});
/*
* This function redirects the browser to the registry user interface in the modify mode
*/
function goToModifyOrg(){
window.location="RegistryOrganizationInterface.html?id="+self.userId+"&mode=modify"
}
</script>
</html>

View file

@ -1,53 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<style type="text/css">
a {font-weight:bold;}
table{border:3;}
td {width:200; background-color:deepskyblue}
th {width:200; background-color:aqua; font-size:14pt;}
input{width:200;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" media="screen, projection" href="dataDelivery.css"/>
<script type="text/javascript" src='/dwr/engine.js'></script>
<script type="text/javascript" src='/dwr/util.js'></script>
<script type='text/javascript' src='/dwr/interface/RegistryWeb.js'></script>
<script type='text/javascript' src='/dataDeliveryUtil.js'></script>
<title>Data Delivery Registry Organization Admin</title>
</head>
<body onload="getOrgs()">
<h2>Registry Organization Management Interface</h2>
<a href="RegistryUserMenu.html">View Users</a>
<p>
<table>
<tr>
<td style="width:100; background-color: transparent">Name</td>
<td style="width:100; background-color: transparent"> <input type="text" id="nameText" onkeyup="getOrgs()"/></td>
</tr>
</table>
<p>
<p>
<hr width="500" align="left"/>
<p>
<button type="button" id="newOrgButton" onclick="location.href='RegistryOrganizationInterface.html?mode=add'">Add New Organization</button>
<hr width="500" align="left"/>
<p>
<span id="resultsSpan"></span>
</body>
<script language="JavaScript">
function getOrgs() {
var name=getElementValue("nameText");
RegistryWeb.getOrganization(name,function(output){self.updateResults(output);});
}
function updateResults(result){
document.getElementById("resultsSpan").innerHTML = result;
}
</script>
</html>

View file

@ -1,136 +0,0 @@
<html>
<head>
<style type="text/css">
a {font-weight:bold;}
td {width:200px;}
button {width:190px;}
input{width:300px;}
table {border:0;}
select {width:200px;}
body { font-family: Helvetica;
margin-left: 75px;
margin-right: 75px;
background: #D3D3D3;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src='/dwr/engine.js'></script>
<script type="text/javascript" src='/dwr/util.js'></script>
<title>Backup/Restore Subscriptions</title>
</head>
<body>
<h3>Backup/Restore Data Delivery Subscriptions</h3>
<table>
<tr>
<td>
<button id="backupSubscriptionButton" onClick="backupSubscription()" >Backup Subscription</button>
</td>
<td>
<input id="backupSubscriptionText" type="text"/></td>
</td>
</tr>
<tr>
<td>
<button id="backupAllSubscriptionsButton" onClick="backupAllSubscriptions()">Backup All Subscriptions</button>
</td>
<td>
</td>
</tr>
<tr>
<td>
<button id="restoreSubscriptionButton" onClick="restoreSubscription()" >Restore Subscription</button>
</td>
<td>
<input id="restoreSubscriptionText" type="text"/></td>
</td>
</tr>
<tr>
<td>
<button id="restoreSubscriptionsButton" onClick="restoreSubscriptions()">Restore Subscriptions</button>
</td>
<td>
</td>
</tr>
<tr>
<td>
<button id="viewSubscriptionsButton" onClick="viewSubscriptions()">View Subscriptions</button>
</td>
<td>
</td>
</tr>
<tr>
<td>
<button id="clearBackedUpSubscriptionsButton" onClick="clearBackupDir()">Clear Backup Files</button>
</td>
<td>
</td>
</tr>
</table>
<p>
<p>
<div id="statusSpan" style="font-weight:bold; font-size:8pt"></span>
<br>
</body>
<script language="JavaScript">
function clearBackupDir(){
updateStatus("Clearing backup files...")
updateStatus(callRESTService("clearSubscriptionBackupFiles"))
}
function viewSubscriptions(){
updateStatus("Retrieving Subscriptions...")
updateStatus(callRESTService("getSubscriptions"))
}
function restoreSubscription(){
subscription = document.getElementById("restoreSubscriptionText").value
if(subscription){
updateStatus("Restoring subscription: ["+subscription+"]...")
updateStatus(callRESTService("restoreSubscription/"+subscription))
}else{
updateStatus("Please input a subscription name to be restored")
}
}
function restoreSubscriptions(){
updateStatus("Restoring Subscriptions...")
updateStatus(callRESTService("restoreSubscriptions"))
}
function backupSubscription(){
subscription = document.getElementById("backupSubscriptionText").value
if(subscription){
updateStatus("Backing up subscription: ["+subscription+"]...")
updateStatus(callRESTService("backupSubscription/"+subscription))
}else{
updateStatus("Please input a subscription name to be backed up")
}
}
function backupAllSubscriptions(){
updateStatus("Backing up subscriptions...")
updateStatus(callRESTService("backupAllSubscriptions"))
}
function callRESTService(func){
var url = "http://"+window.location.host+"/dataDelivery/dataAccess/"+func;
var client = new XMLHttpRequest();
client.open("GET", url, false);
client.setRequestHeader("Content-Type", "text/plain");
client.send();
return client.responseText
}
function updateStatus(status){
document.getElementById("statusSpan").innerHTML = status
}
</script>
</html>

View file

@ -1,245 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 0 Transitional//EN">
<html>
<head>
<style type="text/css">
a {font-weight:bold;}
td {width:270px;}
input{width:200px;}
table {border:0;}
select {width:200px;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" media="screen, projection" href="dataDelivery.css"/>
<script type="text/javascript" src='/dwr/engine.js'></script>
<script type="text/javascript" src='/dwr/util.js'></script>
<script type='text/javascript' src='/dwr/interface/RegistryWeb.js'></script>
<script type='text/javascript' src='/dataDeliveryUtil.js'></script>
<script type='text/javascript' src='/validateForm.js'></script>
<title>Data Delivery Registry Admin: Add New User</title>
</head>
<body onLoad="populateFormData('User')">
<span id="titleSpan" style="font-weight:bold; font-size:20pt"></span>
<p>
<a href="javascript:javascript:history.go(-1)">Back</a>
<br>
<a href="RegistryOrganizationMenu.html">Organization Search</a>
<a href="RegistryUserMenu.html">User Search</a>
<hr width="500" align="left"/>
<button id="deletePartyButton" onclick="deleteParty()">Delete User</button>
<button id="modifyPartyButton" onclick="goToModifyUser()">Modify User</button>
<h4>User Information</h4>
<table>
<tr>
<td>User ID</td>
<td><input id="idText" type="text"/></td>
</tr>
<tr>
<td>First Name</td>
<td><input id="firstNameText" type="text"/></td>
</tr>
<tr>
<td>Middle Name</td>
<td><input id="middleNameText" type="text"/></td>
</tr>
<tr>
<td>Last Name</td>
<td><input id="lastNameText" type="text"/></td>
</tr>
<tr>
<td>Organization</td>
<td><select id="userOrgSelect"></td>
</tr>
<tr>
<td>Role</td>
<td><select id="userRoleSelect"></td>
</tr>
<tr>
<td><hr width="100" align="left"/></td>
<td></td>
<tr>
<tr>
<td><b>Address</b></td>
<td><input type="checkbox" onclick="populateOrgAddress()" id="useOrgAddressCheck" name="addressCheck" value="addressCheck" ><span id="useOrgAddressSpan"><i>Use Organization Address</i></span></input></td>
</tr>
<tr>
<td>Address Type</td>
<td><select id="addressTypeSelect"></select></td>
</tr>
<tr>
<td>Address 1</td>
<td><input id="streetAddress1Text" type="text"/></td>
</tr>
<tr>
<td>Address 2</td>
<td><input id="streetAddress2Text" type="text"/></td>
</tr>
<tr>
<td>City</td>
<td><input id="cityText" type="text"/></td>
</tr>
<tr>
<td>State/Province</td>
<td><select id="stateSelect"\></td>
</tr>
<tr>
<td>Country</td>
<td><select id="countrySelect" onchange="populateStates('stateSelect')"\></td>
</tr>
<tr>
<td>Postal Code</td>
<td><input id="postalCodeText" type="text"/></td>
</tr>
<tr>
<td><hr width="100" align="left"/></td>
<td></td>
<tr>
<tr>
<td><b>Telephone</b></td>
<td><input type="checkbox" onclick="populateOrgPhone()" id="useOrgPhoneCheck" name="phoneCheck" value="phoneCheck" ><span id="useOrgPhoneSpan"><i>Use Organization Telephone</i></span></input></td>
</tr>
<tr>
<td>Telephone Type</td>
<td><select id="telephoneTypeSelect"></select></td>
</tr>
<tr>
<td>Telephone Number</td>
<td>(<input id="areaCodeText" type="text" maxlength=3 style='width: 28px;'/>)
<input id="phone1Text" type="text" maxlength=3 style='width: 28px;'/>-
<input id="phone2Text" type="text" maxlength=4 style='width: 36px;'/>
Ext:<input id="extensionText" type="text" maxlength=8 style='width: 70px;'/>
</td>
</tr>
<tr>
<td><hr width="100" align="left"/></td>
<td></td>
<tr>
<tr>
<td><b>Email</b></td>
<td><input type="checkbox" onclick="populateOrgEmail()" id="useOrgEmailCheck" name="emailCheck" value="emailCheck" ><span id="useOrgEmailSpan"><i>Use Organization Email</i></span></input></td>
</tr>
<tr>
<td>Email Type</td>
<td><select id="emailTypeSelect"></select></td>
</tr>
<tr>
<td>Email Address</td>
<td><input id="emailText" type="text" style='width: 260px;'/>
</tr>
<tr>
<td><hr width="100" align="left"/></td>
<td></td>
<tr>
</table>
<p>
<button id="userActionButton" type="button" onclick="partyAction()"/>
</body>
<script language="JavaScript">
/*
* The user currently be looked at by this page. Null if none
*/
self.userId = getUserId();
RegistryWeb.getOrganizationNames("",function(organizations){
clearComboBox("userOrgSelect")
addOptionToList("userOrgSelect","","");
var orgs = splitArray(organizations);
for(var i = 0; i < orgs.length; i++){
addOptionToList("userOrgSelect",orgs[i],orgs[i]);
}
});
RegistryWeb.getRoleTypes(function(roles){
var roleTypes = splitArray(roles);
addOptionToList("userRoleSelect","", "");
for(var i = 0; i < roleTypes.length;i++){
addOptionToList("userRoleSelect",roleTypes[i],roleTypes[i]);
}
});
/*
* The current mode of the page. Valid modes are 'add', 'modify', and 'view'
* The add mode is used when adding a new user to the registry
* The modify mode is used when modifying a user in the registry
* The view mode is used when viewing a user in the registry
*/
self.mode=getMode()
/*
* This function redirects the browser to the registry user interface in the modify mode
*/
function goToModifyUser(){
window.location="RegistryUserInterface.html?id="+self.userId+"&mode=modify"
}
function populateOrgAddress(){
var fields=['addressTypeSelect','streetAddress1Text','streetAddress2Text','cityText',
'stateSelect','countrySelect','postalCodeText'];
if (document.getElementById("useOrgAddressCheck").checked){
var org = getComboValue("userOrgSelect");
RegistryWeb.getPartyDetails(org,function(orgString){
var tokens = orgString.split("_____");
for(var i = 0; i < tokens.length; i++){
var subTokens = tokens[i].split("===");
if(fields.indexOf(subTokens[0])!=-1){
setElementValue(subTokens[0],subTokens[1]);
}
}
});
} else{
for(var i = 0; i < fields.length;i++){
setElementValue(fields[i],"");
}
}
}
function populateOrgPhone(){
var fields=['telephoneTypeSelect','areaCodeText','phone1Text','phone2Text',
'extensionText'];
if (document.getElementById("useOrgPhoneCheck").checked){
var org = getComboValue("userOrgSelect");
RegistryWeb.getPartyDetails(org,function(orgString){
var tokens = orgString.split("_____");
for(var i = 0; i < tokens.length; i++){
var subTokens = tokens[i].split("===");
if(fields.indexOf(subTokens[0])!=-1){
setElementValue(subTokens[0],subTokens[1]);
}
}
});
} else{
for(var i = 0; i < fields.length;i++){
setElementValue(fields[i],"");
}
}
}
function populateOrgEmail(){
var fields=['emailTypeSelect','emailText'];
if (document.getElementById("useOrgEmailCheck").checked){
var org = getComboValue("userOrgSelect");
RegistryWeb.getPartyDetails(org,function(orgString){
var tokens = orgString.split("_____");
for(var i = 0; i < tokens.length; i++){
var subTokens = tokens[i].split("===");
if(fields.indexOf(subTokens[0])!=-1){
setElementValue(subTokens[0],subTokens[1]);
}
}
});
} else{
for(var i = 0; i < fields.length;i++){
setElementValue(fields[i],"");
}
}
}
</script>
</html>

View file

@ -1,58 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<style type="text/css">
a {font-weight:bold;}
table{border:3;}
td {width:200; background-color:deepskyblue}
th {width:200; background-color:aqua; font-size:14pt;}
input{width:200;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" media="screen, projection" href="dataDelivery.css"/>
<script type="text/javascript" src='/dwr/engine.js'></script>
<script type="text/javascript" src='/dwr/util.js'></script>
<script type='text/javascript' src='/dwr/interface/RegistryWeb.js'></script>
<script type='text/javascript' src='/dataDeliveryUtil.js'></script>
<title>Data Delivery Registry Admin</title>
</head>
<body onload="getUsers()">
<h2>Registry User Management Interface</h2>
<a href="RegistryOrganizationMenu.html">View Organizations</a>
<p>
<table>
<tr>
<td style="width:100; background-color: transparent">First Name</td>
<td style="width:100; background-color: transparent"> <input type="text" id="firstNameText" onkeyup="getUsers()"/></td>
</tr>
<tr>
<td style="width:100; background-color: transparent">Last Name</td>
<td style="width:100; background-color: transparent"><input type="text" id="lastNameText" onkeyup="getUsers()"/></td>
</tr>
</table>
<p>
<p>
<hr width="500" align="left"/>
<p>
<button type="button" id="newUserButton" onclick="location.href='RegistryUserInterface.html?mode=add'">Add New User</button>
<hr width="500" align="left"/>
<p>
<span id="resultsSpan"></span>
</body>
<script language="JavaScript">
function getUsers() {
var firstName= getElementValue("firstNameText");
var lastName=getElementValue("lastNameText");
RegistryWeb.getUser(firstName,lastName,function(output){self.updateResults(output);});
}
function updateResults(result){
document.getElementById("resultsSpan").innerHTML = result;
}
</script>
</html>

View file

@ -1,42 +0,0 @@
body{
font-family: Helvetica;
margin-left: 75px;
margin-right: 75px;
background: #D3D3D3;
}
#banner{
background: white;
font-family: Lucida Sans;
font-size: 24pt;
text-align: center;
border: 1px solid #C0C0C0;
}
#interfaceBody{
margin-top: 10px;
}
#interfaceRight{
border: 1px solid #000000;
background: white;
margin-left: 149px;
padding: 10px;
}
#leftTabs{
font-size: 10pt;
float: left;
width: 150px;
}
.leftTabSelected{
background: white;
text-align: center;
border-top: 1px solid black;
border-left: 1px solid black;
border-bottom: 1px solid black;
cursor: default;
}
.leftTabEntry{
background: #A0A0A0;
text-align: center;
border: 1px solid black;
cursor: pointer;
}

View file

@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<title>Error Adding Registry ${partyType}</title>
<body>
Error adding ${partyType} ${userId}
<p>
Cause:
<br>
${cause}
<p>
</body>
</html>

View file

@ -1,13 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<title>Successfully Added ${partyType}</title>
<body>
Successfully added ${partyType}: ${userId}
<p>
<a href="Registry${partyType}Interface.html?id=${userId}&mode=view"><--Back</a>
</body>
</html>

View file

@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<title>Error Deleting Registry ${partyType}</title>
<body>
Error deleting ${partyType} ${userId}
<p>
Cause:
<br>
${cause}
<p>
</body>
</html>

View file

@ -1,13 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<title>Successfully Deleted ${partyType}</title>
<body>
Successfully deleted ${partyType}: ${userId}
<p>
<a href="Registry${partyType}Menu.html?id=${userId}&mode=view"><--Back</a>
</body>
</html>

View file

@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<title>Error Modifying Registry ${partyType}</title>
<body>
Error modifying ${partyType} ${userId}
<p>
Cause:
<br>
${cause}
<p>
</body>
</html>

View file

@ -1,13 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<title>Successfully Modified ${partyType}</title>
<body>
Successfully modified ${partyType}: ${userId}
<p>
<a href="Registry${partyType}Interface.html?id=${userId}&mode=view"><--Back</a>
</body>
</html>

View file

@ -1,97 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
*
* Utility for validating entries on the web page before submission to the server
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 8/8/2012 #724 bphillip Initial creation
*
* </pre>
*
* @author bphillip
* @version 1.0
*/
var requiredMessage ="The following fields are required:\n";
var userReqFields=['id','firstName','lastName',
'userOrg','userRole','addressType',
'streetAddress1','city','state','country',
'postalCode','telephoneType','areaCode','phone1','phone2',
'emailType','email'];
var orgReqFields=['id','organizationName','addressType',
'streetAddress1','city','state','country',
'postalCode','telephoneType','areaCode','phone1','phone2',
'emailType','email'];
var fieldMap={};
fieldMap['id']='ID';
fieldMap['organizationName']='Organization Name';
fieldMap['firstName']='First Name';
fieldMap['middleName']='Middle Name';
fieldMap['lastName']='Last Name';
fieldMap['userOrg']='Organization';
fieldMap['userRole']='Role';
fieldMap['addressType']='Address Type';
fieldMap['streetAddress1']='Address 1';
fieldMap['streetAddress2']='Address 2';
fieldMap['city']='City';
fieldMap['state']='State/Province';
fieldMap['country']='Country';
fieldMap['postalCode']='Postal Code';
fieldMap['telephoneType']='Telephone Type';
fieldMap['areaCode']='Area Code';
fieldMap['phone1']='Telephone Prefix';
fieldMap['phone2']='Telephone Suffix';
fieldMap['extension']='Telephone Extension';
fieldMap['emailType']='Email Type';
fieldMap['email']='Email Address';
function validateFormValues(values){
var requiredFields = null;
if(values.objType=='User'){
requiredFields = userReqFields;
}else{
requiredFields = orgReqFields;
}
var reqFields = "";
for(var property in values){
if(requiredFields.contains(property)){
var val = eval("values."+property);
if(val.isBlank()){
reqFields+="\t"+fieldMap[property]+"\n";
}
}
}
if(!reqFields.isBlank()){
alert(requiredMessage+reqFields)
return false;
}
return true
}

View file

@ -117,9 +117,6 @@
<ref bean="registryObjectsRestService" />
<ref bean="repositoryObjectsRestService" />
<ref bean="queryProtocolRestService" />
<ref bean="AddRegistryParty" />
<ref bean="ModifyRegistryParty" />
<ref bean="DeleteRegistryParty" />
</jaxrs:serviceBeans>
</jaxrs:server>
<!-- End REST Endpoint definitions -->