osman hömek / not defteri

March 28, 2009

Oracle Fonksiyondan Array/Cursor/DataTable döndürme

Filed under: oracle pl/sql — osman @ 11:25 am

TYPES
==================================================================================

CREATE OR REPLACE TYPE “T_EK_CZLG_19_5A_TABLE”
as table of T_EK_CZLG_19_5A_COL

CREATE OR REPLACE TYPE “T_EK_CZLG_19_5A_COL”
as object (
   su_cazibe_1 varchar2(300),
   su_cazibe_2   varchar2(300),
   su_pompaj_3   varchar2(300),
   kurutma_4   varchar2(300)
   )

CREATE OR REPLACE TYPE table_19_5A_ARRAY is VARRAY(5000) OF t_ek_czlg_19_5a_col

FUNCTIONS
==================================================================================

create or replace function get_ek_czlg_19_5A_table(ParamPeriyod in integer)
RETURN table_19_5A_ARRAY AS

l_data table_19_5A_ARRAY := table_19_5A_ARRAY();

cursor c_proje is
  select tblRow1.ad as su_cazibe_1 from
  (select a.id,a.ad from sdb_nesne_degeri a where a.id_nesne_tipi= 502000) tblRow1,
  (select p.id_ust_nesne_degeri,p.deger from sdb_periyodik_veri p where p.id_nesne_degeri=97144 and p.durum=0 and p.periyod=ParamPeriyod) tbl1
  where
  tblRow1.Id = tbl1.id_ust_nesne_degeri(+);

begin

for r1 in c_proje
loop

l_data.extend;
l_data(l_data.count) :=  t_ek_czlg_19_5a_col(r1.su_cazibe_1, ”, ”, ”);

end loop;

return l_data;

end get_ek_czlg_19_5A_table;

SELECT USE
==================================================================================
select * from table(get_ek_czlg_19_5A_table(2005))

March 13, 2009

tasks 9.3

Filed under: arcobjects — osman @ 4:18 pm

Editing versioned and nonversioned data

The Editor task supports editing versioned and nonversioned data. To edit versioned data with the Editor task, you must be using a nonpooled service.

You can edit nonversioned data with either pooled or nonpooled services. When editing nonversioned data, you cannot undo or redo edits or adjust the autoreconciliation options. The last edit to be saved always overwrites any previous edits to the same feature.

Print task

When setting the page size and quality, keep in mind that the GIS server imposes limits on the maximum image size it can return. For example, ArcGIS Server map services, by default, restrict the image size to a maximum of 2048 x 2048 pixels. This means that a 10 inch square map with a quality of 200 dpi is 2000 x 2000 pixels. If the print task map request exceeds the limits of the GIS server, the particular service will not print

March 6, 2009

getDataFrame Name to Toolbar DropDownBox

Filed under: arcobjects — osman @ 4:39 pm

ESRI.ArcGIS.ADF.Web.UI.WebControls.Map mapctrl = Map1;ESRI.ArcGIS.ADF.Web.UI.WebControls.Toolbar toolbar = Toolbar1;

int iResourceItemIndex = 1;string comboDataFrameName = “SelectActiveDataFrame”;//————

ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality ags_mapfunctionality = (ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality)mapctrl.GetFunctionality(iResourceItemIndex);ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal ags_mapresourcelocal = (ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal)ags_mapfunctionality.Resource;ESRI.ArcGIS.Server.

IServerContext ServerContext = ags_mapresourcelocal.ServerContextInfo.ServerContext;IMapServer mapsrv = ServerContext.ServerObject as IMapServer;ESRI.ArcGIS.ADF.Web.UI.WebControls.

DropDownBox activeLayer = (ESRI.ArcGIS.ADF.Web.UI.WebControls.DropDownBox)toolbar.ToolbarItems.Find(comboDataFrameName);activeLayer.Items.Clear();

activeLayer.Items.Add(new ListItem(“Seciniz : Aktif Data Frame”,“”));for (int k = 0; k < mapsrv.MapCount; k++){

activeLayer.Items.Add(new ListItem (mapsrv.get_MapName(k).ToString().Trim(),mapsrv.get_MapName(k).ToString().Trim()));}

System.Runtime.InteropServices.COMException: Exception from HRESULT: 0×80040228.

Filed under: arcobjects — osman @ 2:53 pm

Your developing your application using ArcGIS Engine runtime 9.2 and you get the error System.Runtime.InteropServices.COMException: Exception from HRESULT: 0×80040228, One of the most popular and prodigal cause would be you forgot to initialize the license. Please add the following two lines of code at the beginning of your application (eg: Main()) and that should take care of it.

ESRI.ArcGIS.esriSystem.IAoInitialize ao = new ESRI.ArcGIS.esriSystem.AoInitialize();
ao.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeEngine);
If you dont have ArcGIS Engine 9.2 runtime installed and want to use desktop ArcView license for the development then the code would be

ESRI.ArcGIS.esriSystem.IAoInitialize ao = new ESRI.ArcGIS.esriSystem.AoInitialize();

ao.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcView);
If you dont have ArcGIS Engine 9.2 runtime installed and want to use desktop ArcEditor license for the development then the code would be

ESRI.ArcGIS.esriSystem.IAoInitialize ao = new ESRI.ArcGIS.esriSystem.AoInitialize();
ao.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcEditor);

If you dont have ArcGIS Engine 9.2 runtime installed and want to use desktop ArcInfo license for the development then the code would be

ESRI.ArcGIS.esriSystem.IAoInitialize ao = new ESRI.ArcGIS.esriSystem.AoInitialize();
ao.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcInfo);

March 2, 2009

arcgis server 9.2 run command with server-side

Filed under: arcobjects — osman @ 6:37 pm

<esri:Command ClientAction=”"  Name=”mapref” ServerActionAssembly=”App_Code” ServerActionClass=”util.refreshMap” Text=”Ref Map” />

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using ESRI.ArcGIS.ADF.Web.UI.WebControls.Tools;

namespace util
{
    public class refreshMap: IMapServerCommandAction
    {
        public refreshMap()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        #region IServerAction Members
        public void ServerAction(ToolbarItemInfo info)
        {
            ESRI.ArcGIS.ADF.Web.UI.WebControls.Map mapctrl = (ESRI.ArcGIS.ADF.Web.UI.WebControls.Map)info.BuddyControls[0];
            mapctrl.Refresh();
        }
        #endregion
    }
}

Async Calls using ASP.NET 2.0 Client Callback won’t work properly if the OnComplete function makes another Client Callback

Filed under: development — osman @ 1:03 pm

<script type=”text/javascript”>
function WebForm_CallbackComplete_SyncFixed() {
        // SyncFix: the original version uses “i”
        // as global thereby resulting in
        // javascript errors when “i” is used
        // elsewhere in consuming pages

for (var i = 0; i < __pendingCallbacks.length; i++) {
callbackObject = __pendingCallbacks[ i ];
if (callbackObject && callbackObject.xmlRequest && (callbackObject.xmlRequest.readyState == 4)) {
// the callback should be executed after releasing all resources
// associated with this request.
// Originally if the callback gets executed here and the callback
// routine makes another ASP.NET ajax request then the pending slots and
// pending callbacks array gets messed up since the slot is not released
// before the next ASP.NET request comes.
// FIX: This statement has been moved below
// WebForm_ExecuteCallback(callbackObject);
if (!__pendingCallbacks[ i ].async) {
__synchronousCallBackIndex = -1;
}
__pendingCallbacks[i] = null;

var callbackFrameID = “__CALLBACKFRAME” + i;
var xmlRequestFrame = document.getElementById(callbackFrameID);
if (xmlRequestFrame) {
xmlRequestFrame.parentNode.removeChild(xmlRequestFrame);
}

// SyncFix: the following statement has been moved down from above;
WebForm_ExecuteCallback(callbackObject);
}
}
}
window.onload = function Onload(){
if (typeof (WebForm_CallbackComplete) == “function”) {
// set the original version with fixed version
WebForm_CallbackComplete = WebForm_CallbackComplete_SyncFixed;
}
}
</script>

http://social.msdn.microsoft.com/forums/en-US/netfxjscript/thread/6c4db554-539a-4b5e-9c0c-e1c41eed4fbb/

http://forums.esri.com/Thread.asp?c=158&f=2276&t=249996

düstur!

Filed under: misc — osman @ 11:01 am

Söyleşinin bir bölümünde, bir yönetici ile bir liderin farklarının ne olduğu tartışıldı. Meg Whitman, sadece iyi bir yönetici değil aynı zaman iş dünyasının önemli liderlerinden biri olarak “iyi bir yönetici sadece sonuçlara odaklanır, iyi bir lider ise beraber çalıştığı insanların kendilerini yaptıkları işin bir parçası olarak görmelerini sağlar” diyerek başarısının sırrını açıkladı.Meg Whitman: eBay’ın eski CEO’su, şimdi Palm’ın yönetim kurulu üyesi

9.2 ArcGis Server utility function CreateGraphicLayerData / GetGeometryColInfo

Filed under: arcobjects — osman @ 10:43 am

    public static void GetGeometryColInfo(out string colName, out int colIndex, DataTable geoResultTable)
    {
        string coln = “”;
        int coli = -1;
        try
        {
            for (int k = 0; k < geoResultTable.Columns.Count; k++)
            {
                if (object.ReferenceEquals(geoResultTable.Columns[k].DataType, typeof(ESRI.ArcGIS.ADF.Web.Geometry.Geometry)))
                {
                    coln = geoResultTable.Columns[k].ColumnName;
                    coli = k;
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            colName = coln;
            colIndex = coli;
        }
    }

    public static void CreateGraphicLayerData(ESRI.ArcGIS.ADF.Web.UI.WebControls.Map map, DataTable resultDt, string graphicLayerName, System.Drawing.Color renk1, System.Drawing.Color renk2)
    {
        try
        {
            ESRI.ArcGIS.ADF.Web.Display.Graphics.GraphicsLayer graphicslayer = ESRI.ArcGIS.ADF.Web.UI.WebControls.Converter.ToGraphicsLayer(resultDt, renk1, renk2);
            ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource gResource = null;
            foreach (IGISFunctionality gfunc in map.GetFunctionalities())
            {
                if ((gfunc.Resource is ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource) && (gfunc.Resource.Name == graphicLayerName))
                {
                    gResource = (ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource)gfunc.Resource;
                    gResource.Graphics.Tables.Clear();
                }
            }

            if (gResource != null)
            {
                gResource.Graphics.Tables.Add(graphicslayer);
            }
            else
            {
                //hata donmeli
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

Powered by WordPress