CREATE PACKAGE "RELEASE_MANAGER"."PK_ENVIRONMENT" IS
/*
------------------------------
||  Last Modified:  Rupesh Solanki
||  Modified Date:  29/Jan/2007
||  Spec Version:   1.1
------------------------------
*/

	TYPE typeCur IS REF CURSOR;

    /*================================================================================================*/

	FUNCTION SELECT_ENVIRONMENT_AREA ( cDlock IN PACKAGE_VERSIONS.DLOCKED%TYPE ) RETURN NUMBER;
	FUNCTION GET_PACKAGE_AREA ( PvId IN NUMBER, RtagId IN NUMBER ) RETURN NUMBER;
	FUNCTION GET_VIEW_LOCATION ( PvId IN NUMBER, RtagId IN NUMBER ) RETURN NUMBER;
	PROCEDURE ADD_PACKAGE ( PvId IN NUMBER, ViewId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );
	PROCEDURE ADD_PACKAGE_BULK ( PvIdList IN VARCHAR2, ViewId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );
	PROCEDURE REPLACE_PACKAGE ( newPvId IN NUMBER, oldPvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );
	FUNCTION REMOVE_PACKAGE ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER, ForceRemove IN CHAR ) RETURN NUMBER;
	
	PROCEDURE GET_ENVIRONMENT_ITEMS ( ViewType IN NUMBER, UserId IN NUMBER, RtagId IN NUMBER,  sViewIdShowList IN VARCHAR2, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );
	PROCEDURE GET_RELEASED_ITEMS ( ViewType IN NUMBER, UserId IN NUMBER, RtagId IN NUMBER,  sViewIdShowList IN VARCHAR2, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );
	PROCEDURE GET_PENDING_ITEMS ( ViewType IN NUMBER, UserId IN NUMBER, RtagId IN NUMBER,  sViewIdShowList IN VARCHAR2, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );
	PROCEDURE GET_WORK_IN_PROGRESS_ITEMS ( ViewType IN NUMBER, UserId IN NUMBER, RtagId IN NUMBER,  sViewIdShowList IN VARCHAR2, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );
	
	PROCEDURE GET_VIEW_CONTENT ( RtagId IN NUMBER, ViewId IN NUMBER, RecordSet OUT typeCur );	

	FUNCTION GET_PACKAGE_VIEW ( PvId IN NUMBER, RtagId IN NUMBER ) RETURN NUMBER;
	
	
	PROCEDURE MAKE_RELEASE ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );
	PROCEDURE MAKE_UNRELEASE ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );

	PROCEDURE MAKE_PENDING ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );
	PROCEDURE MAKE_APPROVED ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );
	PROCEDURE MAKE_REJECT ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );
	
	PROCEDURE CHANGE_PACKAGE_VIEW ( PvId IN NUMBER, RtagId IN NUMBER, NewViewId IN NUMBER );
	
	PROCEDURE FIND_PACKAGE ( sKeyword IN VARCHAR2, nRtagId IN NUMBER, nSearchArea IN NUMBER, RecordSet OUT typeCur );
	PROCEDURE FIND_FILE ( sKeyword IN VARCHAR2, nRtagId IN NUMBER, nSearchArea IN NUMBER, nPageSize IN NUMBER, RecordSet OUT typeCur );
	
	PROCEDURE AUTO_MAKE_RELEASE ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER, VExt IN 
			  			   	 PACKAGE_VERSIONS.V_EXT%TYPE, SSV_EXT IN PACKAGE_VERSIONS.V_EXT%TYPE, 
							 CloneFromPvId IN NUMBER );
							 
	PROCEDURE GET_PRODRELEASE_ITEMS ( RtagId IN NUMBER, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );
							 
	PROCEDURE GET_INTEGRATION_ITEMS ( RtagId IN NUMBER, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );							 
							 
	PROCEDURE GET_TEST_ITEMS ( RtagId IN NUMBER, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );
	
	PROCEDURE GET_DEPLOY_ITEMS ( RtagId IN NUMBER, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );								 							 

	PROCEDURE GET_REJECT_ITEMS ( RtagId IN NUMBER, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );	
	/*================================================================================================*/

END PK_ENVIRONMENT;
/
