EADS-2207: Add PL/SQL Palette item to grant PLSQLAP permissions release701
authorRifki Razick <riralk@netbeans.org>
Mon, 23 Jan 2012 18:35:21 +0530
branchrelease701
changeset 139329541f1a4c7
parent 138 fa31502abcf7
child 140 b3758a2ce533
EADS-2207: Add PL/SQL Palette item to grant PLSQLAP permissions
PLSQL/Palette/src/org/netbeans/modules/plsql/palette/item/reports/GrantPlSqlAp.java
PLSQL/Palette/src/org/netbeans/modules/plsql/palette/item/reports/resource/Bundle.properties
PLSQL/Palette/src/org/netbeans/modules/plsql/palette/item/reports/resource/GrantPlSqlAp.xml
PLSQL/Palette/src/org/netbeans/modules/plsql/palette/layer.xml
Utilities/Oracle/src/org/netbeans/modules/plsqlsupport/db/ui/Bundle.properties
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/PLSQL/Palette/src/org/netbeans/modules/plsql/palette/item/reports/GrantPlSqlAp.java	Mon Jan 23 18:35:21 2012 +0530
     1.3 @@ -0,0 +1,86 @@
     1.4 +/*
     1.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     1.6 + *
     1.7 + * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
     1.8 + *
     1.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    1.10 + * Other names may be trademarks of their respective owners.
    1.11 + *
    1.12 + * The contents of this file are subject to the terms of either the GNU
    1.13 + * General Public License Version 2 only ("GPL") or the Common
    1.14 + * Development and Distribution License("CDDL") (collectively, the
    1.15 + * "License"). You may not use this file except in compliance with the
    1.16 + * License. You can obtain a copy of the License at
    1.17 + * http://www.netbeans.org/cddl-gplv2.html
    1.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    1.19 + * specific language governing permissions and limitations under the
    1.20 + * License.  When distributing the software, include this License Header
    1.21 + * Notice in each file and include the License file at
    1.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    1.23 + * particular file as subject to the "Classpath" exception as provided
    1.24 + * by Oracle in the GPL Version 2 section of the License file that
    1.25 + * accompanied this code. If applicable, add the following below the
    1.26 + * License Header, with the fields enclosed by brackets [] replaced by
    1.27 + * your own identifying information:
    1.28 + * "Portions Copyrighted [year] [name of copyright owner]"
    1.29 + *
    1.30 + * If you wish your version of this file to be governed by only the CDDL
    1.31 + * or only the GPL Version 2, indicate your decision by adding
    1.32 + * "[Contributor] elects to include this software in this distribution
    1.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    1.34 + * single choice of license, a recipient has the option to distribute
    1.35 + * your version of this file under either the CDDL, the GPL Version 2 or
    1.36 + * to extend the choice of license to its licensees as provided above.
    1.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    1.38 + * Version 2 license, then the option applies only if the new code is
    1.39 + * made subject to such option by the copyright holder.
    1.40 + *
    1.41 + * Contributor(s):
    1.42 + *
    1.43 + * Portions Copyrighted 2011 Sun Microsystems, Inc.
    1.44 + */
    1.45 +package org.netbeans.modules.plsql.palette.item.reports;
    1.46 +
    1.47 +import org.netbeans.modules.plsql.palette.PaletteItem;
    1.48 +
    1.49 +/*
    1.50 + * Class description
    1.51 + *
    1.52 + * Created on January 23, 2012, 6:11 PM
    1.53 + *
    1.54 + * @author IFS
    1.55 + *
    1.56 + * To change this template, choose Tools | Template Manager
    1.57 + * and open the template in the editor.
    1.58 + */
    1.59 +public class GrantPlSqlAp extends PaletteItem{
    1.60 +
    1.61 +    private final String grantPlSqlApBlock =  "DECLARE \n"
    1.62 +                                             +"   acl_ VARCHAR2(100) := 'IFSAPP-PLSQLAP-Permission-${machine.name}.xml'; \n"
    1.63 +                                             +"   privilege_ VARCHAR2(20) := 'connect'; \n"
    1.64 +                                             +"   desc_ VARCHAR2(100) := 'Permission for Foundation1 users to run HTTP from the database.'; \n"
    1.65 +                                             +"BEGIN \n"
    1.66 +                                             +"   Dbms_Network_Acl_Admin.Create_Acl( \n"
    1.67 +                                             +"      acl_, \n"
    1.68 +                                             +"      desc_, \n"
    1.69 +                                             +"      'IFSAPP', \n"
    1.70 +                                             +"      TRUE, \n"
    1.71 +                                             +"      privilege_); \n"
    1.72 +                                             +"   Dbms_Network_Acl_Admin.Add_Privilege( \n"
    1.73 +                                             +"      acl_, \n"
    1.74 +                                             +"      'IFSSYS', \n"
    1.75 +                                             +"      TRUE, \n"
    1.76 +                                             +"      privilege_); \n"
    1.77 +                                             +"   Dbms_Network_Acl_Admin.Assign_Acl( \n"
    1.78 +                                             +"      acl_, \n"
    1.79 +                                             +"      '${machine.name}.corpnet.ifsworld.com', \n"
    1.80 +                                             +"      8080, \n"
    1.81 +                                             +"      8080); \n"
    1.82 +                                             +"END;";
    1.83 +    
    1.84 +    @Override
    1.85 +    public String createBody() {
    1.86 +        return grantPlSqlApBlock;
    1.87 +    }
    1.88 +    
    1.89 +}
     2.1 --- a/PLSQL/Palette/src/org/netbeans/modules/plsql/palette/item/reports/resource/Bundle.properties	Fri Jan 20 11:16:24 2012 +0100
     2.2 +++ b/PLSQL/Palette/src/org/netbeans/modules/plsql/palette/item/reports/resource/Bundle.properties	Mon Jan 23 18:35:21 2012 +0530
     2.3 @@ -17,4 +17,6 @@
     2.4  NAME_Grant_Ifssys = Grant IFSSYS
     2.5  HINT_Grant_Ifssys = Grant database objects needed by Extended Server
     2.6  NAME_Refresh_Reference_Cache = Refresh Reference Cache
     2.7 -HINT_Refresh_Reference_Cache = Refresh Reference Cache
     2.8 \ No newline at end of file
     2.9 +HINT_Refresh_Reference_Cache = Refresh Reference Cache
    2.10 +NAME_Grant_PlSqlAp=Grant PLSQLAP Permission
    2.11 +HINT_Grant_PlSqlAp=Setup privileges (ACL) for IFSAPP to connect to your local application server
    2.12 \ No newline at end of file
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/PLSQL/Palette/src/org/netbeans/modules/plsql/palette/item/reports/resource/GrantPlSqlAp.xml	Mon Jan 23 18:35:21 2012 +0530
     3.3 @@ -0,0 +1,10 @@
     3.4 +<?xml version="1.0" encoding="UTF-8"?>
     3.5 +<!DOCTYPE editor_palette_item PUBLIC "-//NetBeans//Editor Palette Item 1.0//EN" "http://www.netbeans.org/dtds/editor-palette-item-1_0.dtd">
     3.6 +<editor_palette_item version="1.0">
     3.7 +    <class name="org.netbeans.modules.plsql.palette.item.reports.GrantPlSqlAp"/>
     3.8 +    <icon16 urlvalue="org/netbeans/modules/palette/resources/unknown16.gif" />
     3.9 +    <icon32 urlvalue="org/netbeans/modules/palette/resources/unknown32.gif" />
    3.10 +    <description localizing-bundle="org.netbeans.modules.plsql.palette.item.reports.resource.Bundle"
    3.11 +                 display-name-key="NAME_Grant_PlSqlAp"
    3.12 +                 tooltip-key="HINT_Grant_PlSqlAp" />
    3.13 +</editor_palette_item>
    3.14 \ No newline at end of file
     4.1 --- a/PLSQL/Palette/src/org/netbeans/modules/plsql/palette/layer.xml	Fri Jan 20 11:16:24 2012 +0100
     4.2 +++ b/PLSQL/Palette/src/org/netbeans/modules/plsql/palette/layer.xml	Mon Jan 23 18:35:21 2012 +0530
     4.3 @@ -186,6 +186,7 @@
     4.4           <file name="RefreshDictionary.xml" url="item/reports/resource/RefreshDictionary.xml"/>
     4.5           <file name="RefreshReferenceCache.xml" url="item/reports/resource/RefreshReferenceCache.xml"/>
     4.6           <file name="GrantIfssys.xml" url="item/reports/resource/GrantIfssys.xml"/>
     4.7 +         <file name="GrantPlSqlAp.xml" url="item/reports/resource/GrantPlSqlAp.xml"/>
     4.8        </folder>
     4.9     </folder>
    4.10  </filesystem>
     5.1 --- a/Utilities/Oracle/src/org/netbeans/modules/plsqlsupport/db/ui/Bundle.properties	Fri Jan 20 11:16:24 2012 +0100
     5.2 +++ b/Utilities/Oracle/src/org/netbeans/modules/plsqlsupport/db/ui/Bundle.properties	Mon Jan 23 18:35:21 2012 +0530
     5.3 @@ -1,7 +1,7 @@
     5.4  LBL_DatabaseNodeName=Database
     5.5  CTL_SQLExecutionAction=Execute Command...
     5.6 -CTL_RebuildCacheAction=Clear and Refresh Cache of Main Database
     5.7 -CTL_UpdateCacheAction=Refresh Cache of Main Database
     5.8 +CTL_RebuildCacheAction=Clear and Refresh Code Completion Cache
     5.9 +CTL_UpdateCacheAction=Refresh Code Completion Cache
    5.10  CTL_OracleOnlineAction=Work Online
    5.11  CTL_ShowAllDbPackagesAction=List PL/SQL Packages
    5.12  CTL_ShowAllDbTablesAction=List Tables